Repository navigation
Re-verify a Cloud licence when the licence site reports a change - #1561
Merged
Merged
Conversation
helpcodeai
enabled auto-merge (squash)
November 6, 2026 14:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1560
What and why
A plan change made in the Stripe billing portal reached a Cloud workspace only at its next daily re-verification. On 6 Nov 2026 a Team upgrade kept Starter limits on Cloud while the licence site already had it on Team: the licence page refresh is throttled to once a minute, and the customer came back from the portal within that minute.
POST /api/license/sync{ licenseKey }: accepts only the licence site's service token (x-amcp-service-token, timing-safe compare againstLICENSE_SERVICE_TOKEN) and re-verifies that key. It carries no licence data, so a forged call can at worst cause one extra check. 404 on self-hosted, without the token or with a wrong one. Only keys bound to a workspace are verified; concurrent calls for one key verify once. Excluded from Swagger.The licence site calls the endpoint from its Stripe webhook (HelpCode-ai/anythingmcp-website, linked PR).
Deployment modes
Tests
In
packages/backend(afternpx prisma generate):npx jest src/license --maxWorkers=4→ 15 suites, 281 tests passed (new: controller token checks, sync service, portal throttle reset)npx tsc --noEmit -p tsconfig.json→ no errorsnpx eslinton the four changed files → no findings