Examples of AuthIdentity


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

*/
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

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

  @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

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

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

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

    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

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

  }

  @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

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

  }

  @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

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

   
    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

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

   
    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

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

    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

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
TOP
Copyright © 2018 www.massapi.com. 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.