Class SimpleAuthorisationService.Builder

java.lang.Object
io.aeron.security.SimpleAuthorisationService.Builder
Enclosing class:
SimpleAuthorisationService

public static class SimpleAuthorisationService.Builder extends Object
Builder to create the authorisation service.
  • 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@id value that the rule applies to.
      actionId - sbe:message@id value 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@id value that the rule applies to.
      actionId - sbe:message@id value 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@id value 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@id value that the rule applies to.
      actionId - sbe:message@id value 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@id value that the rule applies to.
      actionId - sbe:message@id value that the rule applies to.
      isAllowed - If the rule should allow or deny access.
      Returns:
      this for a fluent API.
    • addGeneralRule

      public SimpleAuthorisationService.Builder addGeneralRule(int protocolId, boolean isAllowed)
      Add rule for all principals that is scoped to a protocolId.
      Parameters:
      protocolId - sbe:messageSchema@id value that the rule applies to.
      isAllowed - If the rule should allow or deny access.
      Returns:
      this for a fluent API.
    • newInstance

      public SimpleAuthorisationService newInstance()
      Create and instance of the SimpleAuthorisationService.
      Returns:
      new SimpleAuthorisationService.