authentication

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IBMInstanceIDHeader is the header used to indicate an IBM Cloud Monitoring instance to target.
	IBMInstanceIDHeader = "IBMInstanceID"
	// SysdigTeamIDHeader is the header used to indicate a Sysdig Team to target. May not be required anymore?
	SysdigTeamIDHeader = "TeamID"
	// AuthorizationHeader is the standard Authorization header used to authorize to the Sysdig API.
	AuthorizationHeader = "Authorization"
)

Variables

This section is empty.

Functions

func AuthorizationHeaderFor

func AuthorizationHeaderFor(token string) string

AuthorizationHeaderFor returns a formatted Authorization header as a Bearer token.

Types

type Authenticator

type Authenticator interface {
	Authenticate(req *http.Request) error
}

Authenticator defines an interface for authenticating a request to the Sysdig API. Implementers should add required headers or authorization fields to the request.

type AuthenticatorFunc

type AuthenticatorFunc func(req *http.Request) error

AuthenticatorFunc defines a function that will authenticate the given Request.

func (AuthenticatorFunc) Authenticate

func (f AuthenticatorFunc) Authenticate(req *http.Request) error

Authenticate implements Authenticator using the AuthenticatorFunc.

type Refreshable

type Refreshable interface {
	Refresh() error
}

Refreshable defines an optional interface for Authenticators that can be Refreshed. Authentication failures will trigger a Refresh and a retry when implemented.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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