Documentation
¶
Index ¶
- Variables
- type APIService
- func (s *APIService) ExternalPrincipalLogin(ctx context.Context, identityRequest map[string]interface{}) (*apiclient.ExternalPrincipal, error)
- func (s *APIService) IsExternalPrincipalsEnabled() bool
- func (s *APIService) OauthCallback(w http.ResponseWriter, r *http.Request, _ sessions.Store)
- func (s *APIService) RegisterAdditionalRoutes(_ *chi.Mux, _ sessions.Store)
- func (s *APIService) ValidateSTS(ctx context.Context, code, redirectURI, state string) (string, error)
- type DummyService
- func (d DummyService) ExternalPrincipalLogin(_ context.Context, _ map[string]interface{}) (*apiclient.ExternalPrincipal, error)
- func (d DummyService) IsExternalPrincipalsEnabled() bool
- func (d DummyService) OauthCallback(_ http.ResponseWriter, _ *http.Request, _ sessions.Store)
- func (d DummyService) RegisterAdditionalRoutes(_ *chi.Mux, _ sessions.Store)
- func (d DummyService) ValidateSTS(ctx context.Context, code, redirectURI, state string) (string, error)
- type LoginTokenProvider
- type Service
- type TokenRedirect
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") ErrExternalLoginFailed = errors.New("external principal login failed") )
Functions ¶
This section is empty.
Types ¶
type APIService ¶
type APIService struct {
// contains filtered or unexported fields
}
func NewAPIService ¶
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) OauthCallback ¶ added in v1.57.0
func (s *APIService) OauthCallback(w http.ResponseWriter, r *http.Request, _ sessions.Store)
func (*APIService) RegisterAdditionalRoutes ¶ added in v1.57.0
func (s *APIService) RegisterAdditionalRoutes(_ *chi.Mux, _ sessions.Store)
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) OauthCallback ¶ added in v1.57.0
func (d DummyService) OauthCallback(_ http.ResponseWriter, _ *http.Request, _ sessions.Store)
func (DummyService) RegisterAdditionalRoutes ¶ added in v1.57.0
func (d DummyService) RegisterAdditionalRoutes(_ *chi.Mux, _ sessions.Store)
func (DummyService) ValidateSTS ¶
type LoginTokenProvider ¶ added in v1.73.0
type LoginTokenProvider interface {
// GetRedirect is called to start logging in via an authenticated user. It is called
// unauthenticated, initiated by the requesting client, with no user on the context.
GetRedirect(ctx context.Context) (*TokenRedirect, error)
// Release drops token into mailbox, releasing it for the next GetToken call. It is
// called authenticated, initiated by the web browser running.
Release(ctx context.Context, loginRequestToken string) error
// GetToken returns a token waiting on mailbox. It is called unauthenticated, initiated
// the requesting client, with no user on the context.
GetToken(ctx context.Context, mailbox string) (string, time.Time, 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)
RegisterAdditionalRoutes(r *chi.Mux, sessionStore sessions.Store)
OauthCallback(w http.ResponseWriter, r *http.Request, sessionStore sessions.Store)
}
type TokenRedirect ¶ added in v1.73.0
Directories
¶
| Path | Synopsis |
|---|---|
|
externalidp
|
|
|
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.