Skip to content

Add c1i roles list and roles get - #144

Merged
leet-c1 merged 4 commits into
mainfrom
feat/roles-commands
Oct 5, 2026
Merged

leet-c1 merged 4 commits into
mainfrom
feat/roles-commands

Conversation

@leet-c1

@leet-c1 leet-c1 commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds c1i roles list and c1i roles get, split out of #143 to keep that PR focused on login.

  • roles list paginates GET /api/v1/iam/roles as NDJSON rows: id, name (e.g. system:viewer), display_name, system_builtin, system_api_only, created_at, updated_at. Bools are real bools, and unset timestamps are null.
  • roles get <role-id> prints one role, including its serviceRoles and permissions.

These are where the ids that service-principals credentials create --scoped-role takes come from. Before this, only c1i api --path /api/v1/iam/roles reached them.

Documented in README (Roles), cmd/agents.md (Choosing a command), and CHANGELOG.

Test plan

  • go vet, golangci-lint (0 issues), gosec, go test -shuffle=on
  • Pagination case in listPaginationCases, unwrap case in getUnwrapCases, and a roleRow type test (mutation-checked)
  • The docs guards (TestEveryFlagIsDocumented, TestAgentsMDCommandsResolveAgainstCobraTree, TestReadmeCommandsResolveAgainstCobraTree) pass
  • Live on the lab tenant:
    • roles list returned every role, with real-bool fields.
    • roles get returned Basic User with 196 service roles and 10 permissions.
    • A malformed id exits 2 with the server's ^[a-zA-Z0-9]{27}$ error.

🤖 Generated with Claude Code

leet-c1 and others added 3 commits October 5, 2026 14:22
roles list paginates /api/v1/iam/roles as NDJSON rows (id, name,
display_name, system_builtin, system_api_only, timestamps); roles get
prints one role, including its service roles and permissions. They are
where the ids that service-principals credentials create --scoped-role
takes come from.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leet-c1 leet-c1 mentioned this pull request Oct 5, 2026
4 tasks done
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leet-c1
leet-c1 merged commit b313b03 into main Oct 5, 2026
2 checks passed
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