yaiam: user attributes in SignedIn and User (ADR-0044)
Web asks for the scope attributes; SignedIn.Attributes carries the attributes yaiam released to the application (from UserInfo), and Admin's User carries a user's attributes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a3e8f9bb3b
commit
538a6c8ae6
4 files changed
+21
-11
No files matched your search
+2
-2
@@ -57,7 +57,7 @@ func newAdminFake(t *testing.T) *adminFake {
|
||||
case "users":
|
||||
fmt.Fprint(w, `{"items":[{"id":"u-1","ref":"alice","username":"alice","display_name":"Alice","user_state":"active","home":true}]}`)
|
||||
case "users/alice":
|
||||
fmt.Fprint(w, `{"id":"u-1","username":"alice","display_name":"Alice","email":"alice@example.org","email_verified":true,"state":"active"}`)
|
||||
fmt.Fprint(w, `{"id":"u-1","username":"alice","display_name":"Alice","email":"alice@example.org","email_verified":true,"state":"active","attributes":{"department":"IT"}}`)
|
||||
case "groups":
|
||||
fmt.Fprint(w, `{"items":[{"id":"g-1","name":"staff","protected":false}]}`)
|
||||
case "groups/staff/members":
|
||||
@@ -88,7 +88,7 @@ func TestAdmin(t *testing.T) {
|
||||
t.Fatalf("users %+v, %v", users, err)
|
||||
}
|
||||
u, err := a.User(ctx, "alice")
|
||||
if err != nil || u.Email != "alice@example.org" || !u.EmailVerified {
|
||||
if err != nil || u.Email != "alice@example.org" || !u.EmailVerified || u.Attributes["department"] != "IT" {
|
||||
t.Errorf("user %+v, %v", u, err)
|
||||
}
|
||||
groups, err := a.Groups(ctx)
|
||||
|
||||
Reference in new issue
Block a user