Skip to content
This repository has been archived by the owner on Jul 28, 2021. It is now read-only.

Bug fix: Avoid setting KeySet with an empty JWKS URL #53

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

k3a
Copy link

@k3a k3a commented Feb 27, 2020

Attempt to always use the JWKS URL from the discovery if available.

This should prevent the following error due to empty JWKS URL:
"Failed to retrieve public keys", "url":"","error":"Get : unsupported protocol scheme """

That error means JWKS URL in the KeySet object was an empty string.

It could easily happen if discovery endpoint failed during add/update of OidcConfig CRD. Even if there was a valid KeySet with a valid JWKS URL before, discovery endpoint failure during add/update would overwrite this valid KeySet with a new KeySet containing an empty string for JWKS URL.

Note that add/update operation also happens on adapter startup or after Kubernetes API starts being available after a temporary downtime so this bad overwrite can happen any time discovery endpoint is unable to respond at the time add/update handler for OidcConfig is called.

Attempt to always use the JWKS URL from the discovery if available
This should prevent the following error due to empty JWKS URL:
"Failed to retrieve public keys", "url":"","error":"Get : unsupported protocol scheme \"\""
Copy link
Contributor

@devstein devstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a maintainer but LGTM. Thanks for adding logging

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants