mockuaa

package
v0.45.4 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnauthorizedError            = "you are unauthorized"
	UnauthorizedErrorDescription = "you are not authorized to perform this action"
	MalformedResponseUser        = "MalformedResponse"
	InternalServerErrorUser      = "InternalServerError"
	InternalServerErrorMessage   = "An unexpected error occurred. Please try again later."
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientCredentialsServer

type ClientCredentialsServer struct {
	*httptest.Server

	UAAClientID     string
	UAAClientSecret string
	TokenToReturn   string

	ValiditySecondsToReturn int
	TokensIssued            int
}

func NewClientCredentialsServer

func NewClientCredentialsServer(uaaClientID, uaaClientSecret, tokenToReturn string) *ClientCredentialsServer

func NewClientCredentialsServerTLS

func NewClientCredentialsServerTLS(uaaClientID, uaaClientSecret, certPath, keyPath, tokenToReturn string) *ClientCredentialsServer

func (ClientCredentialsServer) ExpectedAuthorizationHeader

func (s ClientCredentialsServer) ExpectedAuthorizationHeader() string

func (*ClientCredentialsServer) ServeHTTP

func (s *ClientCredentialsServer) ServeHTTP(writer http.ResponseWriter, req *http.Request)

type UserCredentialsServer

type UserCredentialsServer struct {
	*httptest.Server

	ClientID      string
	ClientSecret  string
	Username      string
	Password      string
	TokenToReturn string

	ValiditySecondsToReturn int
	TokensIssued            int

	IgnoreOtherPaths bool
}

func NewUserCredentialsServer

func NewUserCredentialsServer(clientID, clientSecret, username, password, tokenToReturn string) *UserCredentialsServer

func NewUserCredentialsServerTLS

func NewUserCredentialsServerTLS(clientID, clientSecret, username, password, certPath, keyPath, tokenToReturn string) *UserCredentialsServer

func (*UserCredentialsServer) ServeHTTP

func (s *UserCredentialsServer) ServeHTTP(writer http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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