Package net.shibboleth.idp.plugin.authn.webauthn.context.navigate

# Class RegistrationErrorMessageLookupFunction

java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
net.shibboleth.idp.plugin.authn.webauthn.context.navigate.RegistrationErrorMessageLookupFunction

All Implemented Interfaces:
  `Function<ProfileRequestContext,String>`, `ContextDataLookupFunction<ProfileRequestContext,String>`, `Aware`, `ApplicationContextAware`

public class RegistrationErrorMessageLookupFunction extends ApplicationObjectSupport implements ContextDataLookupFunction<ProfileRequestContext,String>
A function that examines the state of a request and produces an appropriate message for WebAuthn flow views.

NOTE: The result of this function is NOT HTML-encoded in any way and must be encoded for safety if used.

## Field Summary

Fields
Modifier and Type
Field
Description
`private String`
`genericMessageID`
Message ID to use for generic messages.
`private Function<ProfileRequestContext,WebAuthnRegistrationErrorContext>`
`webauthnErrorContextLookupStrategy`
Lookup strategy to locate the WebAuthn registration information context.

### Fields inherited from class org.springframework.context.support.ApplicationObjectSupport

`logger`

## Constructor Summary

Constructors
Constructor
Description
`RegistrationErrorMessageLookupFunction()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`String`
`apply(ProfileRequestContext input)`
`private String`
`getClassifiedMessage(MessageSourceAccessor messageSource, String classifiedMessage)`
Get classified message.
`void`
`setGenericMessageID(String id)`
Sets whether non-message-based error messages should be exposed or turned into a more generic value.
`void`
`setWebauthnErrorContextLookupStrategy(Function<ProfileRequestContext,WebAuthnRegistrationErrorContext> strategy)`
Set the strategy used to lookup the `WebAuthnRegistrationErrorContext`.

### Methods inherited from class org.springframework.context.support.ApplicationObjectSupport

`getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext`

### 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.Function

`andThen, compose`

## Field Details

### genericMessageID

private String genericMessageID
Message ID to use for generic messages.

### webauthnErrorContextLookupStrategy

@Nonnull private Function<ProfileRequestContext,WebAuthnRegistrationErrorContext> webauthnErrorContextLookupStrategy
Lookup strategy to locate the WebAuthn registration information context.

## Constructor Details

### RegistrationErrorMessageLookupFunction

public RegistrationErrorMessageLookupFunction()
Constructor.

## Method Details

### setWebauthnErrorContextLookupStrategy

public void setWebauthnErrorContextLookupStrategy(Function<ProfileRequestContext,WebAuthnRegistrationErrorContext> strategy)
Set the strategy used to lookup the `WebAuthnRegistrationErrorContext`.

Parameters:
  `strategy` - The strategy to set.

### setGenericMessageID

public void setGenericMessageID(@Nullable String id)
Sets whether non-message-based error messages should be exposed or turned into a more generic value.

Parameters:
  `id` - message ID

### apply

public String apply(@Nullable ProfileRequestContext input)

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

### getClassifiedMessage

@Nullable private String getClassifiedMessage(@Nonnull MessageSourceAccessor messageSource, @Nonnull String classifiedMessage)
Get classified message.

Parameters:
  `messageSource` - Spring message source
  `classifiedMessage` - classified message
Returns:
  mapped message, or null if an empty string was produced.