Class URLEvaluatingMessageChannelSecurity
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.messaging.handler.AbstractMessageHandler
-
- org.opensaml.messaging.handler.impl.AbstractMessageChannelSecurity
-
- org.opensaml.messaging.handler.impl.URLEvaluatingMessageChannelSecurity
-
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,MessageHandler
public class URLEvaluatingMessageChannelSecurity extends AbstractMessageChannelSecurity
Message handler which populates aMessageChannelSecurityContextbased on evaluating a target URL resolved via a configured strategy function.
-
-
Field Summary
Fields Modifier and Type Field Description private booleandefaultPortInsecureFlag controlling whether traffic on the default TLS port is "secure".private org.slf4j.LoggerlogLogger.private StringurlThe target resolved URL.private URLBuilderurlBuilderTarget resolved and parsed URL.private Function<MessageContext,String>urlLookupFunction which looks up the URL to evaluate.
-
Constructor Summary
Constructors Constructor Description URLEvaluatingMessageChannelSecurity()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoInitialize()protected voiddoInvoke(MessageContext messageContext)protected booleandoPreInvoke(MessageContext messageContext)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
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 Detail
-
log
@Nonnull private org.slf4j.Logger log
Logger.
-
defaultPortInsecure
private boolean defaultPortInsecure
Flag controlling whether traffic on the default TLS port is "secure".
-
urlLookup
@NonnullAfterInit private Function<MessageContext,String> urlLookup
Function which looks up the URL to evaluate.
-
url
@Nullable private String url
The target resolved URL.
-
urlBuilder
@Nullable private URLBuilder urlBuilder
Target resolved and parsed URL.
-
-
Method Detail
-
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
public void setURLLookup(@Nullable Function<MessageContext,String> function)Set the function which looks up the destination URL to evaluate.- Parameters:
function- the lookup function
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doPreInvoke
protected boolean doPreInvoke(@Nonnull MessageContext messageContext) throws MessageHandlerException- Overrides:
doPreInvokein classAbstractMessageChannelSecurity- Throws:
MessageHandlerException
-
doInvoke
protected void doInvoke(@Nonnull MessageContext messageContext)- Specified by:
doInvokein classAbstractMessageHandler
-
-