Skip to content

fix(auth): count wrong codes only for requests that exist (review fixes for #1164) - #1171

Merged
HexaField merged 1 commit into
fix/app-token-leakfrom
review-fix/1164-failed-code-attempts
Sep 26, 2026
Merged

HexaField merged 1 commit into
fix/app-token-leakfrom
review-fix/1164-failed-code-attempts

Conversation

@data-bot-coasys

Copy link
Copy Markdown
Contributor

Stacked on #1164. Implements my review 5327106399 on it.

Changes:

Not done:

Tests: cargo test --release -p ad4m-executor --lib with filters _tests:: (518 passed), capabilities:: (25 passed) and events_ws:: (25 passed).

🤖 Generated with Claude Code

agent.generateJwt needs no token, and each made-up request id added an
entry to FAILED_CODE_ATTEMPTS that was never removed.

- A wrong code counts only while the request id has a permitted request.
  A made-up id returns the error and records nothing.
- The entry is removed when the lockout drops the request's codes. The
  call that triggers the lockout returns "Too many wrong codes".
- exception_visible parses ExceptionInfo and matches ExceptionType with no
  `_` arm, so a new type fails to compile until someone decides who sees
  it. Unknown types go to approvers only.
- sync-state-change uses LazyDid, so a socket opened before
  agent.generate() gets sync-state once the DID exists.

Implements review 5327106399 on #1164.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 910249e2-0989-4b7f-82fe-0043363e9d35

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@HexaField
HexaField merged commit c99d55b into fix/app-token-leak Sep 26, 2026
12 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