Package org.codice.ddf.admin.core.impl
Class GuestClaimsHandlerExt
java.lang.Object
org.codice.ddf.admin.core.impl.GuestClaimsHandlerExt
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGuestClaimsHandlerExt(org.codice.ddf.platform.util.properties.PropertiesFileReader propertiesFileReader, List<String> immutableClaims, String availableClaimsFile, String profilesFilePath) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGet a map of both the available and immutable claims.Get a map of the claims profiles data.Returns a list of maps representing misc configs that should be sent toConfigurationAdminImplwhen initializing the selected security profile, ornullif no profile has been selected.Returns a map of guest claims that should be applied to all anonymous users, ornullif no profile has been selected.Returns a map of system claims that should be written to users.attributes upon installation, ornullif no profile has been selected.voidinit()Called by the container to initialize the object.voidsetSelectedClaimsProfileName(String selectedClaimsProfileName) Submit the name of the profile listed in each configuration to select that configuration for use.
-
Field Details
-
PID_KEY
- See Also:
-
PROPERTIES_KEY
- See Also:
-
AVAILABLE_PROFILES
- See Also:
-
PROFILE_NAMES
- See Also:
-
AVAILABLE_CLAIMS
- See Also:
-
IMMUTABLE_CLAIMS
- See Also:
-
DEFAULT_NAME
- See Also:
-
-
Constructor Details
-
Method Details
-
init
public void init()Called by the container to initialize the object. -
setSelectedClaimsProfileName
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
Returns a map of guest claims that should be applied to all anonymous users, ornullif no profile has been selected.- Returns:
- a map of claims for all guests.
-
getProfileSystemClaims
Returns a map of system claims that should be written to users.attributes upon installation, ornullif no profile has been selected.- Returns:
- a map of claims for the system user only.
- See Also:
-
getProfileConfigs
Returns a list of maps representing misc configs that should be sent toConfigurationAdminImplwhen initializing the selected security profile, ornullif 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
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
Get a map of both the available and immutable claims.- Returns:
- a map with a list of available claims and immutable claims.
-