Class AbstractGrpcServerSecurityRule

java.lang.Object
io.micronaut.grpc.server.security.AbstractGrpcServerSecurityRule
All Implemented Interfaces:
io.micronaut.core.order.Ordered, GrpcServerSecurityRule
Direct Known Subclasses:
InterceptMethodMapGrpcServerSecurityRule

public abstract class AbstractGrpcServerSecurityRule extends Object implements GrpcServerSecurityRule
Base support for gRPC server security rules.
Since:
5.0.0
  • Field Summary

    Fields inherited from interface io.micronaut.core.order.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractGrpcServerSecurityRule(io.micronaut.security.token.RolesFinder rolesFinder)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected io.micronaut.security.rules.SecurityRuleResult
    compareRoles(List<String> requiredRoles, List<String> grantedRoles)
    Compares required and granted roles.
    protected List<String>
    getRoles(@Nullable io.micronaut.security.authentication.Authentication authentication)
    Resolves the granted roles for the current authentication: the roles exposed by Authentication.getRoles() combined with the roles resolved from its attributes by the RolesFinder.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface GrpcServerSecurityRule

    check

    Methods inherited from interface io.micronaut.core.order.Ordered

    getOrder
  • Constructor Details

    • AbstractGrpcServerSecurityRule

      protected AbstractGrpcServerSecurityRule(io.micronaut.security.token.RolesFinder rolesFinder)
      Parameters:
      rolesFinder - The roles finder
  • Method Details

    • getRoles

      protected List<String> getRoles(@Nullable @Nullable io.micronaut.security.authentication.Authentication authentication)
      Resolves the granted roles for the current authentication: the roles exposed by Authentication.getRoles() combined with the roles resolved from its attributes by the RolesFinder.
      Parameters:
      authentication - The current authentication
      Returns:
      The granted roles
    • compareRoles

      protected io.micronaut.security.rules.SecurityRuleResult compareRoles(List<String> requiredRoles, List<String> grantedRoles)
      Compares required and granted roles.
      Parameters:
      requiredRoles - The required roles
      grantedRoles - The granted roles
      Returns:
      The security rule result