mock

package
v0.0.0-...-7dca2e3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ingress = "http://wonderwall"
)

Variables

This section is empty.

Functions

func Config

func Config() *config.Config

func Ingresses

func Ingresses(cfg *config.Config) *ingress.Ingresses

func NewGetRequest

func NewGetRequest(target string, ingresses *ingress.Ingresses) *http.Request

Types

type AuthorizeRequest

type AuthorizeRequest struct {
	AcrLevel      string
	ClientID      string
	CodeChallenge string
	Locale        string
	Nonce         string
	RedirectUri   string
	SessionID     string
}

type IdentityProvider

type IdentityProvider struct {
	Cfg                 *config.Config
	OpenIDConfig        *TestConfiguration
	ProviderHandler     *IdentityProviderHandler
	ProviderServer      *httptest.Server
	RelyingPartyHandler *handlerpkg.Standalone
	RelyingPartyServer  *httptest.Server
	// contains filtered or unexported fields
}

func NewIdentityProvider

func NewIdentityProvider(cfg *config.Config) *IdentityProvider

func (*IdentityProvider) Close

func (in *IdentityProvider) Close()

func (*IdentityProvider) GetRequest

func (in *IdentityProvider) GetRequest(target string) *http.Request

func (*IdentityProvider) RelyingPartyClient

func (in *IdentityProvider) RelyingPartyClient() *http.Client

type IdentityProviderHandler

type IdentityProviderHandler struct {
	Codes         map[string]*AuthorizeRequest
	Config        openidconfig.Config
	Provider      *TestProvider
	Sessions      map[string]string
	RefreshTokens map[string]*RefreshTokenData
	TokenDuration time.Duration
}

func (*IdentityProviderHandler) Authorize

func (*IdentityProviderHandler) EndSession

func (ip *IdentityProviderHandler) EndSession(w http.ResponseWriter, r *http.Request)

func (*IdentityProviderHandler) Jwks

func (*IdentityProviderHandler) RefreshTokenGrant

func (ip *IdentityProviderHandler) RefreshTokenGrant(w http.ResponseWriter, r *http.Request)

func (*IdentityProviderHandler) Token

func (*IdentityProviderHandler) TokenCodeGrant

func (ip *IdentityProviderHandler) TokenCodeGrant(w http.ResponseWriter, r *http.Request)

type RefreshTokenData

type RefreshTokenData struct {
	ClientID        string
	RefreshToken    string
	OriginalIDToken jwt.Token
	SessionID       string
}

type TestClientConfiguration

type TestClientConfiguration struct {
	*config.Config
	// contains filtered or unexported fields
}

func (*TestClientConfiguration) ACRValues

func (c *TestClientConfiguration) ACRValues() string

func (*TestClientConfiguration) Audiences

func (c *TestClientConfiguration) Audiences() map[string]bool

func (*TestClientConfiguration) AuthMethod

func (*TestClientConfiguration) ClientID

func (c *TestClientConfiguration) ClientID() string

func (*TestClientConfiguration) ClientJWK

func (c *TestClientConfiguration) ClientJWK() jwk.Key

func (*TestClientConfiguration) ClientSecret

func (c *TestClientConfiguration) ClientSecret() string

func (*TestClientConfiguration) PostLogoutRedirectURI

func (c *TestClientConfiguration) PostLogoutRedirectURI() string

func (*TestClientConfiguration) ResourceIndicator

func (c *TestClientConfiguration) ResourceIndicator() string

func (*TestClientConfiguration) Scopes

func (*TestClientConfiguration) SetPostLogoutRedirectURI

func (c *TestClientConfiguration) SetPostLogoutRedirectURI(uri string)

func (*TestClientConfiguration) UILocales

func (c *TestClientConfiguration) UILocales() string

func (*TestClientConfiguration) WellKnownURL

func (c *TestClientConfiguration) WellKnownURL() string

type TestConfiguration

type TestConfiguration struct {
	TestClient   *TestClientConfiguration
	TestProvider *TestProviderConfiguration
}

