Skip to content

fix(access-profiles): map entitlement-type/profile-type mismatch 400s to actionable messages - #295

Draft
cvkramer wants to merge 1 commit into
mainfrom
auto/global-w291.3
Draft

cvkramer wants to merge 1 commit into
mainfrom
auto/global-w291.3

Conversation

@cvkramer

Copy link
Copy Markdown

What

Maps 3 known entitlement-type/profile-type mismatch 400 responses from access-profiles requestable-entitlements add to actionable, c1i-terminology error messages. Unknown/unmapped 400s still pass through unchanged.

Why

requestable-entitlements add returned raw, opaque API 400s when the entitlement type didn't match the profile type, with no pre-validation or guidance, and the API's own error text used API terminology ("Catalog profiles") instead of c1i's ("access-profiles"). 5 occurrences were observed in one day. Sample raw errors: "cannot add C1 app entitlements to a catalog", "Role membership entitlements can only be added to Catalog profiles", "membership entitlements of Catalog and Hybrid access profiles cannot be added to a Catalog profile; access profile is not a Role profile".

Bead: global-w291.3

Verification

  • go build ./..., go vet ./... — clean
  • go test ./... — all packages pass (10335 tests; 1 pre-existing unrelated failure in tokensource, not touched by this change)
  • golangci-lint run --timeout=3m ./... — 0 issues
  • 5 new tests covering the mapped error cases plus the unknown-400 passthrough
  • Rebased onto current origin/main (3 release commits, docs-only; rebased cleanly, no conflicts) and re-ran the full check before pushing

Opened from Charles's local c1i issue triage.

… to actionable messages

access-profiles requestable-entitlements add passed raw API 400 errors
("cannot add C1 app entitlements to a catalog", "Role membership
entitlements can only be added to Catalog profiles") with no guidance.
Map three known mismatch patterns to cleaner c1i-terminology messages that
name the access profile id and suggest 'access-profiles get <id>'. Unknown
400s pass through unchanged (exit 2 is preserved).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

2 participants