Skip to content

feat(entitlements): account-provisioning show/set - #290

Merged
leet-c1 merged 5 commits into
mainfrom
feat/entitlement-account-provisioning
Nov 19, 2026
Merged

leet-c1 merged 5 commits into
mainfrom
feat/entitlement-account-provisioning

Conversation

@cvkramer

@cvkramer cvkramer commented Nov 19, 2026 •

Copy link
Copy Markdown

What

c1i entitlements account-provisioning show|set <entitlement-id> --app-id. This is the Console's App > Accounts management > Provisioning: provisionerPolicy.connector.account.

c1i entitlements account-provisioning set <entitlement-id> --app-id <app> --connector-id <connector> \
  --field email=subject.email --field given_name='subject.display_name.split(" ")[0]' \
  (--save-to-vault-id <vault> ... | --do-not-save) [--test]
  • set always sends the complete policy with updateMask=provisionerPolicy. A raw update that names the mask but omits the account object still answers 200 and wipes the stored policy; this command can't produce that body.
  • --connector-id is pre-read: unknown exits 4, deleted exits 2. This runs under --dry-run too.
  • --test evaluates each --field through the same route as policies test-provision, in order, and aborts on the first failure before writing, naming the field. The server answers a non-compiling expression with a 500, which exits 6.
  • Usage errors (exit 2): duplicate or malformed --field, both storage modes, neither storage mode, --do-not-save=false.
  • Named show rather than get: the policy has no id of its own (the same convention as the settings ... show commands).

Verified

  • Unit tests, plus the mutation-table, dry-run parity and read-only-POST registries.
  • Live: show read a real connector-account policy. set --test re-applied identical values, and the re-show was byte-identical. A bad CEL with --test aborted before writing, and the policy was untouched. --fields on the mutation is exit 2.
  • Live: a raw update with updateMask=provisionerPolicy and no policy object answered 200 and replaced a stored connector policy, which is the hazard set exists to avoid.
  • golangci-lint v2.15.0 is clean. On macOS, 3 tests fail on main as well; test: pass on macOS, where the config dir is ~/Library/Application Support #288 fixes them.

Follow-ups in this branch

  • show refuses a 200 whose response does not hold the entitlement (absent, null, or without an id) with exit 6, through the same declared-path guard entitlements get uses, so a broken response cannot print the {} that means "nothing configured".
  • Documented that the policy is printed as stored: an entitlement whose policy was wiped holds the explicit {"unconfigured": {}} arm and show prints that, not {}. Absent and null both print {}.

c1-charleskramer and others added 4 commits November 18, 2026 17:33
…Policy.connector.account

- entitlements account-provisioning show <entitlement-id> --app-id prints
  .provisionerPolicy alone (named show, not get: the policy has no id of its
  own to guarantee at the top level, matching the settings */show convention)
- entitlements account-provisioning set <entitlement-id> --app-id --connector-id
  --field key=CEL... (--save-to-vault-id... | --do-not-save) [--test] always sends
  the complete connector.account policy with updateMask=provisionerPolicy, since
  a request that omits the policy under that mask still 200s and wipes it
- --connector-id is read first, --dry-run included (unknown exits 4, deleted 2);
  --test evaluates every --field through policies test-provision's own route
  and aborts on the first one the server rejects, naming it
- document the new flags/commands in README.md, cmd/agents.md, CHANGELOG.md
…ovisioning show

`show` unwrapped with `unwrapEnvelope` and printed "{}" for a 200 whose
response held no entitlement, so a broken response was indistinguishable from
"nothing configured". Route the entitlement through the same declared-path
guard `entitlements get` uses (`resourceAt`), which exits 6 when the object is
absent, null, or has no id, and keep "{}" only for an entitlement that really
has no provisionerPolicy. Tests cover the broken shapes and the unconfigured
policy.

Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
Live-verified: a raw update with `updateMask=provisionerPolicy` and no policy
object answers 200 and leaves the entitlement holding the explicit
`{"unconfigured": {}}` arm, which `show` then prints as sent -- not `{}`.
Say so in the help and both docs, replace the comment that recorded the arm
as unobserved, and pin the shape in the show table.

Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
The show help and the extractor comment described only "absent"; a stored
"provisionerPolicy": null takes the same "{}" path, so say so and leave no
input the sentence does not cover.

Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
@leet-c1
leet-c1 marked this pull request as ready for review November 19, 2026 21:16
Resolve the CHANGELOG "Added" entry and the readOnlyPOST registry against
the entries merged from the connectors-sync and accounts-get branches; keep
both sides.

Co-authored-by: c1-squire-dev[bot] <c1-squire-dev[bot]@users.noreply.github.com>
@leet-c1
leet-c1 merged commit 9da3de7 into main Nov 19, 2026
2 checks passed
@leet-c1
leet-c1 deleted the feat/entitlement-account-provisioning branch November 19, 2026 21:38
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.

3 participants