fix(auth): isolate unsafe account merge flow - #637
Closed
XiaoSeS wants to merge 20 commits into
Closed
Conversation
Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
Signed-off-by: ylhu16 <ylhu16@iflytek.com>
Closes #632 Signed-off-by: ylhu16 <ylhu16@iflytek.com>
Signed-off-by: ylhu16 <ylhu16@iflytek.com>
Signed-off-by: ylhu16 <ylhu16@iflytek.com> # Conflicts: # docs/02-domain-model.md # server/skillhub-auth/src/test/java/com/iflytek/skillhub/auth/identity/IdentityBindingServiceTest.java
|
ylhu16 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Collaborator
Author
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.
What
503 Service UnavailableresponseAccountMergeService, so the old verification-token and destructive migration path is no longer a callable Spring serviceWhy
The legacy initiate route returned the secondary-account verification token to the already-authenticated primary-account session. That same session could verify and confirm the request without independently authenticating as the secondary account. The flow could then migrate bindings, API tokens, platform roles, namespace memberships, and local credentials.
This PR is the P0 containment change. It intentionally does not implement the future dual-reauthentication merge flow.
Closes #634
Parent: #628
How
AccountMergeControllerretains the published paths and request/response schemas for deployed-client compatibility, but no longer delegates to a mutation service. Valid authenticated requests terminate witherror.auth.merge.temporarilyUnavailable. Invalid authentication or CSRF is still rejected by the existing security chain.The legacy JPA entity, repository, schema, and rows remain available for forensics and a future explicit migration. The unsafe orchestration service and its success-path tests are removed. The replacement controller tests assert the stable 503 response and absence of proof/request data.
Testing
AccountMergeControllerTest: 5 tests passedpnpm typecheck: passedpnpm lint: passed./mvnw -pl skillhub-app -am -DskipTests package-Dnet.bytebuddy.experimental=truebecause only Java 25 is installed and the repository's Byte Buddy version officially supports through Java 22ApiTokenAuthenticationFilterTest.shouldIgnoreNonBearerAuthorizationHeaderglobalSecurityContextHolderorder leak; that test passes alone (1/1) and is unrelated to this diffbig-mainand validated in the test environmentImpact
/api/v1/account/merge/*blocked if such a rollback is unavoidablemainuntilbig-mainand test-environment validation are complete