mockOidcSupport

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorWrongKey     = "WrongKey"
	ErrorMissingToken = "NoIdToken"
	ErrorExpiredToken = "ExpiredToken"
	ErrorScope        = "Scope"
	ErrorState        = "State"
	ErrorNonce        = "Nonce"
	ErrorAudience     = "Audience"
	ErrorUnauthorized = "BadClient"
	ErrorForbidden    = "Forbidden"
	ErrorBadCode      = "code"
	ErrorBadTokenForm = "badToken"
)

Variables

This section is empty.

Functions

func HandleHello

func HandleHello(w http.ResponseWriter, r *http.Request)

Types

type AccessTokenData

type AccessTokenData struct {
	*jwt.RegisteredClaims
	Scope string   `json:"scope"`
	Nonce string   `json:"nonce"`
	Email string   `json:"email"`
	Roles []string `json:"roles,omitempty"`
}

type MalformedTokenData

type MalformedTokenData struct {
	*jwt.RegisteredClaims
	Scope string   `json:"scope"`
	Nonce []string `json:"nonce"`
	Email string   `json:"email"`
}

type MockAuthServer

type MockAuthServer struct {
	Issuer string

	Server       *httptest.Server
	Nonce        string
	TriggerError string
	T            *testing.T
	TestRoles    []string
	TestSubj     string
	TestEmail    string
	// contains filtered or unexported fields
}

func NewMockAuthServer

func NewMockAuthServer(clientID, secret string, claims map[string]interface{}) *MockAuthServer

func (*MockAuthServer) BuildJWT

func (as *MockAuthServer) BuildJWT(expireSecs int64, scopes []string, audience []string, nonce string, malformed bool) (string, error)

func (*MockAuthServer) CheckTest

func (as *MockAuthServer) CheckTest(errorType string) bool

func (*MockAuthServer) Jwks

func (as *MockAuthServer) Jwks() []byte

func (*MockAuthServer) Shutdown

func (as *MockAuthServer) Shutdown()

type MockResourceServer

type MockResourceServer struct {
	Server *http.Server
}

func NewMockResourceServer

func NewMockResourceServer(path string, wrapperFunc http.HandlerFunc) *MockResourceServer

func (*MockResourceServer) Shutdown

func (as *MockResourceServer) Shutdown()

type SigningKey

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

Jump to

Keyboard shortcuts

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