Interface TokenRequestMarshaller

  • All Known Implementing Classes:
    TokenRequestMarshallerImpl

    public interface TokenRequestMarshaller
    Defines an interface encapsulating the concerns of taking the json posted at the rest-sts, and marshalling it into the constructs necessary to implement rest-sts operations, currently limited to token transformation.
    • Method Detail

      • buildTokenTransformValidatorParameters

        RestTokenTransformValidatorParameters<?> buildTokenTransformValidatorParameters​(org.forgerock.json.JsonValue token,
                                                                                        org.forgerock.services.context.Context context)
                                                                                 throws TokenMarshalException
        Marshals state from a token translate invocation into the RestTokenTransformValidatorParameters necessary to validate this token.
        Parameters:
        token - the json representation of a token
        context - The Context, which is necessary to obtain the client's x509 cert presented via two-way-tls for token transformations with x509 certs as input token types.
        Returns:
        a RestTokenTransformValidatorParameters instance for a particular token type
        Throws:
        TokenMarshalException - if the json string cannot be marshaled into a recognized token.
      • buildIssuedTokenValidatorParameters

        RestIssuedTokenValidatorParameters<?> buildIssuedTokenValidatorParameters​(org.forgerock.json.JsonValue token)
                                                                           throws TokenMarshalException
        Marshals state from a token validate invocation into the RestIssuedTokenValidatorParameters necessary to validate this token
        Parameters:
        token - the token specified in the validate request
        Returns:
        the RestIssuedTokenValidatorParameters instance which will be passed to the RestIssuedTokenValidator for token validation
        Throws:
        TokenMarshalException - if the json does not contain state sufficient to create a RestIssuedtokenValidatorParameters instance
      • buildIssuedTokenCancellerParameters

        RestIssuedTokenCancellerParameters<?> buildIssuedTokenCancellerParameters​(org.forgerock.json.JsonValue token)
                                                                           throws TokenMarshalException
        Marshals state from a token cancel invocation into the RestIssuedTokenCancellerParameters necessary to cancel this token
        Parameters:
        token - the token specified in the cancel request
        Returns:
        the RestIssuedTokenCancellerParameters instance which will be passed to the RestIssuedTokenCanceller for token canceller
        Throws:
        TokenMarshalException - if the json does not contain state sufficient to create a RestIssuedtokenCancellerParameters instance
      • buildTokenProviderParameters

        RestTokenProviderParameters<?> buildTokenProviderParameters​(TokenTypeId inputTokenType,
                                                                    org.forgerock.json.JsonValue inputToken,
                                                                    TokenTypeId desiredTokenType,
                                                                    org.forgerock.json.JsonValue desiredTokenState)
                                                             throws TokenMarshalException
        Marshals state from a token translate invocation into the RestTokenProviderParameters necessary to create a token of the specified type
        Parameters:
        inputTokenType - the type of input token
        inputToken - the json specifying the input token
        desiredTokenType - the type of the output token
        desiredTokenState - the json state corresponding this output token type
        Returns:
        the RestTokenProviderParameters necessary to create a token of the specified type.
        Throws:
        TokenMarshalException - if the json does not contain state sufficient to create a RestTokenProviderParameters instance
      • getTokenType

        TokenTypeId getTokenType​(org.forgerock.json.JsonValue token)
                          throws TokenMarshalException
        Returns the TokenType corresponding to the JsonValue. The JsonValue will be pulled from the RestSTSTokenTranslationInvocationState.
        Parameters:
        token - The token definition
        Returns:
        The TokenType represented by the json string.
        Throws:
        TokenMarshalException - if the TOKEN_TYPE_KEY is missing or unrecognized.