Package io.aeron.security
Class SimpleAuthorisationService.Builder
java.lang.Object
io.aeron.security.SimpleAuthorisationService.Builder
- Enclosing class:
- SimpleAuthorisationService
Builder to create the authorisation service.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddGeneralRule(int protocolId, boolean isAllowed) Add rule for all principals that is scoped to a protocolId.addGeneralRule(int protocolId, int actionId, boolean isAllowed) Add rule for all principals that is scoped to a protocolId and actionId.addGeneralRule(int protocolId, int actionId, Object type, boolean isAllowed) Add rule for all principals that is scoped to a protocolId, actionId, and type.addPrincipalRule(int protocolId, byte[] encodedPrincipal, boolean isAllowed) Add rule for a specific principal that is scoped to a protocolId.addPrincipalRule(int protocolId, int actionId, byte[] encodedPrincipal, boolean isAllowed) Add rule for a specific principal that is scoped to a protocolId, and actionId.addPrincipalRule(int protocolId, int actionId, Object type, byte[] encodedPrincipal, boolean isAllowed) Add rule for a specific principal that is scoped to a protocolId, actionId, and type.defaultAuthorisation(AuthorisationService defaultAuthorisation) Set the default authorisation if the authorisation request does not match any of the supplied rules.Create and instance of theSimpleAuthorisationService.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
defaultAuthorisation
public SimpleAuthorisationService.Builder defaultAuthorisation(AuthorisationService defaultAuthorisation) Set the default authorisation if the authorisation request does not match any of the supplied rules.- Parameters:
defaultAuthorisation- an authorisation service to fall back to.- Returns:
- this for a fluent API
- See Also:
-
addPrincipalRule
public SimpleAuthorisationService.Builder addPrincipalRule(int protocolId, int actionId, Object type, byte[] encodedPrincipal, boolean isAllowed) Add rule for a specific principal that is scoped to a protocolId, actionId, and type.- Parameters:
protocolId-sbe:messageSchema@idvalue that the rule applies to.actionId-sbe:message@idvalue that the rule applies to.type- A parameter of the message can be used to narrow the scope of the authorisation rule. This is message dependent.encodedPrincipal- The principal encoded as byte array.isAllowed- If the rule should allow or deny access.- Returns:
- this for a fluent API.
-
addPrincipalRule
public SimpleAuthorisationService.Builder addPrincipalRule(int protocolId, int actionId, byte[] encodedPrincipal, boolean isAllowed) Add rule for a specific principal that is scoped to a protocolId, and actionId.- Parameters:
protocolId-sbe:messageSchema@idvalue that the rule applies to.actionId-sbe:message@idvalue that the rule applies to.encodedPrincipal- The principal encoded as byte array.isAllowed- If the rule should allow or deny access.- Returns:
- this for a fluent API.
-
addPrincipalRule
public SimpleAuthorisationService.Builder addPrincipalRule(int protocolId, byte[] encodedPrincipal, boolean isAllowed) Add rule for a specific principal that is scoped to a protocolId.- Parameters:
protocolId-sbe:messageSchema@idvalue that the rule applies to.encodedPrincipal- The principal encoded as byte array.isAllowed- If the rule should allow or deny access.- Returns:
- this for a fluent API.
-
addGeneralRule
public SimpleAuthorisationService.Builder addGeneralRule(int protocolId, int actionId, Object type, boolean isAllowed) Add rule for all principals that is scoped to a protocolId, actionId, and type.- Parameters:
protocolId-sbe:messageSchema@idvalue that the rule applies to.actionId-sbe:message@idvalue that the rule applies to.type- A parameter of the message can be used to narrow the scope of the authorisation rule. This is message dependent.isAllowed- If the rule should allow or deny access.- Returns:
- this for a fluent API.
-
addGeneralRule
public SimpleAuthorisationService.Builder addGeneralRule(int protocolId, int actionId, boolean isAllowed) Add rule for all principals that is scoped to a protocolId and actionId.- Parameters:
protocolId-sbe:messageSchema@idvalue that the rule applies to.actionId-sbe:message@idvalue that the rule applies to.isAllowed- If the rule should allow or deny access.- Returns:
- this for a fluent API.
-
addGeneralRule
Add rule for all principals that is scoped to a protocolId.- Parameters:
protocolId-sbe:messageSchema@idvalue that the rule applies to.isAllowed- If the rule should allow or deny access.- Returns:
- this for a fluent API.
-
newInstance
Create and instance of theSimpleAuthorisationService.- Returns:
- new
SimpleAuthorisationService.
-