@Test public void shouldCreateGrpcSecurityHandlerWithRoles() { GrpcSecurityHandler handler = GrpcSecurity.rolesAllowed("foo", "bar"); assertThat(handler.getRolesAllowed().orElse(null), containsInAnyOrder("foo", "bar")); assertThat(handler.isAuthenticate().orElse(null), is(true)); assertThat(handler.isAuthorize().orElse(null), is(true)); assertThat(handler.isAuthenticationOptional().orElse(null), is(nullValue())); assertThat(handler.isAudited().orElse(null), is(nullValue())); assertThat(handler.getAuditEventType().orElse(null), is(nullValue())); assertThat(handler.getAuditMessageFormat().orElse(null), is(nullValue())); assertThat(handler.getExplicitAuthenticator().orElse(null), is(nullValue())); assertThat(handler.getExplicitAuthorizer().orElse(null), is(nullValue())); }
public static GrpcSecurityHandler rolesAllowed(String... roles) { return GrpcSecurityHandler.create().rolesAllowed(roles); }
GrpcSecurity implements ServerInterceptor, ServiceDescriptor.Configurer { public static GrpcSecurityHandler rolesAllowed(String... roles) { return GrpcSecurityHandler.create().rolesAllowed(roles); } }
GrpcSecurity implements ServerInterceptor, ServiceDescriptor.Configurer { public static GrpcSecurityHandler rolesAllowed(String... roles) { return GrpcSecurityHandler.create().rolesAllowed(roles); } private  GrpcSecurity(Security security, Config config); private  GrpcSecurity(Security security, Optional<Config> config, GrpcSecurityHandler defaultHandler); }
GrpcSecurity implements ServerInterceptor, ServiceDescriptor.Configurer { public static GrpcSecurityHandler rolesAllowed(String... roles) { return GrpcSecurityHandler.create().rolesAllowed(roles); } private  GrpcSecurity(Security security, Config config); private  GrpcSecurity(Security security, Optional<Config> config, GrpcSecurityHandler defaultHandler); static GrpcSecurity create(Security security); static GrpcSecurity create(Config config); static GrpcSecurity create(Security security, Config config); static GrpcSecurityHandler secure(); static GrpcSecurityHandler authenticate(); static GrpcSecurityHandler audit(); static GrpcSecurityHandler authenticator(String explicitAuthenticator); static GrpcSecurityHandler authorizer(String explicitAuthorizer); static GrpcSecurityHandler rolesAllowed(String... roles); static GrpcSecurityHandler allowAnonymous(); static GrpcSecurityHandler authorize(); static GrpcSecurityHandler enforce(); GrpcSecurity securityDefaults(GrpcSecurityHandler defaultHandler); @Override void configure(ServiceDescriptor.Rules rules); @Override ServerCall.Listener<ReqT> interceptCall(ServerCall<ReqT, RespT> call,
                                                                 Metadata headers,
                                                                 ServerCallHandler<ReqT, RespT> next); }
GrpcSecurity implements ServerInterceptor, ServiceDescriptor.Configurer { public static GrpcSecurityHandler rolesAllowed(String... roles) { return GrpcSecurityHandler.create().rolesAllowed(roles); } private  GrpcSecurity(Security security, Config config); private  GrpcSecurity(Security security, Optional<Config> config, GrpcSecurityHandler defaultHandler); static GrpcSecurity create(Security security); static GrpcSecurity create(Config config); static GrpcSecurity create(Security security, Config config); static GrpcSecurityHandler secure(); static GrpcSecurityHandler authenticate(); static GrpcSecurityHandler audit(); static GrpcSecurityHandler authenticator(String explicitAuthenticator); static GrpcSecurityHandler authorizer(String explicitAuthorizer); static GrpcSecurityHandler rolesAllowed(String... roles); static GrpcSecurityHandler allowAnonymous(); static GrpcSecurityHandler authorize(); static GrpcSecurityHandler enforce(); GrpcSecurity securityDefaults(GrpcSecurityHandler defaultHandler); @Override void configure(ServiceDescriptor.Rules rules); @Override ServerCall.Listener<ReqT> interceptCall(ServerCall<ReqT, RespT> call,
                                                                 Metadata headers,
                                                                 ServerCallHandler<ReqT, RespT> next); static final Context.Key<Map> CONTEXT_ADD_HEADERS; static final Context.Key<SecurityContext> SECURITY_CONTEXT; static final Context.Key<GrpcSecurityHandler> GRPC_SECURITY_HANDLER; static final String ABAC_ATTRIBUTE_REMOTE_ADDRESS; static final String ABAC_ATTRIBUTE_REMOTE_PORT; static final String ABAC_ATTRIBUTE_HEADERS; static final String ABAC_ATTRIBUTE_METHOD; }