public class OA2ClientConfigurationUtil extends ClientConfigurationUtil
{"config":"comment", "claims":{ "runtime":[...], "sources:[{"alias":"A","className":"B"},...], "sourcesConfig":[{config1,...}], "preProcessing":[], "postProcessing":[] } }*Where a0,a1,... is one of
runtime = directives to run before any processing. E.g. A condition to determine if claims are to be gotten.The sourcesConfig-urations are a list of configurations for the claim sources. This allows for multiple configurations to be used (e,g. depending on the IDP, specific LDAP claim sources will be invoked.)
Created by Jeff Gaynor
on 4/12/18 at 8:16 AM
Modifier and Type | Class and Description |
---|---|
static class |
OA2ClientConfigurationUtil.SourceEntry |
Modifier and Type | Field and Description |
---|---|
static String |
CLAIM_SOURCE_ALIAS_KEY |
static String |
CLAIM_SOURCE_CLASSNAME_KEY
Note that this cannot be the reserved word "class" since the JSON library will attempt to
resolve it to a class and do squirrelly things with it if it finds one.
|
static String |
CLAIM_SOURCE_CONFIG_KEY |
static String |
CLAIM_SOURCES_KEY |
static String |
CLAIMS_KEY |
static String |
CONFIG_KEY |
CLAIM_POST_PROCESSING_KEY, CLAIM_PRE_PROCESSING_KEY, COMMENT_KEY, EXTRA_ATTRIBUTES_KEY, RUNTIME_KEY, SAVED_KEY
Constructor and Description |
---|
OA2ClientConfigurationUtil() |
Modifier and Type | Method and Description |
---|---|
static net.sf.json.JSONObject |
convertToNewConfiguration(net.sf.json.JSONObject oldLDAP,
net.sf.json.JSONObject config)
This will take the old LDAP object and convert it to the new configuration format.
|
protected static void |
createDefaultPreProcessor(net.sf.json.JSONObject config,
String newName) |
static net.sf.json.JSONArray |
getClaimSourceConfigurations(net.sf.json.JSONObject config) |
static net.sf.json.JSONArray |
getClaimSources(net.sf.json.JSONObject config) |
static net.sf.json.JSONObject |
getClaimsPostProcessing(net.sf.json.JSONObject config) |
static net.sf.json.JSONObject |
getClaimsPreProcessing(net.sf.json.JSONObject config) |
protected static net.sf.json.JSONObject |
getClaimsProcessor(net.sf.json.JSONObject config,
String key) |
protected static net.sf.json.JSONArray |
getClaimsThingy(net.sf.json.JSONObject config,
String key) |
static boolean |
hasClaimPostProcessor(net.sf.json.JSONObject config) |
static boolean |
hasClaimPreProcessor(net.sf.json.JSONObject config) |
static boolean |
hasClaimSourceConfigurations(net.sf.json.JSONObject config) |
static boolean |
hasClaimSources(net.sf.json.JSONObject config) |
protected static boolean |
hasClaimsThingy(String key,
net.sf.json.JSONObject config) |
static void |
setClaimSources(net.sf.json.JSONObject config,
net.sf.json.JSONArray claimsSources) |
static void |
setClaimSourcesConfigurations(net.sf.json.JSONObject config,
net.sf.json.JSONArray sourceConfigs) |
static void |
setClaimsPostProcessing(net.sf.json.JSONObject config,
net.sf.json.JSONObject processing) |
static void |
setClaimsPreProcessing(net.sf.json.JSONObject config,
net.sf.json.JSONObject processing) |
protected static void |
setClaimsThingy(net.sf.json.JSONObject config,
String key,
net.sf.json.JSON thingy) |
static Map<String,OA2ClientConfigurationUtil.SourceEntry> |
toSourcesMap(net.sf.json.JSONArray array)
Method to pull the sources from the array of {"alias":A,"className":B} objects
|
static Map<String,OA2ClientConfigurationUtil.SourceEntry> |
toSourcesMap(net.sf.json.JSONObject json)
Convenience method to pull the sources from a the whole configuration
|
getComment, getExtraAttributes, getProcessor, getRuntime, getRuntimeArg, getThingies, getThingy, hasRuntime, hasThingy, isSaved, setComment, setComment, setExtraAttributes, setRuntime, setSaved, setThingy
public static final String CONFIG_KEY
public static final String CLAIMS_KEY
public static final String CLAIM_SOURCES_KEY
public static final String CLAIM_SOURCE_CONFIG_KEY
public static final String CLAIM_SOURCE_CLASSNAME_KEY
public static final String CLAIM_SOURCE_ALIAS_KEY
public static Map<String,OA2ClientConfigurationUtil.SourceEntry> toSourcesMap(net.sf.json.JSONObject json)
json
- public static Map<String,OA2ClientConfigurationUtil.SourceEntry> toSourcesMap(net.sf.json.JSONArray array)
array
- public static net.sf.json.JSONArray getClaimSources(net.sf.json.JSONObject config)
public static void setClaimSources(net.sf.json.JSONObject config, net.sf.json.JSONArray claimsSources)
protected static net.sf.json.JSONArray getClaimsThingy(net.sf.json.JSONObject config, String key)
protected static net.sf.json.JSONObject getClaimsProcessor(net.sf.json.JSONObject config, String key)
protected static void setClaimsThingy(net.sf.json.JSONObject config, String key, net.sf.json.JSON thingy)
public static boolean hasClaimPreProcessor(net.sf.json.JSONObject config)
public static boolean hasClaimPostProcessor(net.sf.json.JSONObject config)
public static boolean hasClaimSources(net.sf.json.JSONObject config)
public static boolean hasClaimSourceConfigurations(net.sf.json.JSONObject config)
protected static boolean hasClaimsThingy(String key, net.sf.json.JSONObject config)
public static net.sf.json.JSONArray getClaimSourceConfigurations(net.sf.json.JSONObject config)
public static void setClaimSourcesConfigurations(net.sf.json.JSONObject config, net.sf.json.JSONArray sourceConfigs)
public static net.sf.json.JSONObject getClaimsPostProcessing(net.sf.json.JSONObject config)
public static void setClaimsPostProcessing(net.sf.json.JSONObject config, net.sf.json.JSONObject processing)
public static net.sf.json.JSONObject getClaimsPreProcessing(net.sf.json.JSONObject config)
public static void setClaimsPreProcessing(net.sf.json.JSONObject config, net.sf.json.JSONObject processing)
public static net.sf.json.JSONObject convertToNewConfiguration(net.sf.json.JSONObject oldLDAP, net.sf.json.JSONObject config)
oldLDAP
- the raw JSON of the old LDAP configuration in the store. Delete this from the store when done!config
- the new configuration objectprotected static void createDefaultPreProcessor(net.sf.json.JSONObject config, String newName)
Copyright © 2019. All Rights Reserved.