Class OutputConfig

All Implemented Interfaces:
Component, DestructableComponent, InitializableComponent, ProfileAction, Aware, MessageSource, MessageSourceAware, Action

public class OutputConfig extends AbstractProfileAction
Action that outputs the settings from the effective ProfileConfiguration and so on.

On success, a 200 HTTP status is returned. On failure, a non-successful HTTP status is returned.

Since:
5.0.0
Event:
EventIds.PROCEED_EVENT_ID, EventIds.INVALID_PROFILE_CTX, IdPEventIds.INVALID_RELYING_PARTY_CTX, IdPEventIds.INVALID_RELYING_PARTY_CONFIG, IdPEventIds.INVALID_PROFILE_CONFIG, EventIds.IO_ERROR
  • Field Details

  • Constructor Details

    • OutputConfig

      public OutputConfig()
      Constructor.
  • Method Details

    • setAllowedOrigin

      public void setAllowedOrigin(@Nullable String origin)
      Set the value of the Access-Control-Allow-Origin CORS header, if any.
      Parameters:
      origin - header value
    • setJSONPCallbackName

      public void setJSONPCallbackName(@Nullable String callbackName)
      Set a JSONP callback function to wrap the result in, if any.
      Parameters:
      callbackName - callback function name.
    • setRelyingPartyContextLookupStrategy

      public void setRelyingPartyContextLookupStrategy(@Nonnull Function<ProfileRequestContext,RelyingPartyContext> strategy)
      Set the lookup strategy to locate the RelyingPartyContext.
      Parameters:
      strategy - lookup strategy
    • doPreExecute

      protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)
      Overrides:
      doPreExecute in class AbstractConditionalProfileAction
    • doExecute

      protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)
      Overrides:
      doExecute in class AbstractProfileAction
    • getConfig

      @Nonnull @NullableElements private Map<String,Object> getConfig(@Nonnull ProfileRequestContext profileRequestContext)
      Extract configuration settings into a map to output.
      Parameters:
      profileRequestContext - profile request context
      Returns:
      configuration settings map
    • getSettings

      @Nonnull @NullableElements @Unmodifiable @NotLive private Map<String,Object> getSettings(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull Object target)
      Interrogate a target object for configuration settings, extract them, and return in a map.
      Parameters:
      profileRequestContext - profile request context
      target - target object
      Returns:
      map of settings
    • addSetting

      private void addSetting(@Nonnull Map<String,Object> settings, @Nonnull String name, @Nonnull Object obj)
      Process a setting by adding it to the map if it's suitable for output.
      Parameters:
      settings - map of settings to be serialized to caller by Jackson
      name - name of setting
      obj - native/original value of setting
    • isPrimitive

      private boolean isPrimitive(@Nullable Object o)
      Check an object for whether it's a boxed primitive type or one of the time wrappers.
      Parameters:
      o - object to test
      Returns:
      true iff the type of the object is one of the boxed primitive types