[OpenShift] Enable cert verification for self-signed certs and auto-load auth api URL #363
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The latest version of OpenShift OAuthenticator relies on user configuring
OPENSHIFT_URL
environment variable and then uses it for multiple kind of unrelated things, so it is not clear itOPENSHIFT_URL
should be an API url, or OAuth API url.Also, the default value
localhost:8443
would not work in OpenShift environment since in a container, localhost will not really do much.This change sets more sensible default for
openshift_url
which actually represents internal URL for OpenShift API.Next it automatically gathers the OpenShift OAuth URL, so that the user does not have to provide it externally via env vars.
Lastly it sets the OpenShift provided CA certs in a container by default, so that we don't have to turn off the verification on clusters using self-signed certs.
I had to use
requests
library to fetch the URLs for the OAuth issuer since the Async client did not work for me (event loop in an event loop error) - let me know if there is a better solution.