Repository navigation
feat(token-manager): add structured endpoint acquisition - #1462
Samarth Mukhija (Samearth17) wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Request and response boundary validation can currently produce unintended 500 or TypeError failures.
2 open findings
What changed in this PR
Adds typed Azure AI Foundry endpoint acquisition while preserving raw key compatibility.
Changes:
- Adds shared endpoint contracts and client support.
- Exposes and tests structured endpoint acquisition.
- Migrates the API consumer and updates architecture documentation.
| File | Description |
|---|---|
packages/shared/src/token-manager/types.ts |
Defines endpoint contracts. |
packages/shared/src/token-manager/client.ts |
Adds acquireEndpoint(). |
packages/shared/src/token-manager/client.test.ts |
Tests client behavior. |
apps/token-manager/src/routes.ts |
Adds endpoint acquisition route. |
apps/token-manager/src/endpoint-routes.test.ts |
Tests route behavior and compatibility. |
apps/api/src/llm-token.ts |
Consumes structured credentials. |
apps/api/src/llm-token.test.ts |
Tests Foundry client acquisition. |
docs/architecture/token-manager.md |
Documents endpoint storage and API. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
Update type assertion for request body to allow null or undefined. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Implemented both Copilot boundary-validation findings and merged current upstream/main normally.
Validation:
The repository currently declares package lint scripts but does not declare/install ESLint, so local lint could not run (eslint: command not found). No force-push was used. Head: fdcea21. |
…-endpoints # Conflicts: # apps/token-manager/src/routes.ts
|
Merged current Validation on head
The package lint scripts still cannot run because the repository does not declare/install an |

Summary
TokenManagerClient.acquireEndpoint()POST /api/v1/endpoints/acquireas a typed projection over existing validazure-ai-foundrykeysValidation
vitestfocused endpoint/client/consumer tests: 26 passedshared,telemetry,token-manager, andapigit diff --checkThe repository's package lint scripts currently invoke
eslint, but no ESLint package or configuration is declared in the checked-in workspace, so that command could not start locally (eslint: command not found). CI remains the authoritative lint check.This contribution was developed with AI assistance and reviewed/tested by the contributor.
Closes #912