feat(cloudflare): respect explicit APP_PID for umbrella-registered instances#491
Open
xiaomoziyi wants to merge 2 commits intomasterfrom
Open
feat(cloudflare): respect explicit APP_PID for umbrella-registered instances#491xiaomoziyi wants to merge 2 commits intomasterfrom
xiaomoziyi wants to merge 2 commits intomasterfrom
Conversation
…stances When an instance has been pre-registered out-of-band with an umbrella PID (e.g. staging-aigne-hub-media-kit, which shares the Payment Kit umbrella SK+PSK), auto-registration would otherwise overwrite the canonical PID with a fresh SK-derived DID on first request. Respect an explicit APP_PID binding in ensureRegistered and short-circuit before calling registerApp, so the canonical PID is preserved. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2bdbeac to
4946c9f
Compare
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
ensureRegistered里如果存在env.APP_PID,直接把它作为 instance DID 返回,跳过AUTH_SERVICE.registerApp的自动注册逻辑。场景:staging-aigne-hub-media-kit 这种使用 umbrella SK+PSK 预注册的实例,canonical PID 已经在外部注册好,不应该被请求期的 auto-register 用 SK 派生出来的 DID 覆盖。
Behavior
APP_PIDAUTH_SERVICE+APP_SKregisterApp自动注册,缓存返回的 instanceDidAPP_PID,不调registerAppTest plan
[media-kit] Registered as instance: ...— 走的是 explicit PID 短路分支GET /api/status返回的instanceDid等于APP_PIDAPP_PID)auto-register 行为保持不变🤖 Generated with Claude Code