Repository navigation
[ANCHOR-1405]: Resolve db-mode client lookups by client type - #2090
Merged
Merged
Conversation
amandagonsalves
approved these changes
Nov 12, 2026
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.
Description
JdbcClientService.getClientConfigBySigningKeynow returns a client only when the row found isCUSTODIAL, andgetClientConfigByDomainonly when it isNONCUSTODIAL. A row of the other type resolves tonull, as in the json store (DefaultClientService).ClientConfigServiceand the migrations are unchanged.getClientConfigByDomainAndAccountcomposes the two lookups and inherits the fix.client_nameattribution and the custodial destination gate for such rows. Release note needed.Context
findBySigningKey/findByDomainreturned, with no type check, whiletoClientConfigandgetCustodialClients()already filter by type.ClientConfigService.validatedoes not stop a non-custodial client from carrying signing keys, destination accounts andallow_any_destination.ClientFinderattributed a caller to a non-custodial client'sclient_namefrom a bare SEP-10 account matching its signing key, without domain proof.SepRequestValidator.validateDestinationAccountopened the custodial-only destination gate from a non-custodial row.Testing
./gradlew test./gradlew :platform:test --tests '*JdbcClientServiceTest*' --tests '*JdbcClientServiceConsumersTest*': the reporter's row (noncustodial, signing key,allowAnyDestination=true) resolves tonullby key, gets noclient_namefrom a bare-account token (optional and required attribution), and does not open the destination gate; custodial rows map as before; reclassifying a row flips both lookups on the next call.JdbcClientService(4 of 5; the fifth is the custodial control)../gradlew spotlessCheckClientsDbsuite (ClientsDbAttributionTests, new case: a non-custodial client with a domain and a signing key gets noclient_namefrom a SEP-10 token for that key). Run locally on the db-mode stack: 6 tests, 0 failures.Documentation
N/A (no feature or public API change).
Known limitations
ClientConfigService.upsert/addSigningKeystill accept a non-custodial client with signing keys and a custodial client with domains. A write-time exclusivity guard would be an API-contract change that can reject configs accepted today.