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)
| 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. |
| 58 | func 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 |
no test coverage detected