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
ConstructorsModifierConstructorDescriptionprotectedAbstractGrpcServerSecurityRule(io.micronaut.security.token.RolesFinder rolesFinder) -
Method Summary
Modifier and TypeMethodDescriptionprotected io.micronaut.security.rules.SecurityRuleResultcompareRoles(List<String> requiredRoles, List<String> grantedRoles) Compares required and granted roles.getRoles(@Nullable io.micronaut.security.authentication.Authentication authentication) Resolves the granted roles for the current authentication: the roles exposed byAuthentication.getRoles()combined with the roles resolved from its attributes by theRolesFinder.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface GrpcServerSecurityRule
checkMethods 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 byAuthentication.getRoles()combined with the roles resolved from its attributes by theRolesFinder.- Parameters:
authentication- The current authentication- Returns:
- The granted roles
-
compareRoles
-