fix(identity): emit RFC 4122 shaped stable IDs and migrate stored ones

This commit is contained in:
sam committed 2026-10-17 17:16:20 +11:00
1 parent 7ad1788235
commit 6f4c03896a
10 files changed
+97 -9

No files matched your search

+2 -2
View File
@@ -10,7 +10,7 @@ import (
type namedActors struct{ identity.Repository }
func (namedActors) Get(_ context.Context, id identity.IdentityID) (identity.Identity, error) {
if id == "11111111-1111-4111-8111-111111111111" || id == "d898c8c8-47f4-57d6c-945a-2e7dc98ca1c1" {
if id == "11111111-1111-4111-8111-111111111111" || id == "d898c8c8-47f4-5d6c-945a-2e7dc98ca1c1" {
return identity.Identity{ID: id, DisplayName: "Sam"}, nil
}
return identity.Identity{}, identity.ErrNotFound
@@ -20,7 +20,7 @@ func TestAuditActorNames(t *testing.T) {
name := (&Server{Identities: namedActors{}}).actorNames(t.Context())
for _, tc := range []struct{ id, want string }{
{"11111111-1111-4111-8111-111111111111", "Sam"},
{"d898c8c8-47f4-57d6c-945a-2e7dc98ca1c1", "Sam"},
{"d898c8c8-47f4-5d6c-945a-2e7dc98ca1c1", "Sam"},
{"22222222-2222-4222-8222-222222222222", "Unavailable identity"},
{"system:migration", "system:migration"},
} {