docs: reflect ApiKeyRepository.findAllByPrefix in domain model - #248
Merged
Conversation
PR #245 changed ApiKeyRepository.findByPrefix (single ApiKey?) to findAllByPrefix (List<ApiKey>) since the 12-char prefix is a non-unique index (~65k possible values) and validate() must bcrypt-match the raw key against every live candidate. docs/domain-model.md still documented the old single-result signature and rationale. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019eVnGMWmSr6MjzRg6122xR
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
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
PR #245 (merged in #246) changed
ApiKeyRepository.findByPrefix(prefix: String): ApiKey?tofindAllByPrefix(prefix: String): List<ApiKey>, because the 12-character prefix (sk_live_+ 4 hex chars, ~65k possible values) is a non-unique index by design —ApiKeyService.validate()now bcrypt-matches the raw key against every live candidate sharing a prefix instead of assuming a single row.docs/domain-model.md'sApiKeyRepositorysection still documented the old single-result signature and the old rationale paragraph. This updates the interface snippet and adds a short explanation of why the prefix is non-unique and how disambiguation works, matching the current code incore/src/main/kotlin/finance/idem/core/security/ApiKeyRepository.ktandinfrastructure/.../ApiKeyService.kt.No code changes — docs only.
Test plan
./mvnw clean verifypasses locally — N/A, no code changedChecklist
coreorapplicationGenerated by Claude Code