3.9 KiB
3.9 KiB
Execution Log
T1: Add user_identity migrations + LATEST.sql updates
Status: Completed Files Changed:
- Created:
store/migration/sqlite/0.28/00__user_identity.sql - Created:
store/migration/postgres/0.28/00__user_identity.sql - Created:
store/migration/mysql/0.28/00__user_identity.sql - Modified:
store/migration/sqlite/LATEST.sql - Modified:
store/migration/postgres/LATEST.sql - Modified:
store/migration/mysql/LATEST.sqlValidation: rg 'CREATE TABLE \?user_identity`?' store/migration` — PASS (hits in all 6 expected files).rg 'UNIQUE \(\?provider`?, `?extern_uid`?)' store/migration` — PASS (6 hits).go build ./...— PASS. Path Corrections: None. Deviations: None.
T2: Add store.UserIdentity model, Store methods, and driver interface
Status: Completed Files Changed:
- Created:
store/user_identity.go - Modified:
store/driver.goValidation: - Interface-only build is expected to fail until T3–T5; deferred compile check to T5.
rg 'CreateUserIdentity|ListUserIdentities' store/driver.go store/user_identity.go— PASS (method declarations present in both files). Path Corrections: None. Deviations: None.
T3: Implement SQLite driver for user_identity
Status: Completed Files Changed:
- Created:
store/db/sqlite/user_identity.goValidation: go build ./store/db/sqlite/...— PASS. Path Corrections: None. Deviations: None.
T4: Implement Postgres driver for user_identity
Status: Completed Files Changed:
- Created:
store/db/postgres/user_identity.goValidation: go build ./store/db/postgres/...— PASS. Path Corrections: None. Deviations: None.
T5: Implement MySQL driver for user_identity
Status: Completed Files Changed:
- Created:
store/db/mysql/user_identity.goValidation: go build ./...— PASS (whole repo compiles; all drivers satisfy theDriverinterface). Path Corrections: None. Deviations: None.
T6: Add store-layer tests for user_identity
Status: Completed Files Changed:
- Created:
store/test/user_identity_test.goValidation: DRIVER=sqlite go test ./store/test/ -run TestUserIdentity -count=1 -v— PASS:TestUserIdentityCreateAndGet— PASSTestUserIdentityListByUserID— PASSTestUserIdentityUniqueConflict— PASSTestUserIdentitySameExternUIDDifferentProviders— PASS Path Corrections: None. Deviations: None.
T7: Add SSO username derivation helper
Status: Completed Files Changed:
- Created:
server/router/api/v1/sso_username.goValidation: go build ./server/router/api/v1/...— PASS.go vet ./server/router/api/v1/...— PASS. Path Corrections: None. Deviations: None.
T8: Route SSO sign-in through user_identity linkage
Status: Completed Files Changed:
- Modified:
server/router/api/v1/auth_service.goSignInSSO branch now delegates user resolution to a newresolveSSOUsermethod.resolveSSOUserdoes:user_identitylookup → hit path (load user by linkeduser_id); miss path (registration gate →deriveSSOUsername→ create user → create linkage → race recovery on unique(provider, extern_uid)).- Added
isUserIdentityUniqueViolationhelper (string match on the three backends' unique-constraint error strings, matching the pattern inmemo_service.go:103–105). Validation:
go build ./...— PASS.go vet ./...— PASS.DRIVER=sqlite go test ./store/test/ -run TestUserIdentity -count=1— PASS (regression check). Path Corrections:- The plan pseudocode referenced
identityProvider.UID; the actual protobuf typestorepb.IdentityProviderexposes the field asUid. UsedidentityProvider.Uidin the implementation. No semantic deviation. Deviations: None.
Completion Declaration
All tasks completed successfully.