Class QServicePrincipalMetaData

java.lang.Object
com.kingsrook.qqq.backend.core.serviceidentity.QServicePrincipalMetaData
All Implemented Interfaces:
Serializable

public class QServicePrincipalMetaData extends Object implements Serializable
A named identity that background work runs as (docs/SERVICE-IDENTITY.md). Under OAuth2 its authority comes only from the identity provider: the principal's service account and that account's groups and policy. The credentials are read from the environment (never from meta-data, the database or the filesystem): QQQ_SERVICE_{NAME}_USERNAME and QQQ_SERVICE_{NAME}_SECRET, NAME upper-cased with non-alphanumerics as _. localPermissions and localSecurityKeyValues apply ONLY to deployments whose authentication module supports local principals (TABLE_BASED, MOCK, fully anonymous). OAuth2 and Auth0 ignore them.
See Also:
  • Constructor Details

    • QServicePrincipalMetaData

      public QServicePrincipalMetaData()
  • Method Details

    • getPrincipalId

      public String getPrincipalId()
      The id written to audits and logs: service:{name}.
    • getUsernameEnvironmentVariable

      public String getUsernameEnvironmentVariable()
      Name of the environment variable holding the service account's username.
    • getSecretEnvironmentVariable

      public String getSecretEnvironmentVariable()
      Name of the environment variable holding the service account's secret.
    • getName

      public String getName()
      Getter for name
    • setName

      public void setName(String name)
      Setter for name
    • withName

      public QServicePrincipalMetaData withName(String name)
      Fluent setter for name - lowercase letters, digits and dashes (e.g. scheduler).
    • getLabel

      public String getLabel()
      Getter for label
    • setLabel

      public void setLabel(String label)
      Setter for label
    • withLabel

      public QServicePrincipalMetaData withLabel(String label)
      Fluent setter for label
    • getDescription

      public String getDescription()
      Getter for description
    • setDescription

      public void setDescription(String description)
      Setter for description
    • withDescription

      public QServicePrincipalMetaData withDescription(String description)
      Fluent setter for description
    • getMayActOnBehalfOfUsers

      public boolean getMayActOnBehalfOfUsers()
      Getter for mayActOnBehalfOfUsers
    • setMayActOnBehalfOfUsers

      public void setMayActOnBehalfOfUsers(boolean mayActOnBehalfOfUsers)
      Setter for mayActOnBehalfOfUsers
    • withMayActOnBehalfOfUsers

      public QServicePrincipalMetaData withMayActOnBehalfOfUsers(boolean mayActOnBehalfOfUsers)
      Fluent setter for mayActOnBehalfOfUsers - whether this principal may run work on behalf of a user (it must also hold qqq.service.actOnBehalf).
    • getDelegatedAccess

      public QServicePrincipalMetaData.DelegatedAccess getDelegatedAccess()
      Getter for delegatedAccess
    • setDelegatedAccess

      public void setDelegatedAccess(QServicePrincipalMetaData.DelegatedAccess delegatedAccess)
      Setter for delegatedAccess
    • withDelegatedAccess

      public QServicePrincipalMetaData withDelegatedAccess(QServicePrincipalMetaData.DelegatedAccess delegatedAccess)
      Fluent setter for delegatedAccess (default USER: the user's full access).
    • getLocalPermissions

      public Set<String> getLocalPermissions()
      Getter for localPermissions
    • setLocalPermissions

      public void setLocalPermissions(Set<String> localPermissions)
      Setter for localPermissions
    • withLocalPermissions

      public QServicePrincipalMetaData withLocalPermissions(String... localPermissions)
      Fluent setter for localPermissions - session permission names (e.g. reports.hasAccess) for local deployments only.
    • getLocalSecurityKeyValues

      public Map<String,List<Serializable>> getLocalSecurityKeyValues()
      Getter for localSecurityKeyValues
    • setLocalSecurityKeyValues

      public void setLocalSecurityKeyValues(Map<String,List<Serializable>> localSecurityKeyValues)
      Setter for localSecurityKeyValues
    • withLocalSecurityKeyValue

      public QServicePrincipalMetaData withLocalSecurityKeyValue(String keyName, Serializable value)
      Fluent setter for one local security key value (local deployments only).