Skip to content

fix(history): owners see changes to their account, not an administrator's views - #346

Merged
PiquelChips merged 2 commits into
mainfrom
fix/hide-account-view-event
Nov 4, 2026
Merged

PiquelChips merged 2 commits into
mainfrom
fix/hide-account-view-event

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

Whenever an administrator opened an account, the owner's security history showed "Account details viewed". A view tells the owner nothing they can act on, and it may be a misclick or an inquiry they shouldn't know about. Owners should see changes, each with its reason, not what an administrator looked at.

Now DomainEvent::history_entry hides AccountViewed, so views disappear from the history page, the overview's security-event count and the data export. Views are still recorded in the audit log and still show on the admin dashboard's events and in Grafana.

Proved with the auth-service history, view, export and overview database tests on a scratch cluster (13/13 pass) and clean clippy. The pagination test now records a view before an admin change and checks that only the change shows.

Reviewed with review-loop: 1 round with 2× GPT-6.1 Sol and Claude Opus 5.5. Verdict: approved

Note

Written by Claude Opus 5.5 in Claude Code and reviewed by GPT-6.1 Sol and Claude Opus 5.5 (via T3 Code)

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 57 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 80b7294f-4d8b-451d-9b37-2673809ece8b
Commits

Reviewing files that changed from the base of the PR and between fef4422 and 134a1aa.

Files selected for processing: 7
  • README.md
  • apps/auth-service/src/history/mod.rs
  • apps/auth-service/src/history/tests.rs
  • crates/common/src/events/mod.rs
  • crates/ui/src/settings/timeline.rs
  • docs/architecture/database-crate.md
  • docs/architecture/surfaces.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@PiquelChips PiquelChips self-assigned this Nov 4, 2026
@PiquelChips PiquelChips added bug Something isn't working security Anything security related apps/auth-service Origin Auth at auth.sourceorigin.dev, its settings and developer console, and the operator CLI labels Nov 4, 2026
@PiquelChips PiquelChips added this to the 0.1 milestone Nov 4, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in sourceorigin.dev Nov 4, 2026
@PiquelChips PiquelChips moved this from Needs Triage to In Progress in sourceorigin.dev Nov 4, 2026
A view may be a misclick or a confidential inquiry. The owner's security
history shows changes, each with its reason; only the audit keeps views.
@PiquelChips
PiquelChips force-pushed the fix/hide-account-view-event branch from b651142 to 134a1aa Compare November 4, 2026 17:12
@PiquelChips
PiquelChips merged commit 49b1cd9 into main Nov 4, 2026
9 checks passed
@PiquelChips
PiquelChips deleted the fix/hide-account-view-event branch November 4, 2026 17:22
@github-project-automation github-project-automation Bot moved this from In Progress to Done in sourceorigin.dev Nov 4, 2026
PiquelChips added a commit that referenced this pull request Nov 4, 2026
…sts unless asked for (#350)

Every reload of an account's pages recorded another "Account details
viewed", so a single investigation buried the account's real changes
under a dozen identical rows in the admin dashboard's event lists. The
views are worth keeping, since they're the only record of who read whose
data, but one per sitting is enough.

- **Once an hour:** `Operator::record_view` replaces the three places
that recorded views. It skips the write when the same administrator, in
the same dashboard session, already viewed the account within the hour;
for the CLI, "same" means the same operator user and host. This also
removes the `OnceCell` that `Viewer` used to record one view per page.
- **Hidden by default:** the dashboard's overview, account page and
events page now leave views out. The events page has a "Show views" /
"Hide views" link, which applies at once and keeps the account and kind
filters (a checkbox did nothing until Filter was pressed, since the
dashboard loads no JavaScript). `audit list` gained `--views`, and
filtering by the kind `account_viewed` still lists them.

Follows #346, which took views out of the owner's own history.

Proved after rebasing onto main with the auth-service and repository
database tests on a scratch cluster (342/342 pass), an up-to-date SQLx
cache and clean clippy. Two new tests cover it: a reload records no
second view while another administrator records their own, and the
events list includes views only when asked. A new browser test in
`admin.spec.ts` shows and hides an account's views from the events page;
it passes against a preview of this branch, as do the other dashboard
tests the preview can run.

Reviewed with review-loop: 2 rounds with 2× gpt-6.1-sol and
claude-opus-5-5. Verdict: approved

> [!NOTE]
> Written by Claude Opus 5.5 in Claude Code (via T3 Code)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apps/auth-service Origin Auth at auth.sourceorigin.dev, its settings and developer console, and the operator CLI bug Something isn't working security Anything security related

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant