Package com.alu.e3.common.camel

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


          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


*/
public class PropertyExtractionProcessor implements Processor {

  @Override
  public void process(Exchange exchange) throws Exception {
    AuthIdentity identity = (AuthIdentity) exchange.getProperty(ExchangeConstantKeys.E3_AUTH_IDENTITY.toString());
    Map<String, String> props = resolveProperties(identity);

    exchange.setProperty(ExchangeConstantKeys.E3_MODEL_PROPERTIES.toString(), props);
  }
View Full Code Here

  @Override
  public void process(Exchange exchange) throws Exception {

    // Get current AuthIdentity
    AuthIdentity authIdentity = exchange.getProperty( ExchangeConstantKeys.E3_AUTH_IDENTITY.toString(), AuthIdentity.class);

    // extracts subscriber id and checks authorization
    String subscriberId = extractSubscriberId(exchange);
    if (null == subscriberId) return ;
View Full Code Here

public class SubscriberIDGenerator implements Processor {
 
  @Override
  public void process(Exchange exchange) throws Exception {

    AuthIdentity authIdentity = exchange.getProperty(ExchangeConstantKeys.E3_AUTH_IDENTITY.toString(), AuthIdentity.class);
   
    String subscriberId = null;
   
    //TODO: Check if It's what we need as subscriberID
    if (authIdentity == null || authIdentity.getAuth() == null || authIdentity.getApi() == null)
      subscriberId = UUID.randomUUID().toString();
    else
      // Align subscriberId format with SubscriberIdExtractor processor!
      subscriberId = new StringBuilder(authIdentity.getApi().getId()).append("|").append(authIdentity.getAuth().getId()).toString();
   
    exchange.getIn().setHeader(E3Constant.SUBSCRIBER_ID_HEADER_NAME, subscriberId);
  }
View Full Code Here

    protected ProducerTemplate producerTemplate;
 
  @Test
  @DirtiesContext
  public void testRateOK() throws Exception {
    AuthIdentity authIdentity = new AuthIdentity();
    Auth auth = new Auth();
    auth.setId("abc");
    authIdentity.setAuth(auth);

    AuthProcessorMock authProcessor =  new AuthProcessorMock(authIdentity);

    checkAuth.whenAnyExchangeReceived(authProcessor);
View Full Code Here

  }

  @Test
  @DirtiesContext
  public void testRateKO() throws Exception {
    AuthIdentity authIdentity = new AuthIdentity();
    Auth auth = new Auth();
    auth.setId("ko");
    authIdentity.setAuth(auth);

    AuthProcessorMock authProcessor =  new AuthProcessorMock(authIdentity);

    checkAuth.whenAnyExchangeReceived(authProcessor);
View Full Code Here

  }

  @Test
  @DirtiesContext
  public void testRateLimitNotExeeded() throws Exception {
    AuthProcessorMock authProcessor =  new AuthProcessorMock(new AuthIdentity());

    checkAuth.whenAnyExchangeReceived(authProcessor);

    RateLimitProcessor rateProcessor = new RateLimitProcessor();
    rateProcessor.setGatewayRateMger(new AlwaysAllowed());
View Full Code Here

   
    if(expectedAuthKey != null) {
   
      if(expectedAuthKey.equals(authKey)) {
       
        AuthIdentity authIdentity = new AuthIdentity();
        authIdentity.setAppId("1234");
        authReport.setAuthIdentity(authIdentity);
        authReport.setApiActive(true);
       
      } else {
        authReport.setNotAuthorized(true);
View Full Code Here

   
    AuthReport authReport = new AuthReport();
 
    if(expectedIp != null) {
      if(expectedIp.equals(ip.getIp())) {
        AuthIdentity authIdentity = new AuthIdentity();
        authIdentity.setAppId("127.0.0.1");
        authReport.setAuthIdentity(authIdentity);
        authReport.setApiActive(true);
      } else {
        authReport.setNotAuthorized(true);
      }     
View Full Code Here

    AuthReport authReport = new AuthReport();
   
    if(expectedUserPass != null) {
     
      if(expectedUserPass.equals(user+":"+password)) {
        AuthIdentity authIdentity = new AuthIdentity();
        authIdentity.setAppId("2424");
        authReport.setAuthIdentity(authIdentity);
        authReport.setApiActive(true);
      } else {
        authReport.setNotAuthorized(true);
      }     
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.