Class GuestClaimsHandlerExt

java.lang.Object
org.codice.ddf.admin.core.impl.GuestClaimsHandlerExt

public class GuestClaimsHandlerExt extends Object
GuestClaimsHandlerExt is an extension for the AdminConsoleServiceMBean that adds capabilities to read/handle claim and profiles for the guest claims handler. The state in the class mirrors the loaded files exactly, and the data is transformed as it leaves the class to whatever format is expected.

The governing data structure lives in ~/etc/ws-security/profiles.json where the outter-most map represents the profile, and each profile must have inner-maps guestClaims, systemClaims, and configs. Each have a respective destination: guest claims are sent to the guest claims handler using the appropriate configuration, system claims are written to ~/etc/users.attributes, and configs allow arbitrary configuration info to be submitted to ConfigurationAdmin.

An example use case for the configs entity: setting UI banners based upon the selected profile.

  • Field Details

  • Constructor Details

    • GuestClaimsHandlerExt

      public GuestClaimsHandlerExt(org.codice.ddf.platform.util.properties.PropertiesFileReader propertiesFileReader, List<String> immutableClaims, String availableClaimsFile, String profilesFilePath)
      Constructor.
  • Method Details

    • init

      public void init()
      Called by the container to initialize the object.
    • setSelectedClaimsProfileName

      public void setSelectedClaimsProfileName(String selectedClaimsProfileName)
      Submit the name of the profile listed in each configuration to select that configuration for use. Applies retroactively for system-high and banner markings.
      Parameters:
      selectedClaimsProfileName - the name of the profile to be used.
    • getProfileGuestClaims

      @Nullable public Map<String,Object> getProfileGuestClaims()
      Returns a map of guest claims that should be applied to all anonymous users, or null if no profile has been selected.
      Returns:
      a map of claims for all guests.
    • getProfileSystemClaims

      @Nullable public Map<String,Object> getProfileSystemClaims()
      Returns a map of system claims that should be written to users.attributes upon installation, or null if no profile has been selected.
      Returns:
      a map of claims for the system user only.
      See Also:
    • getProfileConfigs

      @Nullable public List<Map<String,Object>> getProfileConfigs()
      Returns a list of maps representing misc configs that should be sent to ConfigurationAdminImpl when initializing the selected security profile, or null if no profile has been selected.
      Returns:
      a list of maps with string field "pid" and value field "properties", which are the actual configuration properties to be submitted to the config with the corresponding pid.
    • getClaimsProfiles

      public Map<String,Object> getClaimsProfiles()
      Get a map of the claims profiles data. The resulting claims are flattened.
      Returns:
      a map with a list of profile names and the actual profile information.
      See Also:
      • flatCopyProfileData(Map)
    • getClaims

      public Map<String,Object> getClaims()
      Get a map of both the available and immutable claims.
      Returns:
      a map with a list of available claims and immutable claims.