Class Definition

java.lang.Object
swiss.trustbroker.federation.xmlconfig.Definition
All Implemented Interfaces:
Serializable, swiss.trustbroker.api.sessioncache.dto.AttributeName

public class Definition extends Object implements Serializable, swiss.trustbroker.api.sessioncache.dto.AttributeName
Attribute definition. For custom attributes see AttributeInitializer.
See Also:
  • Constructor Details

    • Definition

      public Definition(String name)
    • Definition

      public Definition(String name, String namespaceUri)
    • Definition

      public Definition(swiss.trustbroker.api.sessioncache.dto.AttributeName attributeName)
    • Definition

      public Definition(String name, String namespaceUri, String singleValue)
    • Definition

      public Definition()
    • Definition

      public Definition(String name, String namespaceUri, String source, String altName, String oidcNames, Boolean cid, Multivalued multiValued, String mappers, ClaimsMapper oidcMapper, String provision, Boolean provisioningId, String value, String scope, Boolean required)
      Deprecated.
      use mappers
      Creates a new Definition instance.
      Parameters:
      name - Short name used in auditing and for IDM attribute addressing. Compound primary key member in attribute maps using Definition(De)Serializer.
      namespaceUri - The long name is used in the generated SAML assertion towards the RP. Compound primary key member in attribute maps using Definition(De)Serializer.
      source - Source of the definition Compound primary key member in attribute maps using Definition(De)Serializer.
      altName - Known external attributes we just document here - used when we cannot use namespaceUri due to semantics.
      oidcNames - The claim names used when emitting an attribute to an OIDC client (comma-separated - as an attribute, it cannot be a List).
      cid - Indicates whether this field is considered CID (client identifying data).
      Default: null - global default is used
      multiValued - Multi value handling.
      Default: ORIGINAL
      mappers - Comma-separated list of mappers to be used for the value.
      oidcMapper - Mapper to be used for the value.
      provision - Provision this attribute to IDM.
      The value or list of comma-separated values indicate into what type(s) of IDM object provisioning services should provision this data.
      The actual fields to provision would usually be selected based on name/namespace URI.
      Generic values: true (a provisioning service selects an appropriate target), false (not provisioned - single value only).
      Default: false
      provisioningId - ID attribute for provisioning.
      value - Single value from constant configuration (we currently only use single valued in XML via ConstAttributes).
      scope - To restrict emitting an attribute, the scope can be set as follows:
      • saml: Use only in SAML assertions
      • oidc: Use only in OIDC tokens (oidcName must be set)
      If not set, the attribute is emitted on all protocols and any requested OIDC scope.
      required - Indicates whether this attribute is mandatory.
      For an AuthnResponse, this attribute must always be included
      Since:
      1.8.0, 1.9.0, 1.9.0, 1.9.0, 1.14.0
      See Also:
      • oidcNamesToList(String)
      • oidcNameListToString(List)
      • IdmProvisioningService
      • IdmProvisioningService
  • Method Details

    • ofName

      public static Definition ofName(String name)
    • ofName

      public static Definition ofName(swiss.trustbroker.api.sessioncache.dto.AttributeName name)
    • ofNameAndSource

      public static Definition ofNameAndSource(String name, String source)
    • ofNameAndSource

      public static Definition ofNameAndSource(swiss.trustbroker.api.sessioncache.dto.AttributeName name, String source)
    • ofNames

      public static Definition ofNames(String name, String namespaceUri)
    • ofNames

      public static Definition ofNames(swiss.trustbroker.api.sessioncache.dto.AttributeName name)
    • ofNamesAndSource

      public static Definition ofNamesAndSource(String name, String namespaceUri, String source)
    • ofNamesAndSource

      public static Definition ofNamesAndSource(swiss.trustbroker.api.sessioncache.dto.AttributeName name, String source)
    • withSource

      public Definition withSource(String newSource)
    • getOidcNameList

      public List<String> getOidcNameList()
      Specified by:
      getOidcNameList in interface swiss.trustbroker.api.sessioncache.dto.AttributeName
    • getClaimsMappers

      public List<ClaimsMapper> getClaimsMappers()
    • getMultiValues

      public List<String> getMultiValues()
    • findAttributeName

      public swiss.trustbroker.api.sessioncache.dto.AttributeName findAttributeName()
    • equalsByNameOrNamespace

      public boolean equalsByNameOrNamespace(swiss.trustbroker.api.sessioncache.dto.AttributeName attributeName, String source)
      Specified by:
      equalsByNameOrNamespace in interface swiss.trustbroker.api.sessioncache.dto.AttributeName
    • isProvisioningAttribute

      public boolean isProvisioningAttribute()
    • isProvisioningIdAttribute

      public boolean isProvisioningIdAttribute()
    • getOidcClaimNames

      public String[] getOidcClaimNames()
    • builder

      public static Definition.DefinitionBuilder builder()
    • toBuilder

      public Definition.DefinitionBuilder toBuilder()
    • getName

      public String getName()
      Short name used in auditing and for IDM attribute addressing. Compound primary key member in attribute maps using Definition(De)Serializer.
      Specified by:
      getName in interface swiss.trustbroker.api.sessioncache.dto.AttributeName
    • getNamespaceUri

      public String getNamespaceUri()
      The long name is used in the generated SAML assertion towards the RP. Compound primary key member in attribute maps using Definition(De)Serializer.
      Specified by:
      getNamespaceUri in interface swiss.trustbroker.api.sessioncache.dto.AttributeName
    • getSource

      public String getSource()
      Source of the definition Compound primary key member in attribute maps using Definition(De)Serializer.
      Specified by:
      getSource in interface swiss.trustbroker.api.sessioncache.dto.AttributeName
    • getAltName

      public String getAltName()
      Known external attributes we just document here - used when we cannot use namespaceUri due to semantics.
      Specified by:
      getAltName in interface swiss.trustbroker.api.sessioncache.dto.AttributeName
    • getOidcNames

      public String getOidcNames()
      The claim names used when emitting an attribute to an OIDC client (comma-separated - as an attribute, it cannot be a List).
      See Also:
      • oidcNamesToList(String)
      • oidcNameListToString(List)
    • getCid

      public Boolean getCid()
      Indicates whether this field is considered CID (client identifying data).
      Default: null - global default is used
      Specified by:
      getCid in interface swiss.trustbroker.api.sessioncache.dto.AttributeName
      Since:
      1.8.0
    • getMultiValued

      public Multivalued getMultiValued()
      Multi value handling.
      Default: ORIGINAL
    • getMappers

      public String getMappers()
      Comma-separated list of mappers to be used for the value.
      Since:
      1.9.0
    • getOidcMapper

      @Deprecated public ClaimsMapper getOidcMapper()
      Deprecated.
      use mappers
      Mapper to be used for the value.
    • getProvision

      public String getProvision()
      Provision this attribute to IDM.
      The value or list of comma-separated values indicate into what type(s) of IDM object provisioning services should provision this data.
      The actual fields to provision would usually be selected based on name/namespace URI.
      Generic values: true (a provisioning service selects an appropriate target), false (not provisioned - single value only).
      Default: false
      Specified by:
      getProvision in interface swiss.trustbroker.api.sessioncache.dto.AttributeName
      Since:
      1.9.0
      See Also:
      • IdmProvisioningService
    • getProvisioningId

      public Boolean getProvisioningId()
      ID attribute for provisioning.
      Since:
      1.9.0
      See Also:
      • IdmProvisioningService
    • getValue

      public String getValue()
      Single value from constant configuration (we currently only use single valued in XML via ConstAttributes).
    • getScope

      public String getScope()
      To restrict emitting an attribute, the scope can be set as follows:
      • saml: Use only in SAML assertions
      • oidc: Use only in OIDC tokens (oidcName must be set)
      If not set, the attribute is emitted on all protocols and any requested OIDC scope.
    • getRequired

      public Boolean getRequired()
      Indicates whether this attribute is mandatory.
      For an AuthnResponse, this attribute must always be included
      Since:
      1.14.0
    • setName

      public void setName(String name)
      Short name used in auditing and for IDM attribute addressing. Compound primary key member in attribute maps using Definition(De)Serializer.
    • setNamespaceUri

      public void setNamespaceUri(String namespaceUri)
      The long name is used in the generated SAML assertion towards the RP. Compound primary key member in attribute maps using Definition(De)Serializer.
    • setSource

      public void setSource(String source)
      Source of the definition Compound primary key member in attribute maps using Definition(De)Serializer.
    • setAltName

      public void setAltName(String altName)
      Known external attributes we just document here - used when we cannot use namespaceUri due to semantics.
    • setOidcNames

      public void setOidcNames(String oidcNames)
      The claim names used when emitting an attribute to an OIDC client (comma-separated - as an attribute, it cannot be a List).
      See Also:
      • oidcNamesToList(String)
      • oidcNameListToString(List)
    • setCid

      public void setCid(Boolean cid)
      Indicates whether this field is considered CID (client identifying data).
      Default: null - global default is used
      Since:
      1.8.0
    • setMultiValued

      public void setMultiValued(Multivalued multiValued)
      Multi value handling.
      Default: ORIGINAL
    • setMappers

      public void setMappers(String mappers)
      Comma-separated list of mappers to be used for the value.
      Since:
      1.9.0
    • setOidcMapper

      @Deprecated public void setOidcMapper(ClaimsMapper oidcMapper)
      Deprecated.
      use mappers
      Mapper to be used for the value.
    • setProvision

      public void setProvision(String provision)
      Provision this attribute to IDM.
      The value or list of comma-separated values indicate into what type(s) of IDM object provisioning services should provision this data.
      The actual fields to provision would usually be selected based on name/namespace URI.
      Generic values: true (a provisioning service selects an appropriate target), false (not provisioned - single value only).
      Default: false
      Since:
      1.9.0
      See Also:
      • IdmProvisioningService
    • setProvisioningId

      public void setProvisioningId(Boolean provisioningId)
      ID attribute for provisioning.
      Since:
      1.9.0
      See Also:
      • IdmProvisioningService
    • setValue

      public void setValue(String value)
      Single value from constant configuration (we currently only use single valued in XML via ConstAttributes).
    • setScope

      public void setScope(String scope)
      To restrict emitting an attribute, the scope can be set as follows:
      • saml: Use only in SAML assertions
      • oidc: Use only in OIDC tokens (oidcName must be set)
      If not set, the attribute is emitted on all protocols and any requested OIDC scope.
    • setRequired

      public void setRequired(Boolean required)
      Indicates whether this attribute is mandatory.
      For an AuthnResponse, this attribute must always be included
      Since:
      1.14.0
    • toString

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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object