-
Notifications
You must be signed in to change notification settings - Fork 557
Add the ability to inject authenticators. #2311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,12 @@ export class KubeConfig implements SecurityAuthentication { | |
new OpenIDConnectAuth(), | ||
]; | ||
|
||
// Optionally add additional external authenticators, you must do this | ||
// before you load a kubeconfig file that references them. | ||
public static addAuthenticator(authenticator: Authenticator): void { | ||
this.authenticators.push(authenticator); | ||
|
||
} | ||
|
||
/** | ||
* The list of all known clusters | ||
*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it is worth adding a test that intentionally does not do this (if for no other reason than knowing if it accidentally changes)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this can ever change, because the kubeconfig file references the authenticator as part of the YAML file, so if we don't know about the authenticator because it hasn't been registered when we load the kubeconfig, there's no way that we can link the authenticator requested in the file to the kubeconfig.
So while we could add a test, I'm not sure it would ever break.