Package com.alu.e3.auth.camel.endpoint

Examples of com.alu.e3.auth.camel.endpoint.AuthEndpoint


          executors.add(executor);
        }
      }
      }

    return new AuthEndpoint(uri, this, executors, dataManager, apiId);
  }
View Full Code Here


   * This tests the case where the endpoint is configured correctly and we expect a successful HttpBasic authentication
   * @throws Exception
   */
  @Test
  public void testSuccessHttpBasic() throws Exception{
    AuthEndpoint endpoint = (AuthEndpoint) component.createEndpoint("blah?apiId=1234&basic=true");
    AuthProducer producer = (AuthProducer) endpoint.createProducer();
    Exchange exchange = new DefaultExchange(context);
    // Anything will work for the mock executor... it just has to be set
    exchange.getIn().setHeader(AuthHttpHeaders.Authorization.toString(), "blarg");
   
    producer.process(exchange);
View Full Code Here

  /**
   * This test the case where the endpoint is configured correctly and we expect a failed httpbasic authentication
   */
  @Test
  public void testFailHttpBasic() throws Exception{
    AuthEndpoint endpoint = (AuthEndpoint) component.createEndpoint("blah?apiId=1234&basic=true");
    AuthProducer producer = (AuthProducer) endpoint.createProducer();
    Exchange exchange = new DefaultExchange(context);
   
    producer.process(exchange);
   
    testNotAuthenticated(exchange);
View Full Code Here

   * This tests the case where the endpoint is configured correctly and we expect a successful appkey authentication
   * @throws Exception
   */
  @Test
  public void testSuccessAppKey() throws Exception{
    AuthEndpoint endpoint = (AuthEndpoint) component.createEndpoint("blah?apiId=1234&authKey=true&keyName=appkey");
    AuthProducer producer = (AuthProducer) endpoint.createProducer();
    Exchange exchange = new DefaultExchange(context);
    // Anything will work for the mock executor... it just has to be set
    exchange.getIn().setHeader("appkey", "blarg");
   
    producer.process(exchange);
View Full Code Here

  /**
   * This test the case where the endpoint is configured correctly and we expect a failed appkey authentication
   */
  @Test
  public void testFailAppKey() throws Exception{
    AuthEndpoint endpoint = (AuthEndpoint) component.createEndpoint("blah?apiId=1234&authKey=true&keyName=appkey");
    AuthProducer producer = (AuthProducer) endpoint.createProducer();
    Exchange exchange = new DefaultExchange(context);
   
    producer.process(exchange);
   
    testNotAuthenticated(exchange);
View Full Code Here

   * This tests the case where the endpoint is configured correctly and we expect a successful whitelist authentication
   * @throws Exception
   */
  @Test
  public void testSuccessWhitelist() throws Exception{
    AuthEndpoint endpoint = (AuthEndpoint) component.createEndpoint("blah?apiId=1234&ipList=true");
    AuthProducer producer = (AuthProducer) endpoint.createProducer();
    Exchange exchange = new DefaultExchange(context);
    // Anything will work for the mock executor... it just has to be set
    exchange.getIn().setHeader("source-ip", "127.0.0.1");
   
    producer.process(exchange);
View Full Code Here

  /**
   * This test the case where the endpoint is configured correctly and we expect a failed whitelist authentication
   */
  @Test
  public void testFailWhitelist() throws Exception{
    AuthEndpoint endpoint = (AuthEndpoint) component.createEndpoint("blah?apiId=1234&ipList=true");
    AuthProducer producer = (AuthProducer) endpoint.createProducer();
    Exchange exchange = new DefaultExchange(context);
   
    producer.process(exchange);
   
    testNotAuthenticated(exchange);
View Full Code Here

  }
 
  
  @Test
  public void testSuccessNoAuth() throws Exception{
    AuthEndpoint endpoint = (AuthEndpoint) component.createEndpoint("blah?apiId=1234&noAuth=true");
    AuthProducer producer = (AuthProducer) endpoint.createProducer();
    Exchange exchange = new DefaultExchange(context);
   
    producer.process(exchange);
   
    testAuthenticated(exchange);
View Full Code Here

    testAuthenticated(exchange);
  }
 
  @Test
  public void testFailNoAuth() throws Exception{
    AuthEndpoint endpoint = (AuthEndpoint) component.createEndpoint("blah?apiId=1234&noAuth=false");
    AuthProducer producer = (AuthProducer) endpoint.createProducer();
    Exchange exchange = new DefaultExchange(context);
   
    producer.process(exchange);
   
    testNotAuthenticated(exchange);
View Full Code Here

          LOG.debug("Getting Policy:", policyId);
        }

        com.alu.e3.data.model.Policy policyDataModel = dataManager.getPolicyById(policyId);
        if(policyDataModel == null)
          throw new InvalidIDException("A Policy with that ID does not exist");

        Policy policy = BeanConverterUtil.fromDataModel(policyDataModel);

        PolicyResponse response = new PolicyResponse(PolicyResponse.SUCCESS);
        response.setPolicy(policy);
View Full Code Here

TOP

Related Classes of com.alu.e3.auth.camel.endpoint.AuthEndpoint

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.