Package io.automatiko.engine.api.auth
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
-
-
Field Summary
-
Fields inherited from interface io.automatiko.engine.api.auth.IdentityProvider
current, UNKNOWN_USER_IDENTITY
-
-
Constructor Summary
Constructors Constructor Description TrustedIdentityProvider(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetName()Returns name assigned to the current context, usually refers to user nameList<String>getRoles()Returns roles assigned to the current context if anybooleanhasRole(String role)Checks if given role is assigned to current contextbooleanisAdmin()Checks if given identity is an adminMap<String,Map<String,String>>properties()Returns map of additional properties that can be consumed byAccessPolicyimplementationsStringtoString()
-
-
-
Constructor Detail
-
TrustedIdentityProvider
public TrustedIdentityProvider(String name)
-
-
Method Detail
-
isAdmin
public boolean isAdmin()
Description copied from interface:IdentityProviderChecks if given identity is an admin- Specified by:
isAdminin interfaceIdentityProvider- Returns:
- returns true if the identity has admin rights otherwise false
-
getName
public String getName()
Description copied from interface:IdentityProviderReturns name assigned to the current context, usually refers to user name- Specified by:
getNamein interfaceIdentityProvider- Returns:
- assigned name taken from security context
-
getRoles
public List<String> getRoles()
Description copied from interface:IdentityProviderReturns roles assigned to the current context if any- Specified by:
getRolesin interfaceIdentityProvider- Returns:
- list of assigned roles or empty list
-
hasRole
public boolean hasRole(String role)
Description copied from interface:IdentityProviderChecks if given role is assigned to current context- Specified by:
hasRolein interfaceIdentityProvider- Parameters:
role- role to be checked- Returns:
- true if the role is found otherwise null
-
properties
public Map<String,Map<String,String>> properties()
Description copied from interface:IdentityProviderReturns map of additional properties that can be consumed byAccessPolicyimplementations- Specified by:
propertiesin interfaceIdentityProvider- Returns:
- non null map of properties
-
-