bind(String.class).annotatedWith(named("authentication.scheme")) .toInstance(getProperty("authentication.scheme", properties)); bind(String.class).annotatedWith(named("authentication.token.scheme")) .toInstance(getProperty("authentication.token.scheme", properties)); bind(String.class).annotatedWith(named("authentication.token.salt")) .toInstance(getProperty("authentication.token.salt", properties)); bind(String.class).annotatedWith(named("authentication.token.version")) .toInstance(getProperty("authentication.token.version", properties)); bind(String.class).annotatedWith(named("authentication.http.proxy.host")) .toInstance(getProperty("http.proxy.host", properties)); bind(Integer.class).annotatedWith(named("authentication.http.proxy.port")) .toInstance(Integer.parseInt(getProperty("http.proxy.port", properties, "80"))); Class<Authentication> authImplClass = (Class<Authentication>) forName(authenticationClassName); bind(Authentication.class).to(authImplClass).in(SINGLETON); bind(AuthenticateByHttpRequest.class).to(NoOpAuthenticateByHttpRequestImpl.class).asEagerSingleton(); } catch (ClassNotFoundException e) { LOGGER.error("unable to find class: {}", authenticationClassName, e);
@Override protected void configure() { LOGGER.debug("installing module: {}", AuthorizationModule.class.getSimpleName()); install(new AuthenticationModule()); install(new EventLogModule()); install(new CassandraRepositoryModule()); Properties properties = create(PROPERTY_NAME, AuthorizationModule.class); String authorizationClassName = getProperty("authorization.class.name", properties, "com.intuit.wasabi.authorization.impl.DefaultAuthorization"); try { @SuppressWarnings("unchecked") Class<Authorization> authorizationClass = (Class<Authorization>) forName(authorizationClassName); bind(Authorization.class).to(authorizationClass).in(SINGLETON); } catch (ClassNotFoundException e) { throw new AuthenticationException("unable to find authorization class: " + authorizationClassName, e); } LOGGER.debug("installed module: {}", AuthorizationModule.class.getSimpleName()); } }