Skip to content

feat: Cloudflare Workers support and IMS token exchange#16

Draft
shsteimer wants to merge 2 commits intomainfrom
refactor/remove-dev-tools
Draft

feat: Cloudflare Workers support and IMS token exchange#16
shsteimer wants to merge 2 commits intomainfrom
refactor/remove-dev-tools

Conversation

@shsteimer
Copy link
Collaborator

@shsteimer shsteimer commented Feb 25, 2026

Summary

  • Refactors all tools from static objects to factory functions for per-request token threading (worker.jscreateServer(token)registerTools(server, token) → tool closures)
  • Adds worker.js and server.js for Cloudflare Workers deployment alongside existing stdio mode
  • Adds IMS token exchange support: when running behind the AEM API router, auto-detects IMS tokens (JWT format) and exchanges them for site-scoped Helix tokens via /auth/adobe/exchange
  • Removes dev tools (docs search, block collection) superseded by adobe/skills

Token resolution

resolveHelixToken(token, org, site, ref) in utils.js auto-detects token type by string inspection:

  • hlxtst_* → site token, pass through
  • xxx.yyy.zzz (JWT) → IMS token, exchange via Admin API
  • Otherwise → admin API key, pass through

Resolution happens lazily in each tool handler (not in helixAdminRequest) because the exchange requires org/site/ref which are only available from tool arguments.

Test plan

  • npm run lint passes
  • npm test passes (10 tests covering token resolution)
  • Verify existing admin API key flow unchanged (passthrough)
  • Verify stdio mode still works with env var tokens
  • Verify IMS token exchange with AEM API router
  • Verify public site handling (empty exchange response → null token)

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

shsteimer and others added 2 commits February 25, 2026 09:42
Remove aem-docs-search and block-collection tools. These capabilities
are now provided by adobe/skills (docs-search, block-inventory, and
block-collection-and-party skills).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Refactor tools to factory pattern for per-request token threading
- Add worker.js and server.js for Cloudflare Workers deployment
- Add IMS token exchange for AEM API router integration
- Add vitest and initial test coverage for token resolution

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@shsteimer shsteimer marked this pull request as draft February 25, 2026 19:07
@shsteimer shsteimer changed the title refactor: remove dev tools superseded by adobe/skills feat: Cloudflare Workers support and IMS token exchange Feb 25, 2026
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