public final class ManualGrpcSecurityMetadataSource extends AbstractGrpcSecurityMetadataSource
GrpcSecurityMetadataSource for manual configuration. For each gRPC method a
AccessPredicate can be defined, that checks whether the user is authenticated and has access. This metadata
source only works if an AccessDecisionManager is configured with an AccessPredicateVoter.
Note: This instance is initialized with deny all as default.
| Constructor and Description |
|---|
ManualGrpcSecurityMetadataSource() |
| Modifier and Type | Method and Description |
|---|---|
Collection<ConfigAttribute> |
getAllConfigAttributes() |
Collection<ConfigAttribute> |
getAttributes(io.grpc.ServerCall<?,?> call)
Accesses the
ConfigAttributes that apply to a given secure object. |
ManualGrpcSecurityMetadataSource |
remove(io.grpc.MethodDescriptor<?,?> method)
Removes all access predicates for the given method.
|
ManualGrpcSecurityMetadataSource |
remove(io.grpc.ServiceDescriptor service)
Removes all access predicates for the all methods of the given service.
|
ManualGrpcSecurityMetadataSource |
set(io.grpc.MethodDescriptor<?,?> method,
AccessPredicate predicate)
Set the given access predicate for the given method.
|
ManualGrpcSecurityMetadataSource |
set(io.grpc.ServiceDescriptor service,
AccessPredicate predicate)
Set the given access predicate for the all methods of the given service.
|
ManualGrpcSecurityMetadataSource |
setDefault(AccessPredicate predicate)
Sets the default that will be used if no specific configuration has been made.
|
getAttributes, supportspublic Collection<ConfigAttribute> getAttributes(io.grpc.ServerCall<?,?> call)
GrpcSecurityMetadataSourceConfigAttributes that apply to a given secure object.call - The grpc call being secured.public Collection<ConfigAttribute> getAllConfigAttributes()
public ManualGrpcSecurityMetadataSource set(io.grpc.ServiceDescriptor service, AccessPredicate predicate)
service - The service to protect with a custom check.predicate - The predicate used to check the Authentication.setDefault(AccessPredicate)public ManualGrpcSecurityMetadataSource remove(io.grpc.ServiceDescriptor service)
service - The service to protect with only the default.setDefault(AccessPredicate)public ManualGrpcSecurityMetadataSource set(io.grpc.MethodDescriptor<?,?> method, AccessPredicate predicate)
method - The method to protect with a custom check.predicate - The predicate used to check the Authentication.setDefault(AccessPredicate)public ManualGrpcSecurityMetadataSource remove(io.grpc.MethodDescriptor<?,?> method)
method - The method to protect with only the default.setDefault(AccessPredicate)public ManualGrpcSecurityMetadataSource setDefault(AccessPredicate predicate)
predicate - The default predicate used to check the Authentication.