@Override public boolean configure(FeatureContext context) { context.register(new AbstractBinder() { @Override public void configure() { bind(TokenAuthenticator.class) .in(Singleton.class); bind(TokenFactory.class) .in(Singleton.class); bind(TokenFactoryProvider.class) .to(ValueFactoryProvider.class) .in(Singleton.class); bind(TokenParamInjectionResolver.class) .to(new TypeLiteral<InjectionResolver<RobeAuth>>() { }) .in(Singleton.class); } }); return true; }
@Override protected void configure() { // bind default Configuration to DSLContext bindFactory(new DSLContextFactory(configurationMap.values().stream().findFirst().orElse(null))) .to(DSLContext.class) .in(RequestScoped.class); // bind multiple instances of Configuration and ConnectionProvider for Named DSLContext(s) for (final Configuration configuration : configurationMap.values()) { bind(configuration).to(Configuration.class); bind(configuration.connectionProvider()) .to(ConnectionProvider.class); } // bind a ValueFactoryProvider for Named DSLContext(s) bind(new DSLContextValueFactoryProvider(configurationMap)) .to(ValueFactoryProvider.class); }
@Override protected void configure() { bind(new RateLimiterFactoryProvider(requestRateLimiterFactory)).to(RateLimiterFactoryProvider.class); bind(RateLimitingFactoryProvider.class).to(ValueFactoryProvider.class).in(Singleton.class); bind(RateLimitingFactoryProvider.RateLimitingInjectionResolver.class) .to(new TypeLiteral<InjectionResolver<RateLimiting>>() {}).in(Singleton.class); }
@Override protected void configure() { bind(TestRateLimitingFactoryProvider.class).to(ValueFactoryProvider.class).in(Singleton.class); bind(TestRateLimitingFactoryProvider.TestRateLimitingInjectionResolver.class).to( new TypeLiteral<InjectionResolver<RateLimiting>>() { } ).in(Singleton.class); }
@Override protected void configure() { bind(JsonParamValueFactoryProvider.class).to(ValueFactoryProvider.class).in(Singleton.class); bind(JsonParamValueFactoryProvider.InjectionResolver.class).to(new TypeLiteral<InjectionResolver<JsonParam>>() { }).in(Singleton.class); }
@Override protected void configure() { bind(profile).to(ProfileFactoryBuilder.class); bind(optProfile).to(OptionalProfileFactoryBuilder.class); bind(manager).to(ProfileManagerFactoryBuilder.class); bind(Pac4JProfileValueFactoryProvider.class).to(ValueFactoryProvider.class).in(Singleton.class); bind(ProfileInjectionResolver.class).to(new TypeLiteral<InjectionResolver<Pac4JProfile>>() { }).in(Singleton.class); bind(ProfileManagerInjectionResolver.class).to(new TypeLiteral<InjectionResolver<Pac4JProfileManager>>() { }).in(Singleton.class); }
@Override protected void configure() { bind(CustomAnnotationProvider.class) .to(ValueFactoryProvider.class) .in(Singleton.class); bind(CustomAnnotationResolver.class) .to(new TypeLiteral<InjectionResolver<CustomAnnotation>>() { }) .in(Singleton.class); }
@Override protected void configure() { bind(clientAuthFactory); bind(automationClientAuthFactory); bind(userAuthFactory); bind(AuthValueFactoryProvider.class).to(ValueFactoryProvider.class).in(Singleton.class); bind(AuthInjectionResolver.class).to(new TypeLiteral<InjectionResolver<Auth>>() {}).in(Singleton.class); }
@Override protected void configure() { bind(new ConfigurationFactoryInfo(configuration, dataSource, multiTenantConnectionProvider)) .to(ConfigurationFactoryInfo.class); bind(ConfigurationFactoryProvider.class).to(ValueFactoryProvider.class).in(Singleton.class); bind(ConfigurationInjectionResolver.class).to(new TypeLiteral<InjectionResolver<JooqConfiguration>>() { }).in(Singleton.class); }
@Override protected void configure() { bind(AuthHeaderParamValueFactoryProvider.class) .to(ValueFactoryProvider.class) .in(Singleton.class); bind(UserAuthHeaderParamResolver.class) .to(new TypeLiteral<InjectionResolver<AuthParam>>() { }) .in(Singleton.class); }
@Override protected void configure() { bindFactory(configPropertiesFactory).to(ConfigProperties.class); bind(PropertiesValueFactoryProvider.PropertyInjectionResolver.class) .to(new TypeLiteral<InjectionResolver<Prop>>() { }).in(Singleton.class); bind(PropertiesValueFactoryProvider.class) .to(ValueFactoryProvider.class) .in(Singleton.class); }
@Override protected void configure() { bind(new PrincipalClassProvider<>(principalClass)).to(PrincipalClassProvider.class); bind(TokenFactoryProvider.class).to(ValueFactoryProvider.class).in(Singleton.class); bind(TokenParamInjectionResolver.class).to(new TypeLiteral<InjectionResolver<RobeAuth>>() { }).in(Singleton.class); }
@Override public void bind(DynamicConfiguration config) { Injections.addBinding( Injections.newFactoryBinder(this).to(type).in(Singleton.class), config); Injections.addBinding( Injections.newBinder(this).to(ValueFactoryProvider.class), config); }
protected void configure() { bind(PrincipalFactory.class) .to(PrincipalFactory.class) .to(new TypeLiteral<Factory<P>>() {}) .in(Singleton.class); bind(PrincipalValueFactoryProvider.class) .to(AbstractValueFactoryProvider.class) .to(ValueFactoryProvider.class) .in(Singleton.class); bind(PrincipalInjectionResolver.class) .to(new TypeLiteral<ParamInjectionResolver<HmacAuth>>() {}) .to(new TypeLiteral<InjectionResolver<HmacAuth>>() {}) .in(Singleton.class); }
@Override public boolean configure(FeatureContext context) { context.register(new AbstractBinder() { @Override public void configure() { bind(SingularityMultiMethodAuthenticator.class).to(new TypeLiteral<Authenticator<ContainerRequestContext, SingularityUser>>() {}).in(Singleton.class); bind(SingularityAuthedUserFactory.class).to(SingularityAuthedUserFactory.class).in(Singleton.class); bind(SingularityAuthFactoryProvider.class).to(ValueFactoryProvider.class).in(Singleton.class); bind(SingularityAuthParamInjectionResolver.class).to(new TypeLiteral<InjectionResolver<Auth>>(){}).in(Singleton.class); } }); return true; }
@Override protected void configure() { bind(SecurityCheckFactoryProvider.class).to(ValueFactoryProvider.class).in(Singleton.class); bind(SecurityCheckInjectionResolver.class).to(new TypeLiteral<InjectionResolver<SecurityCheck>>() { }).in(Singleton.class); bind(userService).to(UserService.class); }
@Override protected void configure() { bind(SearchFactoryProvider.class).to(ValueFactoryProvider.class).in(Singleton.class); bind(SearchParamInjectionResolver.class).to(new TypeLiteral<InjectionResolver<SearchParam>>() { }).in(Singleton.class); }
@Override public PriorityType getPriority() { return ValueFactoryProvider.Priority.NORMAL; }
@Override protected void configure() { bind(DummyAuth.class).to(ValueFactoryProvider.class).in(Singleton.class); }
@Override protected void configure() { bind(SessionHelperFactoryProvider.class).to(ValueFactoryProvider.class).in(Singleton.class); bind(SessionHelperInjectionResolver.class).to(new TypeLiteral<InjectionResolver<Context>>() { }).in(Singleton.class); }