Class AbstractJsonJOSEObjectReader<A,B extends JsonJOSEObject<A>,C extends AbstractJsonJOSEObjectReader<A,B,C>>
- Type Parameters:
A- the payload typeB- the JSON JOSE object typeC- the JSON JOSE object reader type
- All Implemented Interfaces:
JsonJOSEObjectReader<A,B, C>
- Direct Known Subclasses:
GenericJsonJWEReader,GenericJsonJWSReader
Base JSON JOSE object reader.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe set of custom parameters processed by the application.protected final io.inverno.mod.security.jose.internal.converter.DataConversionServiceThe data conversion service.protected final JWKServiceThe JWK service.protected final com.fasterxml.jackson.databind.ObjectMapperThe object mapper.protected final TypeThe payload type. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractJsonJOSEObjectReader(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. -
Method Summary
Modifier and TypeMethodDescriptiongetPayloadDecoder(Function<String, reactor.core.publisher.Mono<A>> overridingPayloadDecoder, String overridingContentType, String cty) Returns the payload decoder to use to deserialize the payload.processedParameters(String... parameters) Specifies the JOSE header custom parameters processed by the application.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.inverno.mod.security.jose.JsonJOSEObjectReader
read, read, read
-
Field Details
-
mapper
protected final com.fasterxml.jackson.databind.ObjectMapper mapperThe object mapper. -
dataConversionService
protected final io.inverno.mod.security.jose.internal.converter.DataConversionService dataConversionServiceThe data conversion service. -
jwkService
The JWK service. -
type
The payload type. -
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 mapperdataConversionService- a data conversion servicejwkService- a JWK servicetype- the expected payload type
-
-
Method Details
-
processedParameters
Description copied from interface:JsonJOSEObjectReaderSpecifies 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:
processedParametersin interfaceJsonJOSEObjectReader<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, JOSEProcessingExceptionReturns 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 decoderoverridingContentType- the overriding payload media typecty- the payload content type specified in the parsed JOSE headers- Returns:
- a payload decoder
- Throws:
JOSEObjectReadException- if no payload encoder could have been resolvedJOSEProcessingException- if there was a JOSE processing error
-