auth

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthError

func NewAuthError(err error) error

Types

type APIToken

type APIToken struct {
	Token string
}

type CSPAPIToken

type CSPAPIToken struct {
	Token   string
	BaseURL string
}

type CSPClientCredentials

type CSPClientCredentials struct {
	ClientID     string
	ClientSecret string
	BaseURL      string
	OrgID        *string
}

type CSPService

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

func (*CSPService) Authorize

func (s *CSPService) Authorize(r *http.Request) error

func (*CSPService) Close

func (s *CSPService) Close()

func (*CSPService) IsDirect

func (s *CSPService) IsDirect() bool

func (*CSPService) RefreshAccessToken

func (s *CSPService) RefreshAccessToken()

type Err

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

func (*Err) Error

func (e *Err) Error() string

type NoOpService

type NoOpService struct {
}

func (NoOpService) Authorize

func (t NoOpService) Authorize(*http.Request) error

func (NoOpService) Close

func (t NoOpService) Close()

func (NoOpService) IsDirect

func (t NoOpService) IsDirect() bool

type Service

type Service interface {
	Authorize(r *http.Request) error
	Close()
	IsDirect() bool
}

Service Interface for getting authentication tokens (Wavefront, CSP)

func NewCSPServerToServerService

func NewCSPServerToServerService(
	CSPBaseURL string,
	ClientID string,
	ClientSecret string,
	OrgID *string,
) Service

NewCSPServerToServerService returns a Service instance that gets access tokens via CSP client credentials

func NewCSPTokenService

func NewCSPTokenService(CSPBaseURL, apiToken string) Service

func NewNoopTokenService

func NewNoopTokenService() Service

NewNoopTokenService returns a Service instance where it always returns an empty string for the token (for proxy usage).

func NewWavefrontTokenService

func NewWavefrontTokenService(Token string) Service

NewWavefrontTokenService returns a Service instance where it always returns a Wavefront API Token

type WavefrontTokenService

type WavefrontTokenService struct {
	Token string
}

func (WavefrontTokenService) Authorize

func (t WavefrontTokenService) Authorize(req *http.Request) error

func (WavefrontTokenService) Close

func (t WavefrontTokenService) Close()

func (WavefrontTokenService) IsDirect

func (t WavefrontTokenService) IsDirect() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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