-
Notifications
You must be signed in to change notification settings - Fork 50
Add support for OIDC ID token authentication using an environment variable. #1215
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
Conversation
@@ -108,6 +108,9 @@ type Config struct { | |||
// specified by this argument. This argument also holds currently selected auth. | |||
AuthType string `name:"auth_type" env:"DATABRICKS_AUTH_TYPE" auth:"-"` | |||
|
|||
// Environment variable name that contains an OIDC ID token. | |||
OIDCTokenEnv string `name:"oidc_token_env" env:"DATABRICKS_OIDC_TOKEN_ENV" auth:"-"` |
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.
Does it make sense to read this dynamically from the environment to support "refreshes"?
Note that neither AWS, GCP or Azure seem to support the refresh.
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.
The actual environment variable referred to by this environment variable is read each time the IDTokenSource is called. I'm not sure it's worth also reading this one dynamically.
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.
True. I missread this as if DATABRICKS_OIDC_TOKEN_ENV
itself was the token.
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
What changes are proposed in this pull request?
This PR adds a new way to authenticate by reading OIDC ID tokens from environment variables. By default, the new credential strategy attempts to read the token from
DATABRICKS_OIDC_TOKEN
. This default value can be overwritten by settingDATABRICKS_OIDC_TOKEN_ENV
.The new authentication mode will be tested before Github OIDC. The rationale is that we consider setting up
DATABRICKS_OIDC_TOKEN
as a stronger signal of intent than enabling OIDC for the whole Github Action.This PR also moves
IDTokenSource
in its ownoidc
package within theexperimental/auth
package to clarify that these interfaces are still being validated.How is this tested?
Complete test coverage of the new source.