Skip to content

feat: profile inheritance via extends - #31

Merged
cptfinch merged 1 commit into
mainfrom
feat/profile-inheritance
Jul 22, 2026
Merged

cptfinch merged 1 commit into
mainfrom
feat/profile-inheritance

Conversation

@cptfinch

Copy link
Copy Markdown
Contributor

Closes #20.

Summary

  • A profile can extends = "parent" to inherit secrets/env/ttl/repo/branch/agent from a parent profile
  • Additive-only, mirroring the macaroon rule that a derived token can never widen its parent:
    • secrets may narrow to a subset of the parent's, never widen
    • ttl may shorten, never lengthen
    • repo/branch/agent may only be set by the child if the parent left them unset — never overridden
    • env is CLI sugar (not a caveat), so child entries simply merge on top of the parent's
  • Cycles and unknown parent names are rejected at load time with clear errors
  • No changes to Caveat, macaroon format, or existing (non-extends) profile behaviour

Test plan

  • cargo fmt && cargo clippy --all-targets -- -D warnings && cargo test --all — all pass (31 unit + 28 CLI integration)
  • New scenarios in profile::tests::file_system_load_paths: inherit-when-omitted, narrow secrets subset, reject-widen secrets, shorten ttl, reject-lengthen ttl, add unset caveat, reject-override-set caveat, unknown parent, inheritance cycle

Phase 2 of ADR 0008. A profile can extend a parent to inherit its
secrets/env/ttl/caveats. Additive-only, mirroring the macaroon rule
that a derived token can never widen its parent:
- secrets may narrow to a subset, never widen
- ttl may shorten, never lengthen
- repo/branch/agent may only be added if the parent left them unset,
  never overridden
- cycles and unknown parents rejected at load time
@cptfinch
cptfinch merged commit a68ccb6 into main Jul 22, 2026
2 checks passed
@cptfinch
cptfinch deleted the feat/profile-inheritance branch July 22, 2026 11:51
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.

Profile inheritance (extends — additive caveats only)

1 participant