Package io.aeron.security
Interface AuthorisationService
- All Known Implementing Classes:
AllowBackupAndStandbyAuthorisationService,SimpleAuthorisationService
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Interface for an authorisation service to handle authorisation checks on clients performing actions to a system.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AuthorisationServiceAnAuthorisationServiceinstance that allows every action.static final StringSpecial case token for authorisation service supplier that allow all requests.static final AuthorisationServiceAnAuthorisationServiceinstance that forbids all actions.static final StringSpecial case token for authorisation service supplier that will deny all requests. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisAuthorised(int protocolId, int actionId, Object type, byte[] encodedPrincipal) Checks if the client with authenticated credentials is allowed to perform an action indicated by the givenactionId.
-
Field Details
-
ALLOW_ALL
AnAuthorisationServiceinstance that allows every action. -
DENY_ALL
AnAuthorisationServiceinstance that forbids all actions. -
DENY_ALL_NAME
Special case token for authorisation service supplier that will deny all requests.- See Also:
-
ALLOW_ALL_NAME
Special case token for authorisation service supplier that allow all requests.- See Also:
-
-
Method Details
-
isAuthorised
Checks if the client with authenticated credentials is allowed to perform an action indicated by the givenactionId.- Parameters:
protocolId- of the protocol to which the action belongs, e.g. a SBE schema id.actionId- of the command being checked, e.g. a SBE message template id.type- optional type for the action being checked, may benull. For example for an admin request in the cluster it will containAdminRequestTypevalue which denotes the exact kind of the request.encodedPrincipal- that has been authenticated.- Returns:
trueif the client is authorised to execute the action orfalseotherwise.
-