Documentation
¶
Index ¶
- Constants
- Variables
- func GetAccessToken(t *testing.T, expectedCode int, opts ...func(opts *AccessTokenOptions)) map[string]string
- func GetDefaultAccessToken(t *testing.T, opts ...func(opts *AccessTokenOptions)) string
- func GetJWTValidator(jwkURL string) *jwt.Validator
- func GetSecret(t require.TestingT, clientID string) string
- func MakeConfig(t require.TestingT) service.Config
- func New(t require.TestingT, cfg service.Config) func()
- func SetUp(t require.TestingT) (tearDown func())
- func WithAccessTokenAudience(audience string) func(opts *AccessTokenOptions)
- func WithAccessTokenClientID(clientID string) func(opts *AccessTokenOptions)
- func WithAccessTokenClientSecret(clientSecret string) func(opts *AccessTokenOptions)
- func WithAccessTokenGrantType(grantType string) func(opts *AccessTokenOptions)
- func WithAccessTokenHost(host string) func(opts *AccessTokenOptions)
- func WithAccessTokenJWT(jwt string) func(opts *AccessTokenOptions)
- func WithAccessTokenOptions(options AccessTokenOptions) func(opts *AccessTokenOptions)
- func WithContext(ctx context.Context) func(opts *AccessTokenOptions)
- func WithPostFrom(enabled bool) func(opts *AccessTokenOptions)
- type AccessTokenOptions
Constants ¶
View Source
const ( OwnerClaim = testOAuthUri.OwnerClaimKey DeviceIDClaim = testOAuthUri.DeviceIDClaimKey )
Variables ¶
View Source
var JWTPrivateKeyOAuthClient = service.Client{ ID: "JWTPrivateKeyClient", SecretFile: "data:,JWTPrivateKeyClientSecret", AccessTokenLifetime: 0, AllowedGrantTypes: []service.GrantType{service.GrantTypeClientCredentials}, AllowedAudiences: nil, AllowedScopes: nil, JWTPrivateKey: service.PrivateKeyJWTConfig{ Enabled: true, Authorization: config.MakeValidatorConfig(), }, }
View Source
var OAuthClients = service.OAuthClientsConfig{ &ServiceOAuthClient, &JWTPrivateKeyOAuthClient, }
View Source
var ServiceOAuthClient = service.Client{ ID: "serviceClient", SecretFile: "data:,serviceClientSecret", AccessTokenLifetime: 0, AllowedGrantTypes: []service.GrantType{service.GrantTypeClientCredentials}, AllowedAudiences: nil, AllowedScopes: nil, InsertTokenClaims: map[string]interface{}{"hardcodedClaim": true}, }
Functions ¶
func GetAccessToken ¶
func GetDefaultAccessToken ¶
func GetDefaultAccessToken(t *testing.T, opts ...func(opts *AccessTokenOptions)) string
func GetJWTValidator ¶
func WithAccessTokenAudience ¶
func WithAccessTokenAudience(audience string) func(opts *AccessTokenOptions)
func WithAccessTokenClientID ¶
func WithAccessTokenClientID(clientID string) func(opts *AccessTokenOptions)
func WithAccessTokenClientSecret ¶
func WithAccessTokenClientSecret(clientSecret string) func(opts *AccessTokenOptions)
func WithAccessTokenGrantType ¶
func WithAccessTokenGrantType(grantType string) func(opts *AccessTokenOptions)
func WithAccessTokenHost ¶
func WithAccessTokenHost(host string) func(opts *AccessTokenOptions)
func WithAccessTokenJWT ¶
func WithAccessTokenJWT(jwt string) func(opts *AccessTokenOptions)
func WithAccessTokenOptions ¶
func WithAccessTokenOptions(options AccessTokenOptions) func(opts *AccessTokenOptions)
func WithContext ¶
func WithContext(ctx context.Context) func(opts *AccessTokenOptions)
func WithPostFrom ¶
func WithPostFrom(enabled bool) func(opts *AccessTokenOptions)
Types ¶
Click to show internal directories.
Click to hide internal directories.