login

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StrIsEmpty added in v0.6.0

func StrIsEmpty(str string) bool

Types

type AAPOAuth added in v0.6.0

type AAPOAuth struct {
	Metadata           api.ObjectMeta
	Spec               api.AapProviderSpec
	CAFile             string
	InsecureSkipVerify bool
	ApiServerURL       string
	CallbackPort       int
	Username           string
	Password           string
	Web                bool
}

func NewAAPOAuth2Config added in v0.6.0

func NewAAPOAuth2Config(metadata api.ObjectMeta, spec api.AapProviderSpec, caFile string, insecure bool, apiServerURL string, callbackPort int, username, password string, web bool) *AAPOAuth

func (*AAPOAuth) Auth added in v0.6.0

func (o *AAPOAuth) Auth() (AuthInfo, error)

func (*AAPOAuth) Renew added in v0.6.0

func (o *AAPOAuth) Renew(refreshToken string) (AuthInfo, error)

func (*AAPOAuth) SetInsecureSkipVerify added in v1.0.0

func (o *AAPOAuth) SetInsecureSkipVerify(insecureSkipVerify bool)

func (*AAPOAuth) Validate added in v0.6.0

func (o *AAPOAuth) Validate(args ValidateArgs) error

type AAPRoundTripper added in v0.6.0

type AAPRoundTripper struct {
	Transport http.RoundTripper
}

func (*AAPRoundTripper) RoundTrip added in v0.6.0

func (c *AAPRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

type AuthInfo added in v0.6.0

type AuthInfo struct {
	AccessToken  string
	RefreshToken string
	IdToken      string
	TokenToUse   TokenToUseType
	ExpiresIn    *int64
}

type AuthProvider

type AuthProvider interface {
	Auth() (AuthInfo, error)
	Renew(refreshToken string) (AuthInfo, error)
	Validate(args ValidateArgs) error
	SetInsecureSkipVerify(insecureSkipVerify bool)
}

type GetClientFunc added in v0.6.0

type GetClientFunc func(callbackURL string) (*osincli.Client, error)

type OAuth2

type OAuth2 struct {
	Metadata           api.ObjectMeta
	Spec               api.OAuth2ProviderSpec
	CAFile             string
	InsecureSkipVerify bool
	ApiServerURL       string
	CallbackPort       int
	Username           string
	Password           string
	Web                bool
}

func NewOAuth2Config added in v1.0.0

func NewOAuth2Config(metadata api.ObjectMeta, spec api.OAuth2ProviderSpec, caFile string, insecure bool, apiServerURL string, callbackPort int, username, password string, web bool) *OAuth2

func (*OAuth2) Auth

func (o *OAuth2) Auth() (AuthInfo, error)

func (*OAuth2) Renew added in v1.0.0

func (o *OAuth2) Renew(refreshToken string) (AuthInfo, error)

func (*OAuth2) SetInsecureSkipVerify added in v1.0.0

func (o *OAuth2) SetInsecureSkipVerify(insecureSkipVerify bool)

func (*OAuth2) Validate added in v1.0.0

func (o *OAuth2) Validate(args ValidateArgs) error

type OIDC

type OIDC struct {
	Metadata           api.ObjectMeta
	Spec               api.OIDCProviderSpec
	CAFile             string
	InsecureSkipVerify bool
	ApiServerURL       string
	CallbackPort       int
	Username           string
	Password           string
	Web                bool
}

func NewOIDCConfig

func NewOIDCConfig(metadata api.ObjectMeta, spec api.OIDCProviderSpec, caFile string, insecure bool, apiServerURL string, callbackPort int, username, password string, web bool) *OIDC

func (*OIDC) Auth

func (o *OIDC) Auth() (AuthInfo, error)

func (*OIDC) Renew added in v0.6.0

func (o *OIDC) Renew(refreshToken string) (AuthInfo, error)

func (*OIDC) SetInsecureSkipVerify added in v1.0.0

func (o *OIDC) SetInsecureSkipVerify(insecureSkipVerify bool)

func (*OIDC) Validate added in v0.6.0

func (o *OIDC) Validate(args ValidateArgs) error

type OIDCDirectResponse

type OIDCDirectResponse struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	ExpiresIn    *int64 `json:"expires_in"` // ExpiresIn in seconds
}

type OIDCDiscoveryResponse added in v1.0.0

type OIDCDiscoveryResponse struct {
	// Required fields
	Issuer                           string   `json:"issuer"`
	AuthorizationEndpoint            string   `json:"authorization_endpoint"`
	TokenEndpoint                    string   `json:"token_endpoint"`
	JwksUri                          string   `json:"jwks_uri"`
	SubjectTypesSupported            []string `json:"subject_types_supported"`
	ResponseTypesSupported           []string `json:"response_types_supported"`
	IdTokenSigningAlgValuesSupported []string `json:"id_token_signing_alg_values_supported"`

	// Optional fields
	UserinfoEndpoint                  string   `json:"userinfo_endpoint,omitempty"`
	GrantTypesSupported               []string `json:"grant_types_supported,omitempty"`
	ScopesSupported                   []string `json:"scopes_supported,omitempty"`
	ClaimsSupported                   []string `json:"claims_supported,omitempty"`
	TokenEndpointAuthMethodsSupported []string `json:"token_endpoint_auth_methods_supported,omitempty"`
	CodeChallengeMethodsSupported     []string `json:"code_challenge_methods_supported,omitempty"`
}

OIDCDiscoveryResponse represents the OpenID Connect Discovery metadata as defined in the Flight Control PAM issuer OpenAPI spec

type OpenShift added in v1.0.0

type OpenShift struct {
	Metadata           api.ObjectMeta
	Spec               api.OpenShiftProviderSpec
	CAFile             string
	InsecureSkipVerify bool
	ApiServerURL       string
	CallbackPort       int
	Username           string
	Password           string
	Web                bool
}

func NewOpenShiftConfig added in v1.0.0

func NewOpenShiftConfig(metadata api.ObjectMeta, spec api.OpenShiftProviderSpec, caFile string, insecure bool, apiServerURL string, callbackPort int, username, password string, web bool) *OpenShift

func (*OpenShift) Auth added in v1.0.0

func (o *OpenShift) Auth() (AuthInfo, error)

func (*OpenShift) Renew added in v1.0.0

func (o *OpenShift) Renew(refreshToken string) (AuthInfo, error)

func (*OpenShift) SetInsecureSkipVerify added in v1.0.0

func (o *OpenShift) SetInsecureSkipVerify(insecureSkipVerify bool)

func (*OpenShift) Validate added in v1.0.0

func (o *OpenShift) Validate(args ValidateArgs) error

type TokenAuth added in v1.0.0

type TokenAuth struct {
	Token string
}

TokenAuth is a provider for direct token-based authentication

func NewTokenAuth added in v1.0.0

func NewTokenAuth(token string) *TokenAuth

NewTokenAuth creates a new token-based auth provider

func (*TokenAuth) Auth added in v1.0.0

func (t *TokenAuth) Auth() (AuthInfo, error)

Auth returns the pre-configured token

func (*TokenAuth) Renew added in v1.0.0

func (t *TokenAuth) Renew(refreshToken string) (AuthInfo, error)

Renew is not supported for token-based authentication

func (*TokenAuth) SetInsecureSkipVerify added in v1.0.0

func (t *TokenAuth) SetInsecureSkipVerify(insecureSkipVerify bool)

func (*TokenAuth) Validate added in v1.0.0

func (t *TokenAuth) Validate(args ValidateArgs) error

Validate performs no validation - token is already provided

type TokenToUseType added in v1.0.0

type TokenToUseType string
const (
	TokenToUseAccessToken TokenToUseType = "access"
	TokenToUseIdToken     TokenToUseType = "id"
)

type ValidateArgs added in v0.6.0

type ValidateArgs struct {
	ApiUrl      string
	AccessToken string
}

Jump to

Keyboard shortcuts

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