Class AbstractJsonJOSEObjectReader<A,B extends JsonJOSEObject<A>,C extends AbstractJsonJOSEObjectReader<A,B,C>>

java.lang.Object
io.inverno.mod.security.jose.internal.AbstractJsonJOSEObjectReader<A,B,C>
Type Parameters:
A - the payload type
B - the JSON JOSE object type
C - the JSON JOSE object reader type
All Implemented Interfaces:
JsonJOSEObjectReader<A,B,C>
Direct Known Subclasses:
GenericJsonJWEReader, GenericJsonJWSReader

public abstract class AbstractJsonJOSEObjectReader<A,B extends JsonJOSEObject<A>,C extends AbstractJsonJOSEObjectReader<A,B,C>> extends Object implements JsonJOSEObjectReader<A,B,C>

Base JSON JOSE object reader.

Since:
1.5
Author:
Jeremy Kuhn
See Also:
  • Field Details

    • mapper

      protected final com.fasterxml.jackson.databind.ObjectMapper mapper
      The object mapper.
    • dataConversionService

      protected final io.inverno.mod.security.jose.internal.converter.DataConversionService dataConversionService
      The data conversion service.
    • jwkService

      protected final JWKService jwkService
      The JWK service.
    • type

      protected final Type type
      The payload type.
    • applicationProcessedParameters

      protected Set<String> applicationProcessedParameters
      The set of custom parameters processed by the application.
  • Constructor Details

    • AbstractJsonJOSEObjectReader

      public AbstractJsonJOSEObjectReader(com.fasterxml.jackson.databind.ObjectMapper mapper, io.inverno.mod.security.jose.internal.converter.DataConversionService dataConversionService, JWKService jwkService, Type type)

      Creates a JSON JOSE object reader.

      Parameters:
      mapper - an object mapper
      dataConversionService - a data conversion service
      jwkService - a JWK service
      type - the expected payload type
  • Method Details

    • processedParameters

      public C processedParameters(String... parameters)
      Description copied from interface: JsonJOSEObjectReader

      Specifies the JOSE header custom parameters processed by the application.

      These parameters are expected to be present in JOSE headers, they are not processed by the reader but by the application reading the JSON JOSE object. This enables the reader to check that the critical parameters set defined in the JOSE headers actually contains parameters that are understood and processed by either the reader or the application.

      Specified by:
      processedParameters in interface JsonJOSEObjectReader<A,B extends JsonJOSEObject<A>,C extends AbstractJsonJOSEObjectReader<A,B,C>>
      Parameters:
      parameters - a list of parameters
      Returns:
      this reader
    • getPayloadDecoder

      protected Function<String,reactor.core.publisher.Mono<A>> getPayloadDecoder(Function<String,reactor.core.publisher.Mono<A>> overridingPayloadDecoder, String overridingContentType, String cty) throws JOSEObjectReadException, JOSEProcessingException

      Returns the payload decoder to use to deserialize the payload.

      This method first considers the overriding payload decoder which is returned if present. Then the overriding content type is used if present to resolve the media type converter to use. Finally the payload content type specified in the parsed JOSE headers is considered to resolve the media type converter to use.

      Parameters:
      overridingPayloadDecoder - the overriding payload decoder
      overridingContentType - the overriding payload media type
      cty - the payload content type specified in the parsed JOSE headers
      Returns:
      a payload decoder
      Throws:
      JOSEObjectReadException - if no payload encoder could have been resolved
      JOSEProcessingException - if there was a JOSE processing error