Skip to content

Improve token shape unit coverage#786

Merged
EffortlessSteven merged 1 commit into
mainfrom
codex/improve-unit-testing-41mfd1
May 17, 2026
Merged

Improve token shape unit coverage#786
EffortlessSteven merged 1 commit into
mainfrom
codex/improve-unit-testing-41mfd1

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Motivation

  • Strengthen unit test coverage for token-shape generators to guard against regressions in negative-token mutations and preserve scanner-safety semantics.
  • Ensure negative fixtures are surgically-targeted (e.g., only exp changes for expired claims) so downstream parsers/validators see realistic, localized failures.
  • Lock deterministic near-miss API-key behavior so suffix derivation is consistent across token kinds.

Description

  • Added focused unit tests in crates/uselesskey-token/src/srp/shape.rs that assert expired OAuth negative tokens preserve header/signature context and only replace the exp claim.
  • Added tests that validate BadIssuer and BadAudience negative variants preserve unrelated claims such as sub and the remaining expected claims.
  • Added a test for NearMissApiKey that verifies the near-miss prefix is used and the deterministic suffix matches the valid API-key suffix across ApiKey, Bearer, and OAuthAccessToken shapes.

Testing

  • Ran cargo test -p uselesskey-token srp::shape::tests and all tests passed (22 passed; 0 failed).
  • Re-ran the same test target after minor formatting adjustments and the suite remained green (22 passed; 0 failed).

Codex Task

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented May 17, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@EffortlessSteven has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 34 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 85a0a227-7d23-4e94-b3d2-29e73afe1d7b

📥 Commits

Reviewing files that changed from the base of the PR and between a87e2d4 and fe9cd1b.

📒 Files selected for processing (1)
  • crates/uselesskey-token/src/srp/shape.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/improve-unit-testing-41mfd1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@EffortlessSteven EffortlessSteven merged commit 5c2e381 into main May 17, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant