NIFI-16137 - Support externally-supplied client assertion in JWTBearerOAuth2AccessTokenProvider - #11463
NIFI-16137 - Support externally-supplied client assertion in JWTBearerOAuth2AccessTokenProvider#11463pvillard31 wants to merge 1 commit into
Conversation
…rOAuth2AccessTokenProvider
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks @pvillard31, this looks like a straightforward improvement. I noted a few minor implementation details, then this should be ready to go.
|
|
||
| @Override | ||
| public String getValue() { | ||
| return displayName; |
There was a problem hiding this comment.
This should be changed to name()
| return description; | ||
| } | ||
|
|
||
| public static Optional<AssertionStrategy> fromValue(final String value) { |
There was a problem hiding this comment.
Is this method necessary?
| Determines how the RFC 7523 JWT assertion presented to the Token Endpoint is produced: either | ||
| built and signed locally using a Private Key Service, or supplied by an external | ||
| OAuth2AccessTokenProvider whose token is used directly as the assertion. | ||
| """) |
There was a problem hiding this comment.
The description should be shortened to avoid duplicating the descriptions of each value
| JWSAlgorithm.Ed25519.getName()) | ||
| .defaultValue(JWSAlgorithm.PS256.getName()) | ||
| .required(true) | ||
| .dependsOn(ASSERTION_STRATEGY, AssertionStrategy.SELF_SIGNED.getValue()) |
There was a problem hiding this comment.
It should be possible to remove getValue() from this and other references in dependOn
| final AssertionStrategy strategy = AssertionStrategy.fromValue(validationContext.getProperty(ASSERTION_STRATEGY).getValue()) | ||
| .orElse(AssertionStrategy.SELF_SIGNED); |
There was a problem hiding this comment.
This should use asAllowableValue()
| final AssertionStrategy strategy = AssertionStrategy.fromValue(context.getProperty(ASSERTION_STRATEGY).getValue()) | ||
| .orElse(AssertionStrategy.SELF_SIGNED); |
There was a problem hiding this comment.
This should use asAllowableValue() instead of the fromValue helper
Summary
NIFI-16137 - Support externally-supplied client assertion in JWTBearerOAuth2AccessTokenProvider
The idea is to support a scenario like:
I tested the changes locally and can provide some screenshot if helpful.
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000VerifiedstatusPull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
./mvnw clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation