public class EncryptNameIDs extends AbstractEncryptAction
NameIDs in a message obtained from a lookup strategy,
by default the outbound message context.
Specific formats may be excluded from encryption, by default excluding the "entity" format.
| Modifier and Type | Field and Description |
|---|---|
private java.util.Set<java.lang.String> |
excludedFormats
Formats to exclude from encryption.
|
private org.slf4j.Logger |
log
Class logger.
|
private SAMLObject |
message
The message to operate on.
|
private com.google.common.base.Function<ProfileRequestContext,SAMLObject> |
messageLookupStrategy
Strategy used to locate the message to operate on.
|
| Constructor and Description |
|---|
EncryptNameIDs()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doExecute(ProfileRequestContext profileRequestContext)
Performs this action.
|
protected boolean |
doPreExecute(ProfileRequestContext profileRequestContext)
Called prior to execution, actions may override this method to perform pre-processing for a request.
|
protected EncryptionParameters |
getApplicableParameters(EncryptionContext ctx)
Return the right set of parameters for the operation to be performed, or none if no encryption should occur.
|
private void |
processAssertion(Assertion assertion)
Decrypt any
EncryptedID found in an assertion and replace it with the result. |
private void |
processLogoutRequest(LogoutRequest request)
Encrypt a
NameID found in a LogoutRequest and replace it with the result. |
private void |
processManageNameIDRequest(ManageNameIDRequest request)
Encrypt a
NameID found in a ManageNameIDRequest and replace it with the result. |
private void |
processNameIDMappingRequest(NameIDMappingRequest request)
Encrypt a
NameID found in a NameIDMappingRequest and replace it with the result. |
private void |
processNameIDMappingResponse(NameIDMappingResponse response)
Encrypt a
NameID found in a NameIDMappingResponse and replace it with the result. |
private void |
processSubject(Subject subject)
Encrypt any
NameIDs found in a subject and replace them with the result. |
void |
setExcludedFormats(java.util.Collection<java.lang.String> formats)
Set the
NameID formats to ignore and leave unencrypted. |
void |
setMessageLookupStrategy(com.google.common.base.Function<ProfileRequestContext,SAMLObject> strategy)
Set the strategy used to locate the
Response to operate on. |
private boolean |
shouldEncrypt(NameID name)
Return true iff the NameID should be encrypted.
|
getEncrypter, setEncryptionContextLookupStrategy, setKeyPlacementLookupStrategy, setRecipientLookupStrategygetActivationCondition, setActivationConditiondoPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponsedestroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized@Nonnull private final org.slf4j.Logger log
@Nonnull private com.google.common.base.Function<ProfileRequestContext,SAMLObject> messageLookupStrategy
@Nonnull @NonnullElements private java.util.Set<java.lang.String> excludedFormats
@Nullable private SAMLObject message
public void setMessageLookupStrategy(@Nonnull
com.google.common.base.Function<ProfileRequestContext,SAMLObject> strategy)
Response to operate on.strategy - strategy used to locate the Response to operate onpublic void setExcludedFormats(@Nonnull @NonnullElements
java.util.Collection<java.lang.String> formats)
NameID formats to ignore and leave unencrypted.formats - formats to exclude@Nullable protected EncryptionParameters getApplicableParameters(@Nullable EncryptionContext ctx)
getApplicableParameters in class AbstractEncryptActionctx - possibly null input context to pull parameters fromprotected boolean doPreExecute(@Nonnull
ProfileRequestContext profileRequestContext)
If false is returned, execution will not proceed, and the action should attach an
EventContext to the context tree to signal how to continue with overall
workflow processing.
If returning successfully, the last step should be to return the result of the superclass version of this method.
doPreExecute in class AbstractEncryptActionprofileRequestContext - the current IdP profile request contextprotected void doExecute(@Nonnull
ProfileRequestContext profileRequestContext)
doExecute in class AbstractProfileActionprofileRequestContext - the current IdP profile request contextprivate boolean shouldEncrypt(@Nullable
NameID name)
name - NameID to checkprivate void processSubject(@Nullable
Subject subject)
throws EncryptionException
NameIDs found in a subject and replace them with the result.subject - subject to operate onEncryptionException - if an error occursprivate void processLogoutRequest(@Nonnull
LogoutRequest request)
throws EncryptionException
NameID found in a LogoutRequest and replace it with the result.request - request to operate onEncryptionException - if an error occursprivate void processManageNameIDRequest(@Nonnull
ManageNameIDRequest request)
throws EncryptionException
NameID found in a ManageNameIDRequest and replace it with the result.request - request to operate onEncryptionException - if an error occursprivate void processNameIDMappingRequest(@Nonnull
NameIDMappingRequest request)
throws EncryptionException
NameID found in a NameIDMappingRequest and replace it with the result.request - request to operate onEncryptionException - if an error occursprivate void processNameIDMappingResponse(@Nonnull
NameIDMappingResponse response)
throws EncryptionException
NameID found in a NameIDMappingResponse and replace it with the result.response - response to operate onEncryptionException - if an error occursprivate void processAssertion(@Nonnull
Assertion assertion)
throws EncryptionException
EncryptedID found in an assertion and replace it with the result.assertion - assertion to operate onEncryptionException - if an error occurs