Documentation
¶
Index ¶
- Constants
- Variables
- func DeleteTokens(ctx context.Context, t *testing.T, tokenIDs []string, token string)
- 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 HTTPURI(uri string) string
- func MakeConfig(t require.TestingT) service.Config
- func MakeStoreConfig() storeConfig.Config
- func New(t require.TestingT, cfg service.Config) func()
- func NewMongoStore(t require.TestingT) (*storeMongo.Store, 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 WithExpiration(expiration time.Time) 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 = oauthsigner.Client{ ID: "JWTPrivateKeyClient", SecretFile: "data:,JWTPrivateKeyClientSecret", AccessTokenLifetime: 0, AllowedGrantTypes: []oauthsigner.GrantType{oauthsigner.GrantTypeClientCredentials}, AllowedAudiences: nil, AllowedScopes: nil, JWTPrivateKey: oauthsigner.PrivateKeyJWTConfig{ Enabled: true, Authorization: config.MakeValidatorConfig(), }, }
View Source
var OAuthClients = oauthsigner.OAuthClientsConfig{ &ServiceOAuthClient, &JWTPrivateKeyOAuthClient, }
View Source
var ServiceOAuthClient = oauthsigner.Client{ ID: "serviceClient", SecretFile: "data:,serviceClientSecret", Owner: "1", AccessTokenLifetime: 0, AllowedGrantTypes: []oauthsigner.GrantType{oauthsigner.GrantTypeClientCredentials}, AllowedAudiences: nil, AllowedScopes: nil, InsertTokenClaims: map[string]interface{}{"hardcodedClaim": true}, }
Functions ¶
func DeleteTokens ¶ added in v2.23.0
func GetAccessToken ¶
func GetDefaultAccessToken ¶
func GetDefaultAccessToken(t *testing.T, opts ...func(opts *AccessTokenOptions)) string
func GetJWTValidator ¶
func MakeStoreConfig ¶ added in v2.23.0
func MakeStoreConfig() storeConfig.Config
func NewMongoStore ¶ added in v2.23.0
func NewMongoStore(t require.TestingT) (*storeMongo.Store, func())
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 WithExpiration ¶ added in v2.23.0
func WithExpiration(expiration time.Time) func(opts *AccessTokenOptions)
func WithPostFrom ¶
func WithPostFrom(enabled bool) func(opts *AccessTokenOptions)
Types ¶
Click to show internal directories.
Click to hide internal directories.