Documentation
¶
Overview ¶
Package storetest is a conformance suite for store implementations.
Every store shipped with the library runs it, and so should yours:
func TestSessions(t *testing.T) {
storetest.Sessions(t, func(t *testing.T) session.Store { return newMyStore(t) })
}
Each factory call must return an empty store.
Index ¶
- func Invites(t *testing.T, newStore func(t *testing.T) invite.Store)
- func Sessions(t *testing.T, newStore func(t *testing.T) session.Store)
- func Users(t *testing.T, newStore func(t *testing.T) UserStore)
- func UsersWith(t *testing.T, newStore func(t *testing.T) UserStore, opts UsersOptions)
- type UserStore
- type UsersOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type UserStore ¶
type UserStore interface {
iam.UserStore
password.CredentialStore
}
UserStore is what Users needs: subjects, identities and credentials.
type UsersOptions ¶ added in v2.1.0
type UsersOptions struct {
// Roles are granted to the first subject the suite creates, and must be
// returned by LoadSubject in the same order. Default: editor, reader.
// Set it for stores that allow one role per subject, or only known roles.
Roles []string
// DefaultRoles are granted to the second subject (an empty grant by
// default). Set it for stores that require at least one role.
DefaultRoles []string
}
UsersOptions adapts the Users suite to stores with stricter rules than IAM requires. The zero value is the default suite.