Documentation
¶
Index ¶
- func RemoteAccount(t testing.TB, store AccountStore, username string) identityservice.Account
- func RemoteAdmin(t testing.TB, store identityservice.Store, username, password string) identityservice.Session
- func RemoteSession(t testing.TB, store identityservice.Store, account identityservice.Account) identityservice.Session
- type AccountStore
- type Client
- type PushDevice
- type Receipt
- type TestServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RemoteAccount ¶ added in v0.2.2
func RemoteAccount(t testing.TB, store AccountStore, username string) identityservice.Account
RemoteAccount creates a passwordless member account, as an accepted invite does.
func RemoteAdmin ¶ added in v0.2.2
func RemoteAdmin(t testing.TB, store identityservice.Store, username, password string) identityservice.Session
RemoteAdmin completes one-time setup, as the logged setup link does.
func RemoteSession ¶ added in v0.2.2
func RemoteSession(t testing.TB, store identityservice.Store, account identityservice.Account) identityservice.Session
RemoteSession signs a member in without Google, as a completed sign-in does.
Types ¶
type AccountStore ¶ added in v0.2.2
type AccountStore interface {
CreateAccount(ctx context.Context, account identityservice.Account, passwordHash string, created time.Time) error
}
AccountStore creates accounts directly; server storage implements it.
type PushDevice ¶ added in v0.2.2
type PushDevice struct {
Private *ecdh.PrivateKey
Auth []byte
}
PushDevice is a browser push subscription's receiving keys.
func NewPushDevice ¶ added in v0.2.2
func NewPushDevice(t testing.TB) PushDevice
NewPushDevice generates receiving keys, as a browser does when subscribing.
func (PushDevice) AuthSecret ¶ added in v0.2.2
func (device PushDevice) AuthSecret() string
func (PushDevice) Decrypt ¶ added in v0.2.2
func (device PushDevice) Decrypt(t testing.TB, body []byte) []byte
Decrypt opens an RFC 8291 aes128gcm message body with a single record, as the browser's push stack does before the service worker sees the payload.
func (PushDevice) P256dh ¶ added in v0.2.2
func (device PushDevice) P256dh() string
P256dh and AuthSecret are the base64url keys of PushSubscription.toJSON().
type TestServer ¶
func Server ¶
func Server(t *testing.T, service *contextservice.Service, store reviewservice.MutationStore, queue ingestionqueue.Queue) *TestServer
Server composes an unauthenticated queue and worker for producer integration tests.
func (*TestServer) Close ¶
func (server *TestServer) Close()