Package net.shibboleth.idp.authn.proxy.impl

# Class DiscoveryProfileRequestFunction

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.authn.proxy.impl.DiscoveryProfileRequestFunction

All Implemented Interfaces:
  `BiFunction<RequestContext,ProfileRequestContext,String>`, `Component`, `DestructableComponent`, `InitializableComponent`

@ThreadSafe public class DiscoveryProfileRequestFunction extends AbstractInitializableComponent implements BiFunction<RequestContext,ProfileRequestContext,String>
A `Function` that produces a discovery request URL using the protocol defined in https://wiki.oasis-open.org/security/IdpDiscoSvcProtonProfile .

## Field Summary

Fields
Modifier and Type
Field
Description
`private BiFunction<RequestContext,ProfileRequestContext,String>`
`delegatedRequestFunction`
Overrides this function via an injected bean.
`private Function<ProfileRequestContext,String>`
`discoveryURLLookupStrategy`
Lookup strategy for determining the "base" discovery URL.
`private Function<ProfileRequestContext,String>`
`entityIDLookupStrategy`
A strategy function to call to obtain the entityID to use when invoking the DS.
`private Escaper`
`escaper`
URL query parameter escaper.

## Constructor Summary

Constructors
Constructor
Description
`DiscoveryProfileRequestFunction()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`String`
`apply(RequestContext springRequestContext, ProfileRequestContext profileRequestContext)`
`protected void`
`doInitialize()`
`void`
`setDelegatedRequestFunction(BiFunction<RequestContext,ProfileRequestContext,String> delegate)`
Set a function to call in place of this built-in class to generate the request.
`void`
`setDiscoveryURLLookupStrategy(Function<ProfileRequestContext,String> strategy)`
Set the lookup strategy for the "base" discovery service URL to use.
`void`
`setEntityIDLookupStrategy(Function<ProfileRequestContext,String> strategy)`
Set a lookup strategy for the entityID to use when invoking the DS.

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, 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 java.util.function.BiFunction

`andThen`

## Field Details

### escaper

@Nonnull private Escaper escaper
URL query parameter escaper.

### discoveryURLLookupStrategy

@NonnullAfterInit private Function<ProfileRequestContext,String> discoveryURLLookupStrategy
Lookup strategy for determining the "base" discovery URL.

### delegatedRequestFunction

@Nullable private BiFunction<RequestContext,ProfileRequestContext,String> delegatedRequestFunction
Overrides this function via an injected bean.

### entityIDLookupStrategy

@NonnullAfterInit private Function<ProfileRequestContext,String> entityIDLookupStrategy
A strategy function to call to obtain the entityID to use when invoking the DS.

## Constructor Details

### DiscoveryProfileRequestFunction

public DiscoveryProfileRequestFunction()
Constructor.

## Method Details

### setDiscoveryURLLookupStrategy

public void setDiscoveryURLLookupStrategy(@Nonnull Function<ProfileRequestContext,String> strategy)
Set the lookup strategy for the "base" discovery service URL to use.

Parameters:
  `strategy` - lookup strategy

### setDelegatedRequestFunction

public void setDelegatedRequestFunction(@Nullable BiFunction<RequestContext,ProfileRequestContext,String> delegate)
Set a function to call in place of this built-in class to generate the request.

This is a mechanism to account for how this function gets used in the discovery flow.

Parameters:
  `delegate` - the function to delegate to
Since:
  5.0.0

### setEntityIDLookupStrategy

public void setEntityIDLookupStrategy(@Nullable Function<ProfileRequestContext,String> strategy)
Set a lookup strategy for the entityID to use when invoking the DS.

In the absence of an alternative source, the default is to obtain the entityID from the "downstream-facing" profile/RP configurations, which may not result in the correct value.

Parameters:
  `strategy` - lookup strategy
Since:
  5.1.0

### doInitialize

protected void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractInitializableComponent`
Throws:
  `ComponentInitializationException`

### apply

@Nullable public String apply(@Nullable RequestContext springRequestContext, @Nullable ProfileRequestContext profileRequestContext)

Specified by:
  `apply` in interface `BiFunction<RequestContext,ProfileRequestContext,String>`