Package com.alu.e3.common.camel

Examples of com.alu.e3.common.camel.AuthIdentity


  @Override
  public AuthReport checkAllowed(Api api) {
   
    AuthReport authReport = new AuthReport();

    AuthIdentity authIdentity = new AuthIdentity();
    authIdentity.setAppId("3424");
    authReport.setAuthIdentity(authIdentity);
    authReport.setApiActive(true);
       
    return authReport;
  }
View Full Code Here


  @Override
  public AuthReport checkAllowed(Exchange exchange, Api api) {
 
    AuthReport authReport = new AuthReport();
   
    AuthIdentity authIdentity = new AuthIdentity();
    authIdentity.setAppId("1234");
   
    authReport.setAuthIdentity(authIdentity);
    authReport.setApiActive(true);
    authReport.setAuthActive(true);
   
View Full Code Here

  public AuthReport checkAllowed(Exchange exchange, Api api) {
   
    AuthReport authReport = new AuthReport();
   
    if(exchange.getIn().getHeaders().size() > 0) {
      AuthIdentity authIdentity = new AuthIdentity();
      authIdentity.setAppId("1234");
      authReport.setAuthIdentity(authIdentity);
      authReport.setApiActive(true);
      authReport.setAuthActive(true);
    } else {
      authReport.setBadRequest(true);
View Full Code Here

public class TestHelper {

  public static Exchange setupExchange(){
    Exchange exchange = new MockExchange();

    AuthIdentity id = new AuthIdentity();
    Api api = new Api();
    Policy policy1 = new Policy();
    Auth auth = new Auth();
    CallDescriptor cd = new CallDescriptor(policy1, 0, 0);

    id.setApi(api);
    id.setAuth(auth);
    id.getCallDescriptors().add(cd);

    exchange.setProperty(ExchangeConstantKeys.E3_AUTH_IDENTITY.toString(), id);

    return exchange;
  }
View Full Code Here

  public AuthReport checkAllowed(Exchange exchange, Api api) {
   
    AuthReport authReport = new AuthReport();
   
    if(exchange.getIn().getHeader(AuthHttpHeaders.Authorization.toString()) != null) {
      AuthIdentity authIdentity = new AuthIdentity();
      authIdentity.setAppId("1234");
      authReport.setAuthIdentity(authIdentity);
      authReport.setApiActive(true);
      authReport.setAuthActive(true);
    }
   
View Full Code Here

    if (property == null || ! (property instanceof AuthIdentity)) {
      throw new GatewayException(GatewayExceptionCode.RATEORQUOTA, "The property " + ExchangeConstantKeys.E3_AUTH_IDENTITY.toString() + " is required to check the rate limits.");
    }

    boolean isTDREnabled = exchange.getProperty(ExchangeConstantKeys.E3_TDR_ENABLED.toString(), boolean.class);
    AuthIdentity authIdentity = (AuthIdentity) property;
    LimitCheckResult limitCheckResult = rateManager.isAllowed(authIdentity, isTDREnabled);

    if(isTDREnabled){
      /**
       * Put some TDR data into into service
View Full Code Here

      if(authReport.isApiActive()) {

        List<CallDescriptor> descriptors = this.dataManager.getMatchingPolicies(api);
       
        if(descriptors != null) {
          authReport.setAuthIdentity(new AuthIdentity());
          authReport.getAuthIdentity().setApi(api);
          authReport.getAuthIdentity().getCallDescriptors().addAll(descriptors);         
        } else {
          if(logger.isDebugEnabled()) {
            logger.debug("NoAuth method is not enabled");
View Full Code Here

                break;
              }
            }
           
            if (foundPolicy) {
              authReport.setAuthIdentity(new AuthIdentity());
              authReport.getAuthIdentity().setApi(api);
              authReport.getAuthIdentity().setAuth(auth);
              authReport.getAuthIdentity().getCallDescriptors().addAll(descriptors);
            } else {
              if(logger.isDebugEnabled()) {
View Full Code Here

public class AuthIdentityHelper {

  private AuthIdentity authIdentity = null;
 
  public AuthIdentityHelper() {
    this.authIdentity = new AuthIdentity();
  }
View Full Code Here

   * prerequisite TDR stuff.
   */
  @Before
  public void setup(){
    exchange = TestHelper.setupExchange();
    AuthIdentity id = (AuthIdentity) exchange.getProperty(ExchangeConstantKeys.E3_AUTH_IDENTITY.toString());
    auth = id.getAuth();
    api = id.getApi();
    policy1 = id.getCallDescriptors().get(0).getPolicy();

    responseProcessor = new TDRResponseProcessor();
    requestProcessor = new TDRRequestProcessor();
    staticProcessor = new TDRStaticProcessor();

View Full Code Here

TOP

Related Classes of com.alu.e3.common.camel.AuthIdentity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.