Documentation ¶
Overview ¶
Package sessions provides session authentication to the SecretHub API for the HTTP client.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session interface { NeedsRefresh() bool Authenticator() auth.Authenticator }
Session provides a auth.Authenticator than can be temporarily used to temporarily authenticate to the SecretHub API.
type SessionCreator ¶
SessionCreator can create a new SecretHub session with a http.Client.
func NewAWSSessionCreator ¶
func NewAWSSessionCreator(awsCfg ...*aws.Config) SessionCreator
NewAWSSessionCreator returns a SessionCreator that uses AWS STS authentication to request sessions.
func NewGCPSessionCreator ¶
func NewGCPSessionCreator(gcpOptions ...option.ClientOption) SessionCreator
NewAWSSessionCreator returns a SessionCreator that uses a GCP Service Account Identity Token to request sessions.
type SessionRefresher ¶
type SessionRefresher struct {
// contains filtered or unexported fields
}
SessionRefresher implements auth.Authenticator by using sessions for authentication that are automatically refreshed when they are about to expire.
func NewSessionRefresher ¶
func NewSessionRefresher(httpClient *httpclient.Client, sessionCreator SessionCreator) *SessionRefresher
NewSessionRefresher creates a new SessionRefresher that uses the httpClient for requesting new sessions with the SessionCreator.
func (*SessionRefresher) Authenticate ¶
func (r *SessionRefresher) Authenticate(req *http.Request) error
Authenticate the given request with a session that is automatically refreshed when in almost expires.