Package net.shibboleth.idp.attribute.resolver.dc.saml.util.impl

# Class AssertionValidationProcessor

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.attribute.resolver.dc.saml.util.impl.AssertionValidationProcessor

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `InitializableComponent`

public class AssertionValidationProcessor extends AbstractInitializableComponent
A helper component for validating the `Assertion` content of a `Response`.

## Field Summary

Fields
Modifier and Type
Field
Description
`private Function<AssertionValidationInput,ValidationContext>`
`assertionValidationContextBuilder`
Function that builds a `ValidationContext` instance based on a `AssertionValidationInput` instance.
`private Function<Pair<InOutOperationContext,Assertion>,SAML20AssertionValidator>`
`assertionValidatorLookup`
The SAML 2.0 Assertion validator lookup function, may be null.
`private org.slf4j.Logger`
`log`
Logger.

## Constructor Summary

Constructors
Constructor
Description
`AssertionValidationProcessor()`

## Method Summary

Modifier and Type
Method
Description
`protected ValidationContext`
`buildValidationContext(InOutOperationContext opContext, Assertion assertion)`
Build the Assertion ValidationContext.
`protected void`
`doInitialize()`
`Function<AssertionValidationInput,ValidationContext>`
`getAssertionValidationContextBuilder()`
Get the function that builds a `ValidationContext` instance based on a `AssertionValidationInput` instance.
`Function<Pair<InOutOperationContext,Assertion>,SAML20AssertionValidator>`
`getAssertionValidatorLookup()`
Get the Assertion validator lookup function.
`protected void`
`processAssertionValidationResult(ValidationContext validationContext, ValidationResult validationResult, Assertion assertion, InOutOperationContext opContext)`
Process the result of the assertion validation.
`void`
`setAssertionValidationContextBuilder(Function<AssertionValidationInput,ValidationContext> builder)`
Set the function that builds a `ValidationContext` instance based on a `AssertionValidationInput` instance.
`void`
`setAssertionValidator(SAML20AssertionValidator validator)`
Set the locally-configured Assertion validator.
`void`
`setAssertionValidatorLookup(Function<Pair<InOutOperationContext,Assertion>,SAML20AssertionValidator> function)`
Set the Assertion validator lookup function.
`void`
`validateAssertions(Response response, InOutOperationContext opContext)`
Validate the assertions in the specified Response

### 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`

## Field Details

### log

private org.slf4j.Logger log
Logger.

### assertionValidationContextBuilder

@NonnullAfterInit private Function<AssertionValidationInput,ValidationContext> assertionValidationContextBuilder
Function that builds a `ValidationContext` instance based on a `AssertionValidationInput` instance.

### assertionValidatorLookup

@NonnullAfterInit private Function<Pair<InOutOperationContext,Assertion>,SAML20AssertionValidator> assertionValidatorLookup
The SAML 2.0 Assertion validator lookup function, may be null.

## Constructor Details

### AssertionValidationProcessor

public AssertionValidationProcessor()

## Method Details

### getAssertionValidationContextBuilder

@NonnullAfterInit public Function<AssertionValidationInput,ValidationContext> getAssertionValidationContextBuilder()
Get the function that builds a `ValidationContext` instance based on a `AssertionValidationInput` instance.

Returns:
  the builder function

### setAssertionValidationContextBuilder

public void setAssertionValidationContextBuilder(@Nonnull Function<AssertionValidationInput,ValidationContext> builder)
Set the function that builds a `ValidationContext` instance based on a `AssertionValidationInput` instance.

Parameters:
  `builder` - the builder function

### setAssertionValidator

public void setAssertionValidator(@Nullable SAML20AssertionValidator validator)
Set the locally-configured Assertion validator.

Parameters:
  `validator` - the local Assertion validator, may be null

### getAssertionValidatorLookup

@NonnullAfterInit public Function<Pair<InOutOperationContext,Assertion>,SAML20AssertionValidator> getAssertionValidatorLookup()
Get the Assertion validator lookup function.

Returns:
  the lookup function

### setAssertionValidatorLookup

public void setAssertionValidatorLookup(@Nonnull Function<Pair<InOutOperationContext,Assertion>,SAML20AssertionValidator> function)
Set the Assertion validator lookup function.

Parameters:
  `function` - the Assertion validator lookup function

### doInitialize

protected void doInitialize() throws ComponentInitializationException

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

### validateAssertions

public void validateAssertions(@Nonnull Response response, @Nonnull InOutOperationContext opContext) throws ResolutionException
Validate the assertions in the specified Response

If an assertion fails validation, it will be removed from the response.

Parameters:
  `response` - the response being evaluated
  `opContext` - the SOAP client operation context
Throws:
  `ResolutionException` - if there was a fatal error determining assertion validity

### buildValidationContext

@Nonnull protected ValidationContext buildValidationContext(@Nonnull InOutOperationContext opContext, @Nonnull Assertion assertion) throws AssertionValidationException
Build the Assertion ValidationContext.

Parameters:
  `opContext` - the current operation context
  `assertion` - the assertion which is to be validated
Returns:
  the new Assertion validation context to use
Throws:
  `AssertionValidationException` - if no validation context instance could be built

### processAssertionValidationResult

protected void processAssertionValidationResult(@Nonnull ValidationContext validationContext, @Nonnull ValidationResult validationResult, @Nonnull Assertion assertion, @Nonnull InOutOperationContext opContext)
Process the result of the assertion validation.

Parameters:
  `validationContext` - the Assertion validation context
  `validationResult` - the Assertion validation result
  `assertion` - the assertion being evaluated produced
  `opContext` - the current profile request context