Search in sources :

Example 1 with AuditLogHandler

use of co.cask.cdap.security.server.AuditLogHandler in project cdap by caskdata.

the class SecurityModule method configure.

@Override
protected final void configure() {
    bind(new TypeLiteral<Codec<AccessToken>>() {
    }).to(AccessTokenCodec.class).in(Scopes.SINGLETON);
    bind(new TypeLiteral<Codec<AccessTokenIdentifier>>() {
    }).to(AccessTokenIdentifierCodec.class).in(Scopes.SINGLETON);
    bind(new TypeLiteral<Codec<KeyIdentifier>>() {
    }).to(KeyIdentifierCodec.class).in(Scopes.SINGLETON);
    bindKeyManager(binder());
    bind(TokenManager.class).in(Scopes.SINGLETON);
    bind(ExternalAuthenticationServer.class).in(Scopes.SINGLETON);
    MapBinder<String, Object> handlerBinder = MapBinder.newMapBinder(binder(), String.class, Object.class, Names.named("security.handlers.map"));
    handlerBinder.addBinding(ExternalAuthenticationServer.HandlerType.AUTHENTICATION_HANDLER).toProvider(AuthenticationHandlerProvider.class).in(Scopes.SINGLETON);
    handlerBinder.addBinding(ExternalAuthenticationServer.HandlerType.GRANT_TOKEN_HANDLER).to(GrantAccessToken.class).in(Scopes.SINGLETON);
    bind(AuditLogHandler.class).annotatedWith(Names.named(ExternalAuthenticationServer.NAMED_EXTERNAL_AUTH)).toInstance(new AuditLogHandler(EXTERNAL_AUTH_AUDIT_LOG));
    bind(TokenValidator.class).to(AccessTokenValidator.class);
    bind(AccessTokenTransformer.class).in(Scopes.SINGLETON);
    expose(AccessTokenTransformer.class);
    expose(TokenValidator.class);
    expose(TokenManager.class);
    expose(ExternalAuthenticationServer.class);
    expose(new TypeLiteral<Codec<KeyIdentifier>>() {
    });
}
Also used : ExternalAuthenticationServer(co.cask.cdap.security.server.ExternalAuthenticationServer) AccessTokenIdentifierCodec(co.cask.cdap.security.auth.AccessTokenIdentifierCodec) AccessTokenTransformer(co.cask.cdap.security.auth.AccessTokenTransformer) AccessTokenCodec(co.cask.cdap.security.auth.AccessTokenCodec) KeyIdentifierCodec(co.cask.cdap.security.auth.KeyIdentifierCodec) Codec(co.cask.cdap.common.io.Codec) AccessTokenIdentifierCodec(co.cask.cdap.security.auth.AccessTokenIdentifierCodec) AccessTokenValidator(co.cask.cdap.security.auth.AccessTokenValidator) TokenValidator(co.cask.cdap.security.auth.TokenValidator) AccessTokenCodec(co.cask.cdap.security.auth.AccessTokenCodec) AuditLogHandler(co.cask.cdap.security.server.AuditLogHandler) GrantAccessToken(co.cask.cdap.security.server.GrantAccessToken) TokenManager(co.cask.cdap.security.auth.TokenManager) KeyIdentifierCodec(co.cask.cdap.security.auth.KeyIdentifierCodec)

Aggregations

Codec (co.cask.cdap.common.io.Codec)1 AccessTokenCodec (co.cask.cdap.security.auth.AccessTokenCodec)1 AccessTokenIdentifierCodec (co.cask.cdap.security.auth.AccessTokenIdentifierCodec)1 AccessTokenTransformer (co.cask.cdap.security.auth.AccessTokenTransformer)1 AccessTokenValidator (co.cask.cdap.security.auth.AccessTokenValidator)1 KeyIdentifierCodec (co.cask.cdap.security.auth.KeyIdentifierCodec)1 TokenManager (co.cask.cdap.security.auth.TokenManager)1 TokenValidator (co.cask.cdap.security.auth.TokenValidator)1 AuditLogHandler (co.cask.cdap.security.server.AuditLogHandler)1 ExternalAuthenticationServer (co.cask.cdap.security.server.ExternalAuthenticationServer)1 GrantAccessToken (co.cask.cdap.security.server.GrantAccessToken)1