Class InterceptMethodMapGrpcServerSecurityRule
java.lang.Object
io.micronaut.grpc.server.security.AbstractGrpcServerSecurityRule
io.micronaut.grpc.server.security.InterceptMethodMapGrpcServerSecurityRule
- All Implemented Interfaces:
io.micronaut.core.order.Ordered, GrpcServerSecurityRule
@Singleton
@Requires(beans=GrpcServerSecurityConfiguration.class)
public final class InterceptMethodMapGrpcServerSecurityRule
extends AbstractGrpcServerSecurityRule
Evaluates the
grpc.server.security.intercept-method-map rules against fully qualified gRPC method names.
The HTTP micronaut.security.intercept-url-map is intentionally not used, because its entries are
Ant-style HTTP path patterns that do not apply to gRPC method names.
- Since:
- 5.3.0
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionInterceptMethodMapGrpcServerSecurityRule(GrpcServerSecurityConfiguration grpcServerSecurityConfiguration, io.micronaut.security.token.RolesFinder rolesFinder) -
Method Summary
Modifier and TypeMethodDescription<T,S> io.micronaut.security.rules.SecurityRuleResult check(io.grpc.ServerCall<T, S> serverCall, io.grpc.Metadata metadata, @Nullable io.micronaut.security.authentication.Authentication authentication) Checks the current gRPC server call.Methods inherited from class AbstractGrpcServerSecurityRule
compareRoles, getRolesMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.core.order.Ordered
getOrder
-
Constructor Details
-
InterceptMethodMapGrpcServerSecurityRule
public InterceptMethodMapGrpcServerSecurityRule(GrpcServerSecurityConfiguration grpcServerSecurityConfiguration, io.micronaut.security.token.RolesFinder rolesFinder) - Parameters:
grpcServerSecurityConfiguration- The gRPC security configurationrolesFinder- The roles finder
-
-
Method Details
-
check
public <T,S> io.micronaut.security.rules.SecurityRuleResult check(io.grpc.ServerCall<T, S> serverCall, io.grpc.Metadata metadata, @Nullable @Nullable io.micronaut.security.authentication.Authentication authentication) Description copied from interface:GrpcServerSecurityRuleChecks the current gRPC server call.- Type Parameters:
T- The request typeS- The response type- Parameters:
serverCall- The current gRPC callmetadata- The gRPC metadataauthentication- The authentication, if available- Returns:
- The rule result, or
SecurityRuleResult.UNKNOWNwhen the rule does not apply
-