Skip to content

Conversation

@noahpodgurski
Copy link
Collaborator

What's new

  • Added an alembic appattest DB migration to add counter to public_keys
    for App Attest/Assert replay attack protection
  • Extended ChatRequest/AuthorizedChatRequest flow to carry optional
    mock_response data through completions.
  • Updated mocks and tests to align with the new counter-aware
    behavior and added coverage for replay protection.

UPDATE public_keys
SET counter = $2,
updated_at = NOW()
WHERE key_id_b64 = $1
Copy link
Collaborator

@subpath subpath Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request:
I think this creates race condition 🤔
If there will be 2 parallel requests with the same key_id, then we will have duplicated assertion with the same counter

WHERE key_id_b64 = $1 AND counter < $2

maybe we need this condition? WDYT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me

@noahpodgurski noahpodgurski merged commit 2d0f243 into main Nov 12, 2025
1 check passed
@noahpodgurski noahpodgurski deleted the feat-app-attest-counter branch November 12, 2025 20:21
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.

3 participants