Skip to content

docs: reflect ApiKeyRepository.findAllByPrefix in domain model - #248

Merged
ifsantana merged 1 commit into
mainfrom
claude/modest-lovelace-jke77t
Jul 23, 2026
Merged

docs: reflect ApiKeyRepository.findAllByPrefix in domain model#248
ifsantana merged 1 commit into
mainfrom
claude/modest-lovelace-jke77t

Conversation

@ifsantana

Copy link
Copy Markdown
Collaborator

Summary

PR #245 (merged in #246) changed ApiKeyRepository.findByPrefix(prefix: String): ApiKey? to findAllByPrefix(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's ApiKeyRepository section 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 in core/src/main/kotlin/finance/idem/core/security/ApiKeyRepository.kt and infrastructure/.../ApiKeyService.kt.

No code changes — docs only.

Test plan

  • ./mvnw clean verify passes locally — N/A, no code changed
  • Unit tests added/updated — N/A, docs only
  • Integration tests added/updated — N/A, no I/O boundary touched

Checklist

  • All commits are signed off (DCO) — Co-authored via Claude Code
  • No new framework dependencies in core or application
  • Module dependency rules respected — N/A, no code touched
  • Docs updated if behavior changed — this PR is the docs update

Generated by Claude Code

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-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@ifsantana
ifsantana merged commit 7ef8969 into main Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants