Skip to content

refactor(auth): effectify AuthService#17212

Merged
kitlangton merged 5 commits intodevfrom
effect-auth-foundation
Mar 13, 2026
Merged

refactor(auth): effectify AuthService#17212
kitlangton merged 5 commits intodevfrom
effect-auth-foundation

Conversation

@kitlangton
Copy link
Contributor

@kitlangton kitlangton commented Mar 12, 2026

Summary

  • extract a real AuthService so auth file I/O and key normalization live in an Effect-native core while the Auth facade stays stable for callers
  • model auth entries with Effect Schema internally while keeping the existing Zod-based Auth facade at the boundary for current validators and callers
  • extend the shared migration runtime to provide both AccountService and AuthService during the transition

Move auth file I/O and key normalization into an Effect service so auth can migrate like account while the existing Auth facade stays stable for callers. Document the broader Effect rollout and instance-state migration strategy to guide follow-on extractions.
Model auth entries with Effect Schema inside AuthService and use Schema decoding when reading persisted auth data. Keep the Auth facade on Zod at the boundary so existing validators and callers stay stable during the migration.
Use Effect Record.filterMap to keep the existing permissive auth-file semantics while making the decode path easier to read. Add service method docs that explain key normalization and why old trailing-slash variants are removed during writes.
@kitlangton kitlangton marked this pull request as ready for review March 12, 2026 18:33
Remove the draft migration plan from the auth foundation branch and keep it excluded locally instead of shipping it in the PR.
Drop the temporary auth service method comments now that the key normalization behavior has been reviewed.
@kitlangton kitlangton changed the title refactor(auth): extract AuthService refactor(auth): effectify AuthService Mar 12, 2026
@kitlangton kitlangton merged commit 0a281c7 into dev Mar 13, 2026
10 checks passed
shellmind112 pushed a commit to shellmind112/opencode that referenced this pull request Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant