Documentation
¶
Index ¶
- func Identity(t testing.TB, store identityservice.Store, options ...identityservice.Option) *identityservice.Service
- func PutSettings(t testing.TB, store identityservice.Store, settings identityservice.Settings)
- func RemoteAccount(t testing.TB, store AccountStore, name string) identityservice.Account
- func RemoteAdmin(t testing.TB, store identityservice.Store, email, password string) identityservice.Session
- func RemotePasswordAccount(t testing.TB, store identityservice.Store, email, password string) identityservice.Account
- 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 Identity ¶ added in v0.2.4
func Identity(t testing.TB, store identityservice.Store, options ...identityservice.Option) *identityservice.Service
Identity composes the identity service with the stored settings loaded, as a server replica does before serving.
func PutSettings ¶ added in v0.2.4
func PutSettings(t testing.TB, store identityservice.Store, settings identityservice.Settings)
PutSettings stores app settings, as an admin does in the console.
func RemoteAccount ¶ added in v0.2.2
func RemoteAccount(t testing.TB, store AccountStore, name string) identityservice.Account
RemoteAccount creates a Google member account with email name@example.com, as an accepted invite does.
func RemoteAdmin ¶ added in v0.2.2
func RemoteAdmin(t testing.TB, store identityservice.Store, email, password string) identityservice.Session
RemoteAdmin stores a password admin for tests unrelated to first-admin setup.
func RemotePasswordAccount ¶ added in v0.2.5
func RemotePasswordAccount(t testing.TB, store identityservice.Store, email, password string) identityservice.Account
RemotePasswordAccount stores a password account with a canonical email, bypassing admission settings, for tests unrelated to signup.
func RemoteSession ¶ added in v0.2.2
func RemoteSession(t testing.TB, store identityservice.Store, account identityservice.Account) identityservice.Session
Types ¶
type AccountStore ¶ added in v0.2.2
type AccountStore interface {
CreateGoogleAccount(ctx context.Context, account identityservice.Account, identity google.Identity, now time.Time, required identityservice.Settings) 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()