Class URLEvaluatingMessageChannelSecurity
- All Implemented Interfaces:
Component
,DestructableComponent
,InitializableComponent
,MessageHandler
MessageChannelSecurityContext
based on evaluating a
target URL resolved via a configured strategy function.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
Flag controlling whether traffic on the default TLS port is "secure".private org.slf4j.Logger
Logger.private String
The target resolved URL.private URLBuilder
Target resolved and parsed URL.private Function<MessageContext,
String> Function which looks up the URL to evaluate. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
doInvoke
(MessageContext messageContext) Performs the handler logic.protected boolean
doPreInvoke
(MessageContext messageContext) Called prior to execution, handlers may override this method to perform pre-processing for a request.void
setDefaultPortInsecure
(boolean flag) Set whether traffic on the default TLS port is "secure" for the purposes of this action.void
setURLLookup
(Function<MessageContext, String> function) Set the function which looks up the destination URL to evaluate.Methods inherited from class org.opensaml.messaging.handler.impl.AbstractMessageChannelSecurity
getParentContext, setParentContextLookupStrategy
Methods inherited from class org.opensaml.messaging.handler.AbstractMessageHandler
doPostInvoke, doPostInvoke, getActivationCondition, getLogPrefix, invoke, setActivationCondition
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
log
@Nonnull private org.slf4j.Logger logLogger. -
defaultPortInsecure
private boolean defaultPortInsecureFlag controlling whether traffic on the default TLS port is "secure". -
urlLookup
Function which looks up the URL to evaluate. -
url
The target resolved URL. -
urlBuilder
Target resolved and parsed URL.
-
-
Constructor Details
-
URLEvaluatingMessageChannelSecurity
public URLEvaluatingMessageChannelSecurity()Constructor.
-
-
Method Details
-
setDefaultPortInsecure
public void setDefaultPortInsecure(boolean flag) Set whether traffic on the default TLS port is "secure" for the purposes of this action.Defaults to "true"
Ordinarily TLS is considered a "secure" channel, but traffic to a default port meant for browser access tends to rely on server certificates that are unsuited to secure messaging use cases. This flag allows software layers to recognize traffic on this port as "insecure" and needing additional security measures.
- Parameters:
flag
- flag to set
-
setURLLookup
Set the function which looks up the destination URL to evaluate.- Parameters:
function
- the lookup function
-
doInitialize
- Overrides:
doInitialize
in classAbstractInitializableComponent
- Throws:
ComponentInitializationException
-
doPreInvoke
protected boolean doPreInvoke(@Nonnull MessageContext messageContext) throws MessageHandlerException Called prior to execution, handlers may override this method to perform pre-processing for a request.The default impl applies the
Predicate
set via theAbstractMessageHandler.setActivationCondition(Predicate)
.If false is returned, execution will not proceed.
Subclasses which override this method should generally invoke the super version of this method first, so that the activation condition will be applied up front, and immediately return false if the super version returns false. This avoids unnecessary execution of the remaining pre-invocation code if the handler ultimately will not execute.
- Overrides:
doPreInvoke
in classAbstractMessageChannelSecurity
- Parameters:
messageContext
- the message context on which to invoke the handler- Returns:
- true iff execution should proceed
- Throws:
MessageHandlerException
- if there is a problem executing the handler pre-routine
-
doInvoke
Performs the handler logic.- Specified by:
doInvoke
in classAbstractMessageHandler
- Parameters:
messageContext
- the message context on which to invoke the handler
-