Skip to content

chore: add warning logs on RPC auth fiascos - #6468

Merged
LesnyRumcajs merged 1 commit into
mainfrom
auth-layer-logs
Jan 22, 2026
Merged

chore: add warning logs on RPC auth fiascos#6468
LesnyRumcajs merged 1 commit into
mainfrom
auth-layer-logs

Conversation

@LesnyRumcajs

@LesnyRumcajs LesnyRumcajs commented Jan 22, 2026

Copy link
Copy Markdown
Member

Summary of changes

Changes introduced in this pull request:

  • added better logs on authorization errors. Currently, providing a completely invalid JWT token just returns InvalidRequest without any indication what is wrong. This should help pinpoint issues in the future, while also facilitating any SIEM systems or whatnot to detect breach attempts.

Reference issue to close (if applicable)

Closes

Other information and links

Change checklist

  • I have performed a self-review of my own code,
  • I have made corresponding changes to the documentation. All new code adheres to the team's documentation standards,
  • I have added tests that prove my fix is effective or that my feature works (if possible),
  • I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.

Summary by CodeRabbit

  • Chores
    • Improved system observability with enhanced logging for authentication validation events, enabling better error tracking and system diagnostics.

✏️ Tip: You can customize this high-level summary in your review settings.

@LesnyRumcajs
LesnyRumcajs requested a review from a team as a code owner January 22, 2026 16:53
@LesnyRumcajs
LesnyRumcajs requested review from hanabi1224 and sudo-shashank and removed request for a team January 22, 2026 16:53
@coderabbitai

coderabbitai Bot commented Jan 22, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

The authorization layer now emits warning-level logs when permission checks fail or return errors, capturing the method name and error details. The control flow and returned errors remain unchanged; only tracing side effects are added.

Changes

Cohort / File(s) Summary
Authorization logging enhancement
src/rpc/auth_layer.rs
Added warning-level logging in Auth::authorize when permission checks deny access (returns Ok(false)) or when authorization errors occur, including method name and error code details

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested labels

RPC

Suggested reviewers

  • hanabi1224
  • sudo-shashank
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: add warning logs on RPC auth fiascos' accurately describes the main change: adding warning logging to the authorization layer. It is concise, specific, and clearly relates to the core modification in auth_layer.rs.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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

@LesnyRumcajs
LesnyRumcajs added this pull request to the merge queue Jan 22, 2026
@codecov

codecov Bot commented Jan 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.71%. Comparing base (1546c7c) to head (0b24d75).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/rpc/auth_layer.rs 0.00% 9 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/rpc/auth_layer.rs 56.81% <0.00%> (-1.33%) ⬇️

... and 10 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1546c7c...0b24d75. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Merged via the queue into main with commit df984d8 Jan 22, 2026
57 of 58 checks passed
@LesnyRumcajs
LesnyRumcajs deleted the auth-layer-logs branch January 22, 2026 18:20
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