Class TrustedIdentityProvider

java.lang.Object
io.automatiko.engine.api.auth.TrustedIdentityProvider
All Implemented Interfaces:
IdentityProvider

public class TrustedIdentityProvider extends Object implements IdentityProvider
Trusted identity provider is intended to be used by system wide operations that might not have any security context attached e.g. timer expiration, messaging consumers etc. Trusted identity is considered an admin so it can perform any operation
  • Constructor Details

    • TrustedIdentityProvider

      public TrustedIdentityProvider(String name)
  • Method Details

    • isAdmin

      public boolean isAdmin()
      Description copied from interface: IdentityProvider
      Checks if given identity is an admin
      Specified by:
      isAdmin in interface IdentityProvider
      Returns:
      returns true if the identity has admin rights otherwise false
    • getName

      public String getName()
      Description copied from interface: IdentityProvider
      Returns name assigned to the current context, usually refers to user name
      Specified by:
      getName in interface IdentityProvider
      Returns:
      assigned name taken from security context
    • getRoles

      public List<String> getRoles()
      Description copied from interface: IdentityProvider
      Returns roles assigned to the current context if any
      Specified by:
      getRoles in interface IdentityProvider
      Returns:
      list of assigned roles or empty list
    • hasRole

      public boolean hasRole(String role)
      Description copied from interface: IdentityProvider
      Checks if given role is assigned to current context
      Specified by:
      hasRole in interface IdentityProvider
      Parameters:
      role - role to be checked
      Returns:
      true if the role is found otherwise null
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • properties

      public Map<String,Object> properties()
      Description copied from interface: IdentityProvider
      Returns map of additional properties that can be consumed by AccessPolicy implementations
      Specified by:
      properties in interface IdentityProvider
      Returns:
      non null map of properties