Package net.officefloor.web.jwt.jwks
Class JwksSectionSource
- java.lang.Object
-
- net.officefloor.compile.spi.section.source.impl.AbstractSectionSource
-
- net.officefloor.web.jwt.jwks.JwksSectionSource
-
- All Implemented Interfaces:
SectionSource
public class JwksSectionSource extends AbstractSectionSource
JWKS
SectionSource
.Provides logic to retrieve
JwtValidateKey
instances from a JWKS service (viaJwksRetriever
).- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.officefloor.compile.spi.section.source.impl.AbstractSectionSource
AbstractSectionSource.SpecificationContext
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
INPUT
Name ofSectionInput
to collect theJwtValidateKey
instances.
-
Constructor Summary
Constructors Constructor Description JwksSectionSource()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JwksKeyParser[]
loadJwksKeyParsers(SourceContext context)
Loads theJwksKeyParser
instances.protected void
loadSpecification(AbstractSectionSource.SpecificationContext context)
Loads theSectionSourceSpecification
.static java.security.Key
parseKey(java.lang.String serialisedKey, JwksKeyParser[] parsers)
Parses out theKey
.void
sourceSection(SectionDesigner designer, SectionSourceContext context)
Sources theOfficeSection
by constructing it via the inputSectionDesigner
.-
Methods inherited from class net.officefloor.compile.spi.section.source.impl.AbstractSectionSource
getSpecification
-
-
-
-
Field Detail
-
INPUT
public static final java.lang.String INPUT
Name ofSectionInput
to collect theJwtValidateKey
instances.- See Also:
- Constant Field Values
-
-
Method Detail
-
loadJwksKeyParsers
public static JwksKeyParser[] loadJwksKeyParsers(SourceContext context)
Loads theJwksKeyParser
instances.- Parameters:
context
-SourceContext
.- Returns:
JwksKeyParser
instances.
-
parseKey
public static java.security.Key parseKey(java.lang.String serialisedKey, JwksKeyParser[] parsers)
Parses out theKey
.- Parameters:
serialisedKey
- SerialisedKey
in JWKS format.parsers
-JwksKeyParser
instances.- Returns:
Key
ornull
if unable to parse out theKey
.
-
loadSpecification
protected void loadSpecification(AbstractSectionSource.SpecificationContext context)
Description copied from class:AbstractSectionSource
Loads theSectionSourceSpecification
.- Specified by:
loadSpecification
in classAbstractSectionSource
- Parameters:
context
-AbstractSectionSource.SpecificationContext
.
-
sourceSection
public void sourceSection(SectionDesigner designer, SectionSourceContext context) throws java.lang.Exception
Description copied from interface:SectionSource
Sources theOfficeSection
by constructing it via the inputSectionDesigner
.- Parameters:
designer
-SectionDesigner
to construct the structure of theOfficeSection
.context
-SectionSourceContext
to source details to construct theOfficeSection
.- Throws:
java.lang.Exception
- If fails to construct theOfficeSection
.
-
-