fix(dashboard): allow deleting SCM identities with slash in provider key#156
Merged
coopernetes merged 1 commit intomainfrom Apr 15, 2026
Merged
Conversation
Provider IDs are internally `{type}/{host}` (e.g. `github/github.corp.example.com`).
When embedded in a URL path, the `/` encodes to `%2F` and Spring Security's
default StrictHttpFirewall rejects the request with HTTP 400 before the
controller runs, leaving the user with an unusable "Failed to remove SCM
identity (HTTP 400)" error.
Swap `/` for `@` at the URL boundary only — frontend encodes it on the way
out, controllers decode it on the way in. Internal format (DB, token cache,
permissions, logging) is unchanged. `@` is legal in URL path segments and
never appears in DNS hostnames, so the mapping is unambiguous.
Affects `DELETE /api/me/identities/{provider}/{scmUsername}` and
`DELETE /api/users/{u}/identities/{provider}/{scmUsername}`.
dc51ef7 to
088ef44
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
Failed to remove SCM identity (HTTP 400)when the provider ID contains a/(e.g.github/<host>for a GHES deployment).GitProxyProvider.getProviderId()synthesizes{type}/{host}. When embedded in aDELETEURL path, the/encodes to%2Fand Spring Security's defaultStrictHttpFirewallrejects the request with HTTP 400 before the controller runs — so the store-layerLockedByConfigExceptionpath and hooks never get a chance./↔@at the URL boundary only. Frontend'sproviderToPathKey()encodes/→@on the way out;ProfileController/UserControllerreverse it before calling the user store.@is legal in URL path segments (RFC 3986sub-delims) and never appears in DNS hostnames, so the mapping is unambiguous.user_scm_identities.provider), token cache keys, permissions, and all core code still see{type}/{host}. No migration needed.Affects:
DELETE /api/me/identities/{provider}/{scmUsername}DELETE /api/users/{u}/identities/{provider}/{scmUsername}Also folds in an unrelated
Dockerfiledoc fix (config profile example) and a palantir-format reflow inSecurityConfig.javathat were sitting in the working tree.Test plan
github, non-default host).UserControllerroute) to cover both endpoints.github/github.com) still remove cleanly — ensures the@swap doesn't break the common case.