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
  • Constructor Details

    • InterceptMethodMapGrpcServerSecurityRule

      public InterceptMethodMapGrpcServerSecurityRule(GrpcServerSecurityConfiguration grpcServerSecurityConfiguration, io.micronaut.security.token.RolesFinder rolesFinder)
      Parameters:
      grpcServerSecurityConfiguration - The gRPC security configuration
      rolesFinder - 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: GrpcServerSecurityRule
      Checks the current gRPC server call.
      Type Parameters:
      T - The request type
      S - The response type
      Parameters:
      serverCall - The current gRPC call
      metadata - The gRPC metadata
      authentication - The authentication, if available
      Returns:
      The rule result, or SecurityRuleResult.UNKNOWN when the rule does not apply