Skip to content

refactor: use Effect config for HttpApi authorization#25035

Merged
kitlangton merged 11 commits into
devfrom
auth-config-provider
Apr 30, 2026
Merged

refactor: use Effect config for HttpApi authorization#25035
kitlangton merged 11 commits into
devfrom
auth-config-provider

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

@kitlangton kitlangton commented Apr 30, 2026

Summary

  • Add a reusable ConfigService.Service helper that turns Effect Config definitions into a typed Context service with generated defaultLayer and test layer(...) helpers.
  • Define ServerAuthConfig with the new helper so env var names/defaults live in one Effect Config definition.
  • Update authorization tests to provide typed auth config directly instead of mutating Flag or constructing env-shaped config providers.

Tests

  • bunx prettier --write packages/opencode/src/effect/config-service.ts packages/opencode/src/server/routes/instance/httpapi/middleware/authorization.ts packages/opencode/src/server/routes/instance/httpapi/server.ts packages/opencode/test/server/httpapi-authorization.test.ts
  • bunx oxlint packages/opencode/src/effect/config-service.ts packages/opencode/src/server/routes/instance/httpapi/middleware/authorization.ts packages/opencode/src/server/routes/instance/httpapi/server.ts packages/opencode/test/server/httpapi-authorization.test.ts
  • bun typecheck from packages/opencode
  • bun run test -- test/server/httpapi-authorization.test.ts
  • bun run test -- test/server/httpapi-authorization.test.ts test/server/httpapi-instance-context.test.ts test/server/httpapi-workspace-routing.test.ts test/server/workspace-proxy.test.ts
  • push hook: bun turbo typecheck

@kitlangton kitlangton enabled auto-merge (squash) April 30, 2026 02:09
@kitlangton kitlangton disabled auto-merge April 30, 2026 02:22
@kitlangton kitlangton merged commit cee9610 into dev Apr 30, 2026
9 checks passed
@kitlangton kitlangton deleted the auth-config-provider branch April 30, 2026 02:22
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