MCPcopy Index your code
hub / github.com/rilldata/rill / NewUserWithEmail

Method NewUserWithEmail

admin/testadmin/testadmin.go:249–260  ·  view source on GitHub ↗

NewUserWithEmail creates a new user with the given email in the fixture's admin service.

(t *testing.T, emailAddr string)

Source from the content-addressed store, hash-verified

247
248// NewUserWithEmail creates a new user with the given email in the fixture's admin service.
249func (f *Fixture) NewUserWithEmail(t *testing.T, emailAddr string) (*database.User, *client.Client) {
250 ctx := t.Context()
251 name := fmt.Sprintf("Test %s", strings.Split(emailAddr, "@")[0])
252
253 u, err := f.Admin.CreateOrUpdateUser(ctx, emailAddr, name, "")
254 require.NoError(t, err)
255
256 tkn, err := f.Admin.IssueUserAuthToken(ctx, u.ID, database.AuthClientIDRillWeb, "Test session", nil, nil, false)
257 require.NoError(t, err)
258
259 return u, f.NewClient(t, tkn.Token().String())
260}
261
262// NewClient creates a new client for the fixture's server.
263func (f *Fixture) NewClient(t *testing.T, token string) *client.Client {

Callers 3

NewUserWithDomainMethod · 0.95
TestRBACFunction · 0.80
TestRBACOldFunction · 0.80

Calls 6

NewClientMethod · 0.95
CreateOrUpdateUserMethod · 0.80
ContextMethod · 0.65
IssueUserAuthTokenMethod · 0.65
StringMethod · 0.65
TokenMethod · 0.65

Tested by 2

TestRBACFunction · 0.64
TestRBACOldFunction · 0.64