Documentation
¶
Overview ¶
Package oidc provides utilities for working with OIDC ID tokens.
This package is experimental and subject to change.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IDToken ¶
type IDToken struct {
Value string
}
IDToken represents an OIDC ID token that can be exchanged for a Databricks access token.
type IDTokenSource ¶
IDTokenSource is anything that returns an IDToken given an audience.
func NewEnvIDTokenSource ¶
func NewEnvIDTokenSource(env string) IDTokenSource
NewEnvIDTokenSource returns an IDTokenSource that reads the IDtoken from environment variable env.
Note that the IDTokenSource does not cache the token and will read the token from environment variable env each time.
func NewFileTokenSource ¶
func NewFileTokenSource(path string) IDTokenSource
NewFileTokenSource returns an IDTokenSource that reads the ID token from a file. The file should contain a single line with the token.
type IDTokenSourceFn ¶
IDTokenSourceFn is an adapter to allow the use of ordinary functions as IDTokenSource.
Example:
ts := IDTokenSourceFn(func(ctx context.Context, aud string) (*IDToken, error) {
return &IDToken{}, nil
})