java.lang.Object
net.shibboleth.idp.plugin.oidc.op.profile.ScopeUtil

public final class ScopeUtil extends Object
Static helper methods for handling Scope objects, especially with IdP attributes.
Since:
3.2.0
  • Field Details

    • log

      private static org.slf4j.Logger log
      Class logger.
  • Constructor Details

    • ScopeUtil

      private ScopeUtil()
      Private constructor.
  • Method Details

    • buildAttribute

      @Nonnull public static IdPAttribute buildAttribute(@Nonnull String attributeId, @Nullable Scope scope)
      Builds an IdPAttribute with given identifier and contents taken from the given scope.
      Parameters:
      attributeId - The attribute ID to use
      scope - The contents for the attribute
      Returns:
      The built attribute
    • setAttributeValues

      public static void setAttributeValues(@Nonnull IdPAttribute attribute, @Nullable Scope scope)
      Sets the contents for IdPAttribute from the given scope.
      Parameters:
      attribute - The attribute whose contents are set
      scope - The contents for the attribute
    • populateScriptedAttribute

      public static void populateScriptedAttribute(@Nonnull ScriptedIdPAttribute attribute, @Nullable Scope scope)
      Adds values from the given scope to the ScriptedIdPAttribute.
      Parameters:
      attribute - The attribute whose contents are fulfilled
      scope - The contents to fulfill for the attribute
    • populateScriptedAttribute

      public static void populateScriptedAttribute(@Nonnull ScriptedIdPAttribute attribute, @Nullable ScriptedIdPAttribute source) throws ResolutionException
      Adds values from the given ScriptedIdPAttribute to another ScriptedIdPAttribute.
      Parameters:
      attribute - The attribute whose contents are fulfilled
      source - The contents to fulfill for the attribute
      Throws:
      ResolutionException - If the soure attribute contents cannot be accessed
    • buildScope

      @Nonnull public static Scope buildScope(@Nullable IdPAttribute attribute)
      Builds Scope from the given attribute contents. Only the StringAttributeValues are recognized.
      Parameters:
      attribute - The attribute whose contents are used for the scope
      Returns:
      The built scope
    • buildScope

      @Nonnull public static Scope buildScope(@Nullable ScriptedIdPAttribute attribute) throws ResolutionException
      Builds Scope from the given ScriptedIdPAttribute. The contents are assumed to be String.
      Parameters:
      attribute - The attribute whose contents are used for the scope
      Returns:
      The built scope
      Throws:
      ResolutionException - If the attribute values cannot be accessed
    • buildIntersectedScope

      @Nonnull public static Scope buildIntersectedScope(@Nullable IdPAttribute attribute, @Nullable Scope scope)
      Builds intersected Scope from the given IdPAttribute and Scope.
      Parameters:
      attribute - The attribute whose contents are processed
      scope - The existing scope whose contents are processed
      Returns:
      The intersection of the two contents
    • buildIntersectedScope

      @Nonnull public static Scope buildIntersectedScope(@Nullable ScriptedIdPAttribute attribute, @Nullable Scope scope) throws ResolutionException
      Builds intersected Scope from the given ScriptedIdPAttribute and Scope.
      Parameters:
      attribute - The attribute whose contents are processed
      scope - The existing scope whose contents are processed
      Returns:
      The intersection of the two contents
      Throws:
      ResolutionException - If th attribute values cannot be accessed
    • removeValue

      public static void removeValue(@Nonnull Scope scope, @Nonnull String value)
      Removes a single value from the given Scope.
      Parameters:
      scope - The scope to modify
      value - The value to be removed if it exists