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 booleanFlag controlling whether traffic on the default TLS port is "secure".private org.slf4j.LoggerLogger.private StringThe target resolved URL.private URLBuilderTarget resolved and parsed URL.private Function<MessageContext,String> Function which looks up the URL to evaluate. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voiddoInvoke(MessageContext messageContext) Performs the handler logic.protected booleandoPreInvoke(MessageContext messageContext) Called prior to execution, handlers may override this method to perform pre-processing for a request.voidsetDefaultPortInsecure(boolean flag) Set whether traffic on the default TLS port is "secure" for the purposes of this action.voidsetURLLookup(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
ensureParentContext, getParentContext, setParentContextLookupStrategyMethods inherited from class org.opensaml.messaging.handler.AbstractMessageHandler
doPostInvoke, doPostInvoke, getActivationCondition, getLogPrefix, invoke, isPreInvokeCalled, setActivationConditionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.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:
doInitializein 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
Predicateset 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:
doPreInvokein 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:
doInvokein classAbstractMessageHandler- Parameters:
messageContext- the message context on which to invoke the handler
-