Search in sources :

Example 1 with AllowAllAuthorizer

use of org.apache.druid.server.security.AllowAllAuthorizer in project druid by druid-io.

the class AsyncQueryForwardingServletTest method setupInjector.

@Override
protected Injector setupInjector() {
    return Initialization.makeInjectorWithModules(GuiceInjectors.makeStartupInjector(), ImmutableList.<Module>of(new Module() {

        @Override
        public void configure(Binder binder) {
            JsonConfigProvider.bindInstance(binder, Key.get(DruidNode.class, Self.class), new DruidNode("test", "localhost", false, null, null, true, false));
            binder.bind(JettyServerInitializer.class).to(ProxyJettyServerInit.class).in(LazySingleton.class);
            binder.bind(AuthorizerMapper.class).toInstance(new AuthorizerMapper(null) {

                @Override
                public Authorizer getAuthorizer(String name) {
                    return new AllowAllAuthorizer();
                }
            });
            Jerseys.addResource(binder, SlowResource.class);
            Jerseys.addResource(binder, ExceptionResource.class);
            Jerseys.addResource(binder, DefaultResource.class);
            LifecycleModule.register(binder, Server.class);
        }
    }));
}
Also used : Binder(com.google.inject.Binder) Authorizer(org.apache.druid.server.security.Authorizer) AllowAllAuthorizer(org.apache.druid.server.security.AllowAllAuthorizer) AuthorizerMapper(org.apache.druid.server.security.AuthorizerMapper) Self(org.apache.druid.guice.annotations.Self) AllowAllAuthorizer(org.apache.druid.server.security.AllowAllAuthorizer) Module(com.google.inject.Module) LifecycleModule(org.apache.druid.guice.LifecycleModule)

Aggregations

Binder (com.google.inject.Binder)1 Module (com.google.inject.Module)1 LifecycleModule (org.apache.druid.guice.LifecycleModule)1 Self (org.apache.druid.guice.annotations.Self)1 AllowAllAuthorizer (org.apache.druid.server.security.AllowAllAuthorizer)1 Authorizer (org.apache.druid.server.security.Authorizer)1 AuthorizerMapper (org.apache.druid.server.security.AuthorizerMapper)1