Repository navigation
feat(auth): 接入阿里云 OAuth 登录与预发控制面隔离 (prepare 2.16.0) - #354
Open
lishengzxc wants to merge 16 commits into
Open
lishengzxc wants to merge 16 commits into
lishengzxc wants to merge 16 commits into
Conversation
…lation - add `bl auth --login aliyun` PKCE loopback flow (/oauth/callback), token -> STS exchange (PascalCase/camelCase compatible) -> GenerateCLIAccessToken -> loginInfo, with three-branch auto renewal - store OAuth sessions as private plaintext files (0600 + atomic write, Windows private ACL) instead of OS keychain, aligned with aliyun-cli - add BAILIAN_PRE control-plane switch: isolated pre/control-pre.json profiles with control_environment guard, verified pre endpoints for OAuth/OpenAPI, and hard blocks for unverified management routes
Preserve the upstream CLI exit, request attribution, and AccessKey guide while keeping OAuth and pre-release Console routing isolated.
Recover abandoned locks without rolling back committed credentials, keep route selection aligned with the actual credential, and protect sessions from concurrent logout. Cancel in-flight OAuth requests promptly and show only valid pre-release recovery steps.
Stop retries when their credential binding changes, including while a new token is in flight. Preserve legacy lock files rather than risking removal of a lock owned by an older writer.
Accept pasted callbacks without a local listener and protect interactive input. Keep OAuth diagnostics parseable in JSON mode and preserve help and required-flag behavior for commands with subcommands.
… site support Replace the beta-only `bl auth --login aliyun` root entry with a fourth login mode `bl auth login --oauth`, aligned with --console/--open-api. --console-site selects domestic/international; --console-region only sets the saved console_region and Console routing while OAuth endpoints follow the site alone. International pre-release ships the approved client ID with placeholder endpoints that block live login until confirmed; international production stays hard-blocked. Session fingerprints now include the console site, so existing beta sessions re-login once.
… E2E harness The commands E2E harness (subprocess and in-process) now resolves BAILIAN_PRE like the product entrypoint; previously pre-release cases silently ran against the online branch. Adds loginPlan quadrant coverage (domestic/international x pre/online), region override isolation, cross-site re-login rejection, profile parse compatibility and refresh-target tests.
… status Update README copies, the auth-change agent guide and regenerated skill references for the new OAuth entry, site/region semantics, the confirmed international pre-release application and the pending endpoint group.
…e endpoints signin/oauth come from the IMS open docs; console origin/gateway match inner-console-call pre.singapore. The two OpenAPI hosts stay unconfirmed, so live international pre-release login remains gated.
…h recovery Restore workspace init to auth:none with explicit AK flags while keeping pre-release gateway routing; add tolerateInvalidOAuth recovery reads so a corrupted aliyun_oauth block no longer bricks logout/re-login/config set; drop the unverified 30-day console session claim from auth login --oauth.
- Route pre-release OpenAPI hosts by the OAuth profile site so international pre no longer resolves to domestic endpoints - Revoke the previous refresh token best-effort on relogin; logout stays local-first and warns instead of blocking when revoke fails offline - Scale session-lock wait budget with the operation timeout (two serial exchanges plus headroom, 30s floor) - Pre dry-run marks an explicit --console-gateway unverified when the env gateway is unset; configured gateways still must match the trusted value - Redact reflected refresh tokens in revoke failures across raw, percent-encoded and form-encoded forms - Cover the new contracts, lock-wait budget and the 16KB manual-callback boundary in tests
…ional login Embed the production IAM client IDs and signin/oauth endpoints for both sites so a first online login needs no endpoint flags; --client-id and --authorization-url become optional overrides. Drop the international online usage block (app approved, same client ID as pre-release); the pre-release endpoint gates stay unchanged. Update unit/e2e contracts, bilingual READMEs, the auth-change guide and the skill reference.
This branch has not been deployed
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
bl auth --login aliyun:使用 PKCE 和本机回调完成授权,置换 STS,并复用同一会话为 OpenAPI 和 Console 提供凭据与自动续期。会话保存在权限受限、原子写入的本地文件中。BAILIAN_PRE国内控制面开关,隔离预发 Profile、凭据和路由;未验证的预发路由不回退到线上。DashScope 推理、MCP 管理和云端 Skill 保留原路由。Test plan
vp check与工作区各发布包构建通过。130;旧格式锁保留且不写配置。