Package com.alu.e3.common.camel

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


    parameters.put(appKeyName, null);
    exchange.setProperty(ExchangeConstantKeys.E3_REQUEST_PARAMETERS.toString(), parameters);
   
    AppKeyExecutor executor = new AppKeyExecutor(appKeyName, appHeaderName, new MockAuthDataAccess("asdf", null, null));
   
    AuthReport authReport = executor.checkAllowed(exchange, api);
   
    assertNull("This authentication should have failed", authReport.getAuthIdentity());
  }
View Full Code Here


public class MockIpWhitelistExecutor implements IAuthExecutor {

  @Override
  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);
    }
   
    //return exchange.getIn().getHeaders().size() > 0?new AppIdentity("1234"):null;
   
    return authReport; 
View Full Code Here

    // Setting the username = "win" should succeed
    exchange.getIn().setHeader(AuthHttpHeaders.Authorization.toString(), "Basic "+new String(Base64.encodeBase64("win:blarg".getBytes())));
    HttpBasicExecutor executor = new HttpBasicExecutor(new MockAuthDataAccess(null, "win:blarg", null));
   
    AuthReport authReport = executor.checkAllowed(exchange, api);   

    assertNotNull("This authentication should have succeeded", authReport.getAuthIdentity());
  }
View Full Code Here

    // Setting the username = "win" should succeed
    exchange.getIn().setHeader(AuthHttpHeaders.Authorization.toString(), "Basic "+"win:blarg");
    HttpBasicExecutor executor = new HttpBasicExecutor(new MockAuthDataAccess(null, "win:blarg", null));
   
    AuthReport authReport = executor.checkAllowed(exchange, api);

    assertNull("This authentication should have failed", authReport.getAuthIdentity());
  }
View Full Code Here

    api.setId("123");

    // Setting the username = "win" should succeed
    HttpBasicExecutor executor = new HttpBasicExecutor(new MockAuthDataAccess(null, "win:blarg", null));
   
    AuthReport authReport = executor.checkAllowed(exchange, api);

    assertNull("This authentication should have failed", authReport.getAuthIdentity());
  }
View Full Code Here

    // Setting the username = "win" should succeed
    exchange.getIn().setHeader(AuthHttpHeaders.Authorization.toString(), "Vlasic "+new String(Base64.encodeBase64("win:blarg".getBytes())));
    HttpBasicExecutor executor = new HttpBasicExecutor(new MockAuthDataAccess(null, "win:blarg", null));
   
    AuthReport authReport = executor.checkAllowed(exchange, api);
   
    assertNull("This authentication should have failed", authReport.getAuthIdentity());
  }
View Full Code Here

    // Setting the username = "win" should succeed
    // This one is bad because it is missing the space between Basic and the user/pass
    exchange.getIn().setHeader(AuthHttpHeaders.Authorization.toString(), "Basic"+new String(Base64.encodeBase64("win:blarg".getBytes())));
    HttpBasicExecutor executor = new HttpBasicExecutor(new MockAuthDataAccess(null, "win:blarg", null));
   
    AuthReport authReport = executor.checkAllowed(exchange, api);   

    assertNull("This authentication should have failed", authReport.getAuthIdentity());
  }
View Full Code Here

  private int queueWaitingSize = 2000; // Only default

  private static PerfWatch perfWatch;
  public PerfWatch getPerfWatch() {
    if (perfWatch == null )
      perfWatch = new PerfWatch();
   
    return perfWatch;
  }
View Full Code Here

  private static final int TDR_FILE_AGE = 30 * 1000;   // TDR file age rotation trigger

  private static PerfWatch perfWatch;
  public PerfWatch getPerfWatch() {
    if (perfWatch == null )
      perfWatch = new PerfWatch();
   
    return perfWatch;
  }
View Full Code Here

  private static Logger logger = Logger.getLogger(TDRResponseProcessor.class);

  private static PerfWatch perfWatch;
  public PerfWatch getPerfWatch() {
    if (perfWatch == null )
      perfWatch = new PerfWatch();
   
    return perfWatch;
  }
View Full Code Here

TOP

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

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.