Conversation
…lidator-wall-of-shame Restore validator Wall of Shame
…h-session-key Remove session key from auth responses
* Hide non-visible operators from public validator endpoints The public Wall of Shame and validator wallet endpoints surfaced the linked operator's profile identity (name, address, id, avatar) even for users who set their profile to non-visible, which contradicted the rest of the API where hidden users are not enumerable. Operator identity is now withheld whenever the linked user is not visible; the validator still appears, identified only by its on-chain operator address, so a misbehaving node cannot disappear by toggling visibility. Two production safeguards are also tightened: session and CSRF cookies are marked Secure outside DEBUG, and the wallet login endpoint no longer echoes raw exception details to clients in production. ## Claude Implementation Notes - backend/validators/serializers.py: Gate operator_user on user.visible in ValidatorWalletSerializer and WallOfShameSerializer. - backend/validators/views.py: Gate the grouped Wall of Shame _operator_user_payload on user.visible. - backend/tally/settings.py: Set SESSION_COOKIE_SECURE and CSRF_COOKIE_SECURE to not DEBUG so cookies are HTTPS-only in production. - backend/ethereum_auth/views.py: Log the exception and return a generic auth-failure message when DEBUG is off; keep full detail in DEBUG. - backend/validators/tests/test_grafana_service.py: Add regression test that a non-visible operator's identity is withheld while the validator still appears. * Update changelog
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
frontend/src/components/Sidebar.svelte (1)
716-755:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winMissing Wall of Shame link in mobile sidebar.
The desktop validators submenu (lines 317-325) includes the new Wall of Shame link, but the mobile validators submenu (lines 716-755) does not. This creates an inconsistent navigation experience where mobile users cannot access the Wall of Shame page through the sidebar.
📱 Proposed fix to add Wall of Shame link to mobile sidebar
Participants </a> + <a + href="/validators/wall-of-shame" + onclick={(e) => { e.preventDefault(); navigate('/validators/wall-of-shame'); }} + class="flex items-center border-l-[1.5px] px-3 py-2 text-[14px] font-medium text-black tracking-[0.28px] { + isActive('/validators/wall-of-shame') ? 'border-[`#387DE8`]' : 'border-[`#f5f5f5`]' + }" + > + Wall of Shame + </a> <a href="/validators/waitlist" onclick={(e) => { e.preventDefault(); navigate('/validators/waitlist'); }}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/src/components/Sidebar.svelte` around lines 716 - 755, The mobile validators submenu (the block guarded by getActiveSection() === 'validator') is missing the "Wall of Shame" link; add an <a> element matching the other mobile validator links using href "/validators/wall-of-shame", onclick handler that prevents default and calls navigate('/validators/wall-of-shame'), and the same class logic that uses isActive('/validators/wall-of-shame') ? 'border-[`#387DE8`]' : 'border-[`#f5f5f5`]'; place this new anchor alongside Contributions, Leaderboard, Participants, and Waitlist in the same div so mobile and desktop submenus are consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@backend/api/metrics_views.py`:
- Line 22: Remove the explicit AllowAny overrides so the global IsAuthenticated
setting applies: locate the occurrences of the class attribute
permission_classes = [permissions.AllowAny] in backend/api/metrics_views.py
(there are four instances around the shown lines) and delete those lines (or
replace them with no permission_classes attribute) so the views no longer bypass
authentication; ensure you remove the exact attribute assignment to enforce the
global default.
In `@backend/contributions/migrations/0037_seed_featured_content.py`:
- Around line 39-103: The seed migration uses
FeaturedContent.objects.update_or_create(content_type=..., title=...) but the
model lacks a uniqueness constraint, risking MultipleObjectsReturned; add a
DB-level uniqueness constraint on (content_type, title) by updating the
FeaturedContent model (Meta.unique_together or Meta.constraints with
models.UniqueConstraint) and then create/apply a new migration so the database
enforces uniqueness; alternatively, if you prefer not to change the schema,
modify the migration 0037_seed_featured_content.py to use a truly-unique lookup
field (e.g., a unique slug or id) instead of content_type+title and ensure any
pre-existing duplicate rows are resolved before applying the constraint.
In `@backend/poaps/views.py`:
- Around line 325-330: The action decorated endpoint currently sets
permission_classes=[permissions.AllowAny], which exposes user-linked POAP claim
history; remove that explicit AllowAny and let the global authentication default
apply (i.e., delete the permission_classes argument) or replace it with an
appropriate restrictive permission such as permissions.IsAuthenticated or a
project-specific permission that prohibits unauthenticated access; update the
action decorator on the view method (the `@action`(...) for the
by-address/(?P<address>...)/poaps route in the POAP viewset) accordingly so the
endpoint no longer bypasses global auth.
In `@backend/projects/migrations/0002_ensure_project_participants_table.py`:
- Around line 4-12: The migration function ensure_project_participants_table
currently looks like it's adding a missing M2M definition, but Project in
0001_initial already defines the participants ManyToManyField; update the 0002
migration to clarify this by adding a short comment/docstring above
ensure_project_participants_table explaining that this migration is a defensive
idempotent safeguard (it inspects through_model = Project.participants.through
and table_name and only creates the table if missing) and that any missing table
should be investigated via migration history/state rather than treating
0001_initial as incomplete; keep the existing logic (table existence check and
schema_editor.create_model(through_model)) but add the explanatory note
referencing ensure_project_participants_table, Project.participants, and
through_model so future readers know why this guard exists.
In `@frontend/src/routes/WallOfShame.svelte`:
- Around line 281-284: The click handler currently calls
navigator.clipboard.writeText(...) but immediately calls showSuccess('Address
copied to clipboard!') without awaiting or handling failures; update the onclick
handler used in WallOfShame.svelte to await
navigator.clipboard.writeText(validator.operator_address || '') inside a
try/catch, call showSuccess only on successful resolution, and call an error
notifier (e.g., showError or a fallback alert) inside the catch block to surface
failures—reference the onclick handler, navigator.clipboard.writeText, and
showSuccess to locate and modify the code.
---
Outside diff comments:
In `@frontend/src/components/Sidebar.svelte`:
- Around line 716-755: The mobile validators submenu (the block guarded by
getActiveSection() === 'validator') is missing the "Wall of Shame" link; add an
<a> element matching the other mobile validator links using href
"/validators/wall-of-shame", onclick handler that prevents default and calls
navigate('/validators/wall-of-shame'), and the same class logic that uses
isActive('/validators/wall-of-shame') ? 'border-[`#387DE8`]' : 'border-[`#f5f5f5`]';
place this new anchor alongside Contributions, Leaderboard, Participants, and
Waitlist in the same div so mobile and desktop submenus are consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 51f02e31-f3d5-40a0-bb68-c7d937077c49
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (32)
CHANGELOG.mdbackend/CLAUDE.mdbackend/api/metrics_views.pybackend/contributions/migrations/0037_seed_featured_content.pybackend/contributions/migrations/0051_zero_validator_waitlist_points.pybackend/contributions/tests/test_highlights_api.pybackend/contributions/tests/test_is_submittable.pybackend/contributions/tests/test_public_explorer_filters.pybackend/contributions/tests/test_submission_limits.pybackend/contributions/views.pybackend/ethereum_auth/tests.pybackend/ethereum_auth/views.pybackend/leaderboard/tests/test_stats.pybackend/leaderboard/views.pybackend/poaps/tests/test_poaps.pybackend/poaps/views.pybackend/projects/migrations/0002_ensure_project_participants_table.pybackend/tally/settings.pybackend/users/tests/test_email_security.pybackend/users/views.pybackend/validators/grafana_service.pybackend/validators/migrations/0013_validatorwallet_shame_started_at.pybackend/validators/models.pybackend/validators/serializers.pybackend/validators/tests/test_grafana_service.pybackend/validators/views.pyfrontend/src/App.sveltefrontend/src/components/Navbar.sveltefrontend/src/components/Sidebar.sveltefrontend/src/routes/Metrics.sveltefrontend/src/routes/Overview.sveltefrontend/src/routes/WallOfShame.svelte
…erabbit-pr-729 Address CodeRabbit review feedback
Summary by CodeRabbit
New Features
Security & Access