Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthProvider ¶ added in v1.3.12
type AuthProvider func(ctx context.Context) (*AuthSnapshot, error)
AuthProvider returns a currently-valid authentication snapshot. It is called whenever the cached token goes stale, in place of the client-credentials exchange. Token and EnvironmentID must be resolved atomically from the same credential state. Implementations must not call back into the client that owns this Manager; they are invoked while its lock is held.
type AuthSnapshot ¶ added in v1.3.12
type AuthSnapshot struct {
Token *serverv1.GetTokenResponse
EnvironmentID string
}
AuthSnapshot is the bearer token and effective environment that must be sent together on an authenticated request.
type Inputs ¶ added in v1.2.94
type Inputs struct {
// Token is a pre-issued JWT to authenticate with, instead of exchanging client
// credentials
Token *serverv1.GetTokenResponse
// AuthProvider supplies a token and effective environment whenever the cached
// token goes stale, instead of running the client-credentials exchange.
// Sufficient on its own -- the first snapshot is obtained from it if Token is
// unset. See AuthProvider.
AuthProvider AuthProvider
// HttpClient is used as the underlying http.client. Connect provides an interface for abstracting over the
// standard library version of the auth client
HttpClient connect.HTTPClient
// Manager holds the credentials for this client to use. Non-optional.
Config *config.Manager
Timeout *time.Duration
// SkipEnvironmentNameMapping controls whether to skip validating and mapping
// environment names to IDs. If true, the EnvironmentId will be used verbatim.
SkipEnvironmentNameMapping bool
// SkipEngineMapping controls whether to skip setting the query server based
// on the token's engine maps. If true, the query server will not be
// automatically resolved from the token.
SkipEngineMapping bool
}
type Manager ¶ added in v1.2.94
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶ added in v1.2.94
Click to show internal directories.
Click to hide internal directories.