Skip to content

refactor(e2e-ui): session guards on user command mounts - #173

Open
patrickleet wants to merge 1 commit into
tasks--contract-lifecycle-tooling-1from
feat/e2e-command-session-guards
Open

refactor(e2e-ui): session guards on user command mounts#173
patrickleet wants to merge 1 commit into
tasks--contract-lifecycle-tooling-1from
feat/e2e-command-session-guards

Conversation

@patrickleet

Copy link
Copy Markdown
Collaborator

Summary

  • Wire e2e-ui todo/blob/chat commands with .guarded(causal_has_user, …) (and causal_is_admin for force-archive) instead of discovering missing identity mid-handler.
  • Handlers use principal(ctx) for domain owner/author args only; input parse, load, and domain invariants stay in the body.
  • Expose CausalCommandContext::session(); treat empty user id as missing for user_id().
  • Clarify blob move docs (provisional client pure vs Atomic seal); suite unauth case accepts guard rejection (400/errors).

Stack

Stacked on tasks--contract-lifecycle-tooling-1 (PR #172).

Test plan

  • cargo check -p e2e-service
  • cargo test -p e2e-service --lib
  • session/guard unit tests
  • CI offline suite on PR

Move session admission (has user / is admin) onto TypedRouteBuilder
.guarded mounts so handlers only bind principal and call domain.
Add CausalCommandContext::session, causal_has_user/causal_is_admin
helpers, and keep input/domain checks in the handler body.
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

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: Pro Plus

Run ID: 312138a0-29e2-4c2a-9b32-adca0a4c5017

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.

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.

1 participant