credentials

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2025 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AcquireCredentials

func AcquireCredentials(ctx context.Context, key string, forceRefresh bool) (string, error)

AcquireCredentials calls the credentials provider webhook to get the credentials for the given key. If force_refresh is true, the provider will ignore any cached credentials and fetch new ones. The credentials provider URI is read from the HASURA_CREDENTIALS_PROVIDER_URI environment variable. If the HASURA_CREDENTIALS_PROVIDER_BEARER_TOKEN environment variable is set, it will be used as a bearer token for the request.

Types

type CredentialClient

type CredentialClient struct {
	// contains filtered or unexported fields
}

CredentialClient is an HTTP client that can requests the credentials provider webhook to get the credentials.

func NewCredentialClient

func NewCredentialClient(httpClient *http.Client) (*CredentialClient, error)

NewCredentialClient creates a CredentialClient instance.

func (*CredentialClient) AcquireCredentials

func (cc *CredentialClient) AcquireCredentials(ctx context.Context, key string, forceRefresh bool) (string, error)

AcquireCredentials calls the credentials provider webhook to get the credentials for the given key.

type Payload added in v1.9.1

type Payload struct {
	Credentials string `json:"credentials"`
}

Payload is the credentials provider webhook response payload.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL