Skip to content

fix(keys): validate expiry at SQL timestamp precision - #54

Merged
drewstone merged 1 commit into
mainfrom
fix/scoped-expiry-storage-precision
Sep 12, 2026
Merged

drewstone merged 1 commit into
mainfrom
fix/scoped-expiry-storage-precision

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

A scoped key expiring within the current second could pass issuance, then become already expired when the SQL store rounded its timestamp. Compare required expiry at whole-second precision before storage. Optional legacy expiry remains unchanged.

Validation: actual SQL-store regression fails against the predecessor and passes after the fix; typecheck, all 524 tests and build pass. Regression checks both rejected subsecond expiry with no stored row and accepted next-second expiry that remains future after persistence.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-12T15:15:34.142432Z 2434428 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@drewstone

Copy link
Copy Markdown
Contributor Author

Independent review of exact243442852aac717f7d6d836b93d8d8bf6e83f298: no blocking finding. The future-expiry check now compares at the SQL store's whole-second precision, after existing invalid-date validation and hashing, before storage. It preserves optional expiry for legacy scopes and introduces no minimum TTL. The real SqlApiKeyStore regression distinguishes an expiry within the already-current stored second from the next future stored second, with rejected-row and persisted-value checks. I independently ran both api-key-store-sql and api-keys tests under Node22.22.2; exit0. Receipt /tmp/gateway-expiry-precision-root-review.log. This validates serialization precision, not a guarantee against arbitrary storage latency consuming an intentionally near expiry.

@tangletools tangletools left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Independent exact2434428 review receipt: #54 (comment). Checked SQL timestamp precision, preserved legacy optional expiry, absence of a new minimum TTL, and actual SQL persistence regression. Independent 60 issuer and SQL tests passed. No blocking finding.

@drewstone
drewstone merged commit 6893f3d into main Sep 12, 2026
3 checks passed
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