authentication

package
v1.31.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotImplemented          = errors.New("not implemented")
	ErrAlreadyExists           = errors.New("already exists")
	ErrInsufficientPermissions = errors.New("insufficient permissions")
	ErrUnexpectedStatusCode    = errors.New("unexpected status code")
	ErrInvalidRequest          = errors.New("invalid request")
	ErrSessionExpired          = errors.New("session expired")
	ErrInvalidTokenFormat      = errors.New("invalid token format")
)

Functions

This section is empty.

Types

type APIService

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

func NewAPIService

func NewAPIService(apiEndpoint string, validateIDTokenClaims map[string]string, logger logging.Logger, externalPrincipalsEnabled bool) (*APIService, error)

func NewAPIServiceWithClients

func NewAPIServiceWithClients(apiClient apiclient.ClientWithResponsesInterface, logger logging.Logger, validateIDTokenClaims map[string]string, externalPrincipalsEnabled bool) (*APIService, error)

func (*APIService) ExternalPrincipalLogin added in v1.18.0

func (s *APIService) ExternalPrincipalLogin(ctx context.Context, identityRequest map[string]interface{}) (*apiclient.ExternalPrincipal, error)

func (*APIService) IsExternalPrincipalsEnabled added in v1.18.0

func (s *APIService) IsExternalPrincipalsEnabled() bool

func (*APIService) ValidateSTS

func (s *APIService) ValidateSTS(ctx context.Context, code, redirectURI, state string) (string, error)

ValidateSTS calls the external authentication service to validate the STS parameters validates the required claims and returns the external user id and expiration time

type DummyService

type DummyService struct{}

func NewDummyService

func NewDummyService() *DummyService

func (DummyService) ExternalPrincipalLogin added in v1.18.0

func (d DummyService) ExternalPrincipalLogin(_ context.Context, _ map[string]interface{}) (*apiclient.ExternalPrincipal, error)

func (DummyService) IsExternalPrincipalsEnabled added in v1.18.0

func (d DummyService) IsExternalPrincipalsEnabled() bool

func (DummyService) ValidateSTS

func (d DummyService) ValidateSTS(ctx context.Context, code, redirectURI, state string) (string, error)

type Service

type Service interface {
	IsExternalPrincipalsEnabled() bool
	ExternalPrincipalLogin(ctx context.Context, identityRequest map[string]interface{}) (*apiclient.ExternalPrincipal, error)
	// ValidateSTS validates the STS parameters and returns the external user ID
	ValidateSTS(ctx context.Context, code, redirectURI, state string) (string, error)
}

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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