func NewTestConfiguration

func NewTestConfiguration(cfg *config.Config) *TestConfiguration

func (*TestConfiguration) Client

func (*TestConfiguration) Provider

func (c *TestConfiguration) Provider() openidconfig.Provider

type TestProvider

type TestProvider struct {
	JwksPair *crypto.JwkSet
}

func NewTestJwksProvider

func NewTestJwksProvider() *TestProvider

func (*TestProvider) GetPublicJwkSet

func (p *TestProvider) GetPublicJwkSet(_ context.Context) (*jwk.Set, error)

func (*TestProvider) PrivateJwkSet

func (p *TestProvider) PrivateJwkSet() *jwk.Set

func (*TestProvider) RefreshPublicJwkSet

func (p *TestProvider) RefreshPublicJwkSet(_ context.Context) (*jwk.Set, error)

type TestProviderConfiguration

type TestProviderConfiguration struct {
	Cfg      *config.Config
	Metadata *openidconfig.ProviderMetadata
}

func (*TestProviderConfiguration) ACRValuesSupported

func (t *TestProviderConfiguration) ACRValuesSupported() openidconfig.Supported

func (*TestProviderConfiguration) AuthorizationEndpoint

func (t *TestProviderConfiguration) AuthorizationEndpoint() string

func (*TestProviderConfiguration) EndSessionEndpointURL

func (t *TestProviderConfiguration) EndSessionEndpointURL() url.URL

func (*TestProviderConfiguration) IDTokenSigningAlg

func (t *TestProviderConfiguration) IDTokenSigningAlg() jwa.KeyAlgorithm

func (*TestProviderConfiguration) Issuer

func (t *TestProviderConfiguration) Issuer() string

func (*TestProviderConfiguration) JwksURI

func (t *TestProviderConfiguration) JwksURI() string

func (*TestProviderConfiguration) Name

func (*TestProviderConfiguration) SessionStateRequired

func (t *TestProviderConfiguration) SessionStateRequired() bool

func (*TestProviderConfiguration) SetAuthorizationEndpoint

func (t *TestProviderConfiguration) SetAuthorizationEndpoint(url string)

func (*TestProviderConfiguration) SetCheckSessionIframe

func (t *TestProviderConfiguration) SetCheckSessionIframe(url string)

func (*TestProviderConfiguration) SetEndSessionEndpoint

func (t *TestProviderConfiguration) SetEndSessionEndpoint(url string)

func (*TestProviderConfiguration) SetFrontchannelLogoutSessionSupported

func (t *TestProviderConfiguration) SetFrontchannelLogoutSessionSupported(val bool)

func (*TestProviderConfiguration) SetFrontchannelLogoutSupported

func (t *TestProviderConfiguration) SetFrontchannelLogoutSupported(val bool)

func (*TestProviderConfiguration) SetIssuer

func (t *TestProviderConfiguration) SetIssuer(url string)

func (*TestProviderConfiguration) SetJwksURI

func (t *TestProviderConfiguration) SetJwksURI(url string)

func (*TestProviderConfiguration) SetTokenEndpoint

func (t *TestProviderConfiguration) SetTokenEndpoint(url string)

func (*TestProviderConfiguration) SidClaimRequired

func (t *TestProviderConfiguration) SidClaimRequired() bool

func (*TestProviderConfiguration) TokenEndpoint

func (t *TestProviderConfiguration) TokenEndpoint() string

func (*TestProviderConfiguration) UILocalesSupported

func (t *TestProviderConfiguration) UILocalesSupported() openidconfig.Supported

func (*TestProviderConfiguration) WithCheckSessionIFrameSupport

func (t *TestProviderConfiguration) WithCheckSessionIFrameSupport(url string)

func (*TestProviderConfiguration) WithFrontChannelLogoutSupport

func (t *TestProviderConfiguration) WithFrontChannelLogoutSupport()

Jump to

Keyboard shortcuts

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