Skip to content

refactor(api_tokens): follow the module layout (moves only) - #845

Merged
antosubash merged 2 commits into
mainfrom
refactor/layout-api-tokens
Nov 5, 2026
Merged

antosubash merged 2 commits into
mainfrom
refactor/layout-api-tokens

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Summary

  • Moves-only restructure of api_tokens to docs/module-layout.md (same pattern as refactor(keycloak): follow the module layout (moves only) #838 keycloak and refactor(oidc): follow the module layout (moves only) #841 oidc): constants/settings/services/tenant_cleanup/user_cleanup go to core/; tokens.py becomes credentials/format.py and scopes/owner/service/resolver/audit go to credentials/ (added to DOMAIN_AREAS); deps and endpoints go to web/; page components and types.ts go to ui/ (pages/api.ts and api.generated.ts stay); tests mirror the areas.
  • api_tokens.{constants,service,resolver,tokens} stay as deprecated sys.modules aliases (remove_in 0.0.46).
  • Second commit pins the durable cleanup handler names to their pre-move paths (api_tokens.tenant_cleanup.purge_tenant_data, api_tokens.user_cleanup.purge_user_tokens), as fix(feature_flags,sharing): keep durable handler names stable across the layout move #843 did for feature_flags/sharing; host/tests/test_durable_wire_names.py checks them.
  • No logic changes. Known side effect: the resolver logger name is now api_tokens.credentials.resolver (same as the other layout moves).

Verification

  • Browser smoke on SQLite: personal tokens page and admin tokens page load, a token can be created, the "Copy your new token" dialog shows, no console errors.
  • Local: make lint, make doctor (0 errors), ci-api-types-fresh, ci-i18n-fresh, ci-css-build, ci-docs-build, make test-py (7876 passed, 45 skipped), make test-js all green.
  • Alias identity (api_tokens.tokens is api_tokens.credentials.format) and -W error::DeprecationWarning import of the module, resolver and API endpoints pass.

Test plan

  • CI is green
  • Open /api-tokens/ and /admin/api-tokens/, create a token, confirm the created-token dialog

https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq

constants, settings, services and the cleanup hooks move to
api_tokens/core/; the token format (tokens.py, now credentials/format.py),
scopes, owner, service, resolver and audit naming to
api_tokens/credentials/; deps and endpoints to api_tokens/web/; the page
components and types to ui/. Tests mirror the areas.
api_tokens.{constants,service,resolver,tokens} stay as deprecated aliases
until 0.0.46.

Claude-Session: https://claude.ai/code/session_01FXHA3ZicrtZ4C5QPEgxfgq
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Deploying simple-module-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: ec151a2
Status: ✅  Deploy successful!
Preview URL: https://4bd5e996.simple-module-python.pages.dev
Branch Preview URL: https://refactor-layout-api-tokens.simple-module-python.pages.dev

View logs

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-11-05T18:47:16.638075Z ec151a2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@antosubash
antosubash merged commit 18ab453 into main Nov 5, 2026
17 checks passed
@antosubash
antosubash deleted the refactor/layout-api-tokens branch November 5, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant