Description of changes:
Ability to read and parse PEM/PKCS8 public key for the node version only (not compatible with webapp)
modify node-web-compat to add a bufferFetcher. Add the implementation for this bufferFetcher only for the node version.
add the SimpleBufferFetcher that use the bufferFetcher above.
add the AwsAlbJwksFetcher using the SimpleBufferFetcher in order to transform the PEM into a JWKS.
add the AwsAlbJwksCache using the AwsAlbJwksFetcher. Only methods getJwk and getCachedJwk are implemented because, to retrieve the public key forn the ALB, the URI has the kid in the URI: https://public-keys.auth.elb.eu-west-1.amazonaws.com/{kid}. It means that we can only load the public key and put it in the cache after receiving the JWT token to validate. A really simple mechanism of expend is implemented that consist only to replace the variable {kid} by the kid of the JWT token (leven simplier than level1 of the RFC https://www.rfc-editor.org/rfc/rfc6570).
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Issue https://github.com/awslabs/aws-jwt-verify/issues/109
Description of changes: Ability to read and parse PEM/PKCS8 public key for the node version only (not compatible with webapp)
getJwk
andgetCachedJwk
are implemented because, to retrieve the public key forn the ALB, the URI has the kid in the URI:https://public-keys.auth.elb.eu-west-1.amazonaws.com/{kid}
. It means that we can only load the public key and put it in the cache after receiving the JWT token to validate. A really simple mechanism of expend is implemented that consist only to replace the variable {kid} by the kid of the JWT token (leven simplier than level1 of the RFC https://www.rfc-editor.org/rfc/rfc6570).By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.