Search in sources :

Example 1 with CookieModule

use of keywhiz.auth.cookie.CookieModule 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(Clock.class).toInstance(Clock.systemUTC());
    install(new CookieModule(config.getCookieKey()));
    install(new CryptoModule(config.getDerivationProviderClass(), config.getContentKeyStore()));
    bind(CookieConfig.class).annotatedWith(SessionCookie.class).toInstance(config.getSessionCookieConfig());
    bind(CookieConfig.class).annotatedWith(Xsrf.class).toInstance(config.getXsrfCookieConfig());
    // TODO(justin): Consider https://github.com/HubSpot/dropwizard-guice.
    bind(Environment.class).toInstance(environment);
    bind(Configuration.class).toInstance(config);
    bind(KeywhizConfig.class).toInstance(config);
}
Also used : CryptoModule(keywhiz.service.crypto.CryptoModule) Configuration(io.dropwizard.Configuration) Xsrf(keywhiz.auth.xsrf.Xsrf) Environment(io.dropwizard.setup.Environment) CookieModule(keywhiz.auth.cookie.CookieModule) SessionCookie(keywhiz.auth.cookie.SessionCookie) Clock(java.time.Clock)

Aggregations

Configuration (io.dropwizard.Configuration)1 Environment (io.dropwizard.setup.Environment)1 Clock (java.time.Clock)1 CookieModule (keywhiz.auth.cookie.CookieModule)1 SessionCookie (keywhiz.auth.cookie.SessionCookie)1 Xsrf (keywhiz.auth.xsrf.Xsrf)1 CryptoModule (keywhiz.service.crypto.CryptoModule)1