Documentation ¶
Index ¶
- Constants
- Variables
- func NewTestStorage(options TestStorageOptions) storage.Storage
- type ErrorLimiter
- type ErrorProvider
- type ErrorStorage
- func (e ErrorStorage) Begin(_ context.Context) (storage.Tx, error)
- func (e ErrorStorage) Close(_ context.Context) error
- func (e ErrorStorage) CreateAdminSA(_ context.Context, _ model.ValidAdminCreateArgs) error
- func (e ErrorStorage) CreateLink(_ context.Context, _ magiclink.CreateArgs[storage.MagicLinkCustomCreateArgs]) (secret string, err error)
- func (e ErrorStorage) CreateSA(_ context.Context, _ model.ValidServiceAccountCreateArgs) (model.ServiceAccount, error)
- func (e ErrorStorage) DeleteKey(_ context.Context, _ string) (ok bool, err error)
- func (e ErrorStorage) ReadKey(_ context.Context, _ string) (jwkset.KeyWithMeta[storage.JWKSetCustomKeyMeta], error)
- func (e ErrorStorage) ReadLink(_ context.Context, _ string) (...)
- func (e ErrorStorage) ReadSA(_ context.Context, _ uuid.UUID) (model.ServiceAccount, error)
- func (e ErrorStorage) ReadSAFromAPIKey(_ context.Context, _ uuid.UUID) (model.ServiceAccount, error)
- func (e ErrorStorage) ReadSigningKey(_ context.Context, _ storage.ReadSigningKeyOptions) (meta jwkset.KeyWithMeta[storage.JWKSetCustomKeyMeta], err error)
- func (e ErrorStorage) SnapshotKeys(_ context.Context) ([]jwkset.KeyWithMeta[storage.JWKSetCustomKeyMeta], error)
- func (e ErrorStorage) TestingTruncate(_ context.Context) error
- func (e ErrorStorage) UpdateDefaultSigningKey(_ context.Context, _ string) error
- func (e ErrorStorage) WriteKey(_ context.Context, _ jwkset.KeyWithMeta[storage.JWKSetCustomKeyMeta]) error
- type NopLimiter
- type NopProvider
- type TestClaims
- type TestStorageOptions
Constants ¶
View Source
const ( // BaseURL is the test base URL for the service. BaseURL = "http://localhost:8080/api/v1/" // Iss is the test issuer for the service. Iss = BaseURL // LogoImageURL is the test service logo for the service. LogoImageURL = "http://example.com/logo.png" // ServiceName is the test service name for the service. ServiceName = "Example service" // LogoClickURL is the test service URL for the service. LogoClickURL = "http://example.com" )
Variables ¶
View Source
var ( // APIKey is the test API key for the service. APIKey = uuid.MustParse("40084740-0bc3-455d-b298-e23a31561580") // Aud is the test audience for the service. Aud = uuid.MustParse("ad9e9d84-92ea-4f07-bac9-5d898d59c83b") // ErrMLDTest is the test error for the service. ErrMLDTest = errors.New("mldtest") // TClaims is the test claims for the service. TClaims = TestClaims{Foo: "foo"} // SAUUID is the test service account UUID for the service. SAUUID = uuid.MustParse("1e079d6d-a8b9-4065-aa8d-86906accd211") )
Functions ¶
func NewTestStorage ¶
func NewTestStorage(options TestStorageOptions) storage.Storage
NewTestStorage creates a new test storage.
Types ¶
type ErrorLimiter ¶
type ErrorLimiter struct{}
ErrorLimiter is a rate limiter that always returns an error.
type ErrorProvider ¶
type ErrorProvider struct{}
ErrorProvider is an email provider that always returns an error.
type ErrorStorage ¶
type ErrorStorage struct{}
ErrorStorage is a storage.Storage implementation that always returns an error.
func (ErrorStorage) CreateAdminSA ¶
func (e ErrorStorage) CreateAdminSA(_ context.Context, _ model.ValidAdminCreateArgs) error
func (ErrorStorage) CreateLink ¶
func (e ErrorStorage) CreateLink(_ context.Context, _ magiclink.CreateArgs[storage.MagicLinkCustomCreateArgs]) (secret string, err error)
func (ErrorStorage) CreateSA ¶
func (e ErrorStorage) CreateSA(_ context.Context, _ model.ValidServiceAccountCreateArgs) (model.ServiceAccount, error)
func (ErrorStorage) ReadKey ¶
func (e ErrorStorage) ReadKey(_ context.Context, _ string) (jwkset.KeyWithMeta[storage.JWKSetCustomKeyMeta], error)
func (ErrorStorage) ReadLink ¶
func (e ErrorStorage) ReadLink(_ context.Context, _ string) (magiclink.ReadResponse[storage.MagicLinkCustomCreateArgs, storage.MagicLinkCustomReadResponse], error)
func (ErrorStorage) ReadSA ¶
func (e ErrorStorage) ReadSA(_ context.Context, _ uuid.UUID) (model.ServiceAccount, error)
func (ErrorStorage) ReadSAFromAPIKey ¶
func (e ErrorStorage) ReadSAFromAPIKey(_ context.Context, _ uuid.UUID) (model.ServiceAccount, error)
func (ErrorStorage) ReadSigningKey ¶
func (e ErrorStorage) ReadSigningKey(_ context.Context, _ storage.ReadSigningKeyOptions) (meta jwkset.KeyWithMeta[storage.JWKSetCustomKeyMeta], err error)
func (ErrorStorage) SnapshotKeys ¶
func (e ErrorStorage) SnapshotKeys(_ context.Context) ([]jwkset.KeyWithMeta[storage.JWKSetCustomKeyMeta], error)
func (ErrorStorage) TestingTruncate ¶
func (e ErrorStorage) TestingTruncate(_ context.Context) error
func (ErrorStorage) UpdateDefaultSigningKey ¶
func (e ErrorStorage) UpdateDefaultSigningKey(_ context.Context, _ string) error
func (ErrorStorage) WriteKey ¶
func (e ErrorStorage) WriteKey(_ context.Context, _ jwkset.KeyWithMeta[storage.JWKSetCustomKeyMeta]) error
type TestClaims ¶
type TestClaims struct {
Foo string `json:"foo"`
}
TestClaims is the test claims for the service.
func (TestClaims) Equal ¶
func (t TestClaims) Equal(c TestClaims) bool
Equal returns true if the two claims are equal.
func (TestClaims) Valid ¶
func (t TestClaims) Valid() error
Valid implements the jwt.Claims interface.
type TestStorageOptions ¶
type TestStorageOptions struct { Key ed25519.PrivateKey KeyID string SA model.ServiceAccount }
TestStorageOptions are the options for creating a test storage.
Click to show internal directories.
Click to hide internal directories.