Skip to content

feat(access-profiles): add --type birthright|catalog|hybrid flag - #301

Draft
cvkramer wants to merge 2 commits into
mainfrom
auto/global-w291.1
Draft

cvkramer wants to merge 2 commits into
mainfrom
auto/global-w291.1

Conversation

@cvkramer

Copy link
Copy Markdown

What

Adds a --type birthright|catalog|hybrid flag to access-profiles create and access-profiles update, mapping to the type field on the RequestCatalog API object (REQUEST_CATALOG_TYPE_BUNDLE/CATALOG/CATALOG_AND_BUNDLE; role is an alias for birthright). Documents the Birthright constraints discovered along the way in --help, README, and cmd/agents.md, and rejects --published/--enrollment-behavior/--unenrollment-behavior/--unenrollment-entitlement-behavior client-side (exit 2) when combined with --type birthright, quoting the server's own error.

Why

access-profiles create/update had no --type flag, so creating or updating Birthright (Role) profiles required a raw c1i api call with a hand-built profileType field. 25 raw POST /api/v1/catalogs calls and 2 raw POST /api/v1/catalogs/{id} calls were observed in one day as a workaround. The Birthright-specific constraints (no entitlement request settings; must disable live requests before switching a profile to Birthright) were undocumented.

Bead: global-w291.1
Fixes #296

Verification

  • go build ./..., go vet ./... — clean
  • go test ./... — all packages pass
  • go test -count=1 -shuffle=on ./... — all packages pass
  • go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.15.0 run --timeout=3m ./... — 0 issues
  • Added tests pinning the --type enum mapping (create and update) and the client-side Birthright rejection of --published/enrollment/unenrollment flags, plus a regression guard that non-birthright profiles still accept --published
  • Confirmed the API's type enum and docstrings via c1i docs endpoint /api/v1/catalogs (CATALOG/BUNDLE/CATALOG_AND_BUNDLE/UNSPECIFIED; the undocumented PROFILE value is intentionally not exposed as a CLI alias)
  • Rebased onto current origin/main (4cc8d43; already up to date, no conflicts)
  • Fixed a writer-guard failure (TestNoPresenceAsContent) by adding a reasoned allowlist entry for the new presence check in validateBirthrightConstraints

Opened from Charles's local c1i issue triage.

c1-charleskramer and others added 2 commits November 23, 2026 15:18
Add --type to access-profiles create and update, mapping to the
RequestCatalog.type field. Accepted values: birthright (alias: role) →
REQUEST_CATALOG_TYPE_BUNDLE, catalog → REQUEST_CATALOG_TYPE_CATALOG,
hybrid → REQUEST_CATALOG_TYPE_CATALOG_AND_BUNDLE. Full REQUEST_CATALOG_TYPE_*
values pass through for forward compatibility.

Birthright profiles reject --published and all enrollment/unenrollment
behavior flags client-side (exit 2), quoting the server error "access profile
type Birthright does not support entitlement request settings". Docs also
cover the update-time constraint "turn off requests before changing the
profile type to Birthright".

Closes: global-w291.1

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The writer-guard TestNoPresenceAsContent flagged the new
validateBirthrightConstraints helper's Changed() calls. They are a
legitimate presence check (the server rejects these flags if passed
at all with --type birthright, regardless of value), so add a
reasoned allowlist entry.
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.

access-profiles create/update missing --type flag; Birthright constraints undocumented

2 participants