use of keywhiz.inject.StrictGuiceModule in project keywhiz by square.
the class CryptoModuleTest method secureRandomIsExplicitlyBound.
@Test
public void secureRandomIsExplicitlyBound() {
KeywhizConfig config = ServiceContext.create().getConfig();
Injector injector = Guice.createInjector(new CryptoModule(config.getDerivationProviderClass(), config.getContentKeyStore()), new StrictGuiceModule());
assertNotNull(injector.getInstance(SecureRandom.class));
}
use of keywhiz.inject.StrictGuiceModule in project keywhiz by square.
the class ServiceModule method configure.
@Override
protected void configure() {
// Initialize the BouncyCastle security provider for cryptography support.
BouncyCastle.require();
bind(ClientCertificateFilter.class).toProvider(ClientCertificateFilter::new);
bind(Clock.class).toInstance(Clock.systemUTC());
bind(CookieConfig.class).annotatedWith(SessionCookie.class).toInstance(config.getSessionCookieConfig());
bind(SecurityHeadersFilter.class).toProvider(SecurityHeadersFilter::new);
bind(SessionMeResource.class).toProvider(SessionMeResource::new);
install(new ContextModule(config, environment));
install(new CookieModule(config.getCookieKey()));
install(new CryptoModule(config.getDerivationProviderClass(), config.getContentKeyStore()));
install(new DaoModule());
install(new StrictGuiceModule());
}
Aggregations