Skip to content

feat(permissions): tell callers what they may do, and issue scoped tokens - #142

Open
PiquelChips wants to merge 1 commit into
feat/permissions-authfrom
feat/permissions-tokens
Open

PiquelChips wants to merge 1 commit into
feat/permissions-authfrom
feat/permissions-tokens

Conversation

@PiquelChips

Copy link
Copy Markdown
Member

With callers told apart, they need a way to see what the policy lets them do, and to hand an agent or a CI runner less than that.

  • OriginService::rights resolves a caller's rights from the policy in force, kept until policy moves, narrowed by their token's scope. The owner has every right.
  • GET whoami returns them, and POST tokens issues a token acting for the caller, with a scope their rights must cover. Anything wider is refused with the new forbidden error code.
  • A token lasts at most 7 days, and never longer than the token that issued it, so no token renews itself.
  • An operator signs tokens for any principal with the server's key, origin token issue --config <file> --as <principal>, to give agents identities of their own.

On the command line, origin whoami and origin permissions show what the remote says, and origin token issue --scope <capability>... asks it for a token.

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

@coderabbitai

coderabbitai Bot commented Nov 22, 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 34 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: f2a5a76c-1edd-4e2a-a43d-654de39e27bb
Commits

Reviewing files that changed from the base of the PR and between 659dd5f and 93381ad.

Files selected for processing: 15

  • AGENTS.md
  • README.md
  • apps/origin-src/src/cli.rs
  • apps/origin-src/src/http.rs
  • apps/origin-src/src/permissions.rs
  • apps/origin-src/src/remote.rs
  • apps/origin-src/src/server.rs
  • apps/origin-src/src/service.rs
  • apps/origin-src/src/workspace/access.rs
  • apps/origin-src/src/workspace/mod.rs
  • apps/origin-src/src/workspace/remote.rs
  • apps/origin-src/tests/http.rs
  • crates/origin-client/src/lib.rs
  • crates/origin-shared/src/api.rs
  • docs/openapi.json
  • 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 added this pull request to stack #165 November 22, 2026 14:59
@PiquelChips
PiquelChips force-pushed the feat/permissions-tokens branch 3 times, most recently from bf8417f to 5691047 Compare November 22, 2026 18:54
…kens

With callers told apart, they need a way to see what the policy lets
them do, and to hand an agent or a CI runner less than that.

`OriginService::rights` resolves a caller's rights from the policy in
force, kept until `policy` moves, narrowed by their token's scope:
the owner has every right. `GET whoami` returns them, and `POST tokens`
issues a token acting for the caller with a scope their rights must
cover, refused with the new `forbidden` error code otherwise. A token
lasts at most 7 days, and one issued with a scoped token never outlasts
it, so no token renews itself. An operator signs tokens for any
principal with the server's key, `origin token issue --config <file>
--as <principal>`, to give agents identities of their own.

On the command line, `origin whoami` and `origin permissions` show what
the remote says, and `origin token issue --scope <capability>...` asks
it for a token.
@PiquelChips
PiquelChips force-pushed the feat/permissions-tokens branch from 5691047 to 93381ad Compare November 22, 2026 19: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.

1 participant