Documentation
¶
Index ¶
- Constants
- Variables
- func NewTestStorage(options TestStorageOptions) storage.Storage
- type NopLimiter
- type NopProvider
- type TestClaims
- func (t TestClaims) Equal(c TestClaims) bool
- func (t TestClaims) GetAudience() (jwt.ClaimStrings, error)
- func (t TestClaims) GetExpirationTime() (*jwt.NumericDate, error)
- func (t TestClaims) GetIssuedAt() (*jwt.NumericDate, error)
- func (t TestClaims) GetIssuer() (string, error)
- func (t TestClaims) GetNotBefore() (*jwt.NumericDate, error)
- func (t TestClaims) GetSubject() (string, error)
- type TestStorageOptions
Constants ¶
View Source
const ( // BaseURL is the test base URL for the service. BaseURL = "http://localhost:8080/api/v2/" // 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" // LinksExpireAfter is the amount of time links expire after for tests. LinksExpireAfter = 24 * 30 * time.Hour )
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 NopProvider ¶
type NopProvider struct{}
NopProvider is an email provider that does nothing.
func (NopProvider) SendMagicLink ¶ added in v0.6.0
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) GetAudience ¶ added in v0.5.1
func (t TestClaims) GetAudience() (jwt.ClaimStrings, error)
func (TestClaims) GetExpirationTime ¶ added in v0.5.1
func (t TestClaims) GetExpirationTime() (*jwt.NumericDate, error)
func (TestClaims) GetIssuedAt ¶ added in v0.5.1
func (t TestClaims) GetIssuedAt() (*jwt.NumericDate, error)
func (TestClaims) GetIssuer ¶ added in v0.5.1
func (t TestClaims) GetIssuer() (string, error)
func (TestClaims) GetNotBefore ¶ added in v0.5.1
func (t TestClaims) GetNotBefore() (*jwt.NumericDate, error)
func (TestClaims) GetSubject ¶ added in v0.5.1
func (t TestClaims) GetSubject() (string, error)
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.