Search in sources :

Example 1 with DaoModule

use of com.sanction.thunder.dao.DaoModule in project thunder by RohanNagar.

the class ThunderApplication method run.

@Override
public void run(ThunderConfiguration config, Environment env) {
    ThunderComponent component = DaggerThunderComponent.builder().daoModule(new DaoModule()).dynamoDbModule(new DynamoDbModule(config.getDynamoConfiguration())).emailModule(new EmailModule(config.getEmailConfiguration())).thunderModule(new ThunderModule(env.metrics(), config)).build();
    // Authentication
    env.jersey().register(new AuthDynamicFeature(new BasicCredentialAuthFilter.Builder<Key>().setAuthenticator(component.getThunderAuthenticator()).setRealm("THUNDER - AUTHENTICATION").buildAuthFilter()));
    env.jersey().register(new AuthValueFactoryProvider.Binder<>(Key.class));
    // HealthChecks
    env.healthChecks().register("DynamoDB", component.getDynamoDbHealthCheck());
    // Resources
    env.jersey().register(component.getUserResource());
    env.jersey().register(component.getVerificationResource());
}
Also used : BasicCredentialAuthFilter(io.dropwizard.auth.basic.BasicCredentialAuthFilter) AuthValueFactoryProvider(io.dropwizard.auth.AuthValueFactoryProvider) DynamoDbModule(com.sanction.thunder.dynamodb.DynamoDbModule) EmailModule(com.sanction.thunder.email.EmailModule) AuthDynamicFeature(io.dropwizard.auth.AuthDynamicFeature) DaoModule(com.sanction.thunder.dao.DaoModule) Key(com.sanction.thunder.authentication.Key)

Aggregations

Key (com.sanction.thunder.authentication.Key)1 DaoModule (com.sanction.thunder.dao.DaoModule)1 DynamoDbModule (com.sanction.thunder.dynamodb.DynamoDbModule)1 EmailModule (com.sanction.thunder.email.EmailModule)1 AuthDynamicFeature (io.dropwizard.auth.AuthDynamicFeature)1 AuthValueFactoryProvider (io.dropwizard.auth.AuthValueFactoryProvider)1 BasicCredentialAuthFilter (io.dropwizard.auth.basic.BasicCredentialAuthFilter)1