MCPcopy Create free account
hub / github.com/authorizerdev/authorizer / seedUser

Function seedUser

internal/integration_tests/admin_users_grpc_test.go:58–72  ·  view source on GitHub ↗

seedUser inserts a deterministic basic-auth user directly via storage and returns its id and email. Used by the admin user RPC tests.

(t *testing.T, ts *testSetup)

Source from the content-addressed store, hash-verified

56// seedUser inserts a deterministic basic-auth user directly via storage and
57// returns its id and email. Used by the admin user RPC tests.
58func seedUser(t *testing.T, ts *testSetup) (id, email string) {
59 t.Helper()
60 id = uuid.New().String()
61 email = "admin-users-grpc-" + id + "@authorizer.test"
62 now := int64(1)
63 _, err := ts.StorageProvider.AddUser(context.Background(), &schemas.User{
64 ID: id,
65 Email: refs.NewStringRef(email),
66 SignupMethods: constants.AuthRecipeMethodBasicAuth,
67 Roles: "user",
68 EmailVerifiedAt: &now,
69 })
70 require.NoError(t, err)
71 return id, email
72}
73
74// TestAdminUsersGRPC exercises AuthorizerAdminService.Users over gRPC: the
75// fail-closed contract (no secret → Unauthenticated) and the happy path with a

Callers 8

TestAdminAccessRESTFunction · 0.85
TestAdminUsersRESTFunction · 0.85
TestAdminUsersGRPCFunction · 0.85
TestAdminUserGRPCFunction · 0.85
TestAdminUpdateUserGRPCFunction · 0.85
TestAdminDeleteUserGRPCFunction · 0.85

Calls 3

NewStringRefFunction · 0.92
AddUserMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected