test

package
v2.19.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientTest = "test"
	// Client with short auth code and access token expiration
	ClientTestShortExpiration = "testShortExpiration"
	// Client will return error when the same auth code or refresh token
	// is used repeatedly within a minute of the first use
	ClientTestRestrictedAuth = "testRestrictedAuth"
	// Client with expired access token
	ClientTestExpired = "testExpired"
	// Client for C2C testing
	ClientTestC2C = "testC2C"
	// Client with configured required params used to verify the authorization and token request query params
	ClientTestRequiredParams = "requiredParams"
	// Secret for client with configured required params
	ClientTestRequiredParamsSecret = "requiredParamsSecret"
	// Valid refresh token if refresh token restriction policy not configured
	ValidRefreshToken = "refresh-token"
)

Variables

This section is empty.

Functions

func GetAccessToken

func GetAccessToken(t require.TestingT, authServerHost, clientID string, claimOverrides map[string]interface{}) string

func GetAuthorizationCode

func GetAuthorizationCode(t require.TestingT, authServerHost, clientID, deviceID, scopes string) string

func GetDefaultAccessToken

func GetDefaultAccessToken(t require.TestingT) string

func GetDefaultDeviceAuthorizationCode

func GetDefaultDeviceAuthorizationCode(t require.TestingT, deviceID string) string

func GetJWTValidator added in v2.4.0

func GetJWTValidator(jwkURL string) *jwt.Validator

func HTTPDo

func HTTPDo(t require.TestingT, req *http.Request, followRedirect bool) *http.Response

func MakeConfig

func MakeConfig(t require.TestingT) service.Config

func New

func New(t require.TestingT, cfg service.Config) func()

func SetUp

func SetUp(t require.TestingT) (tearDown func())

Types

type RequestBuilder added in v2.6.2

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

func NewRequestBuilder added in v2.6.2

func NewRequestBuilder(method, host, url string, body io.Reader) *RequestBuilder

func (*RequestBuilder) AddQuery added in v2.6.2

func (c *RequestBuilder) AddQuery(key, value string) *RequestBuilder

func (*RequestBuilder) Build added in v2.6.2

func (c *RequestBuilder) Build() *http.Request

Jump to

Keyboard shortcuts

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