Skip to content

feat: enhance role management commands with schema and data options - #1659

Merged
ramya18101 merged 3 commits into
mainfrom
DXCDT-2107-agent-rollout-for-roles
Sep 16, 2026
Merged

ramya18101 merged 3 commits into
mainfrom
DXCDT-2107-agent-rollout-for-roles

Conversation

@ramya18101

Copy link
Copy Markdown
Contributor

🔧 Changes

Adds --schema, --data, and --query flags to the auth0 roles management commands, making them usable by agents and automation tooling without interactive prompts.

auth0 roles list

  • --schema: prints the GET /roles query-parameter schema and exits.
  • --query '{"name_filter":"..."}': filters results by passing a JSON object directly to the API; any documented parameter works immediately.

auth0 roles create

  • --schema: prints the POST /roles payload schema and exits.
  • --data <json|@file|stdin>: accepts a full JSON payload, validates it against the schema, and sends it — skipping all interactive prompts.

auth0 roles update

  • --schema: prints the PATCH /roles/{id} payload schema and exits.
  • --data <json|@file|stdin>: same as create, applied as a partial update.

--data is mutually exclusive with individual field flags (--name, --description) on both create and update.

📚 References

🔬 Testing

Unit tests pass (make test-unit). Manual smoke tests:

# Schema discovery
auth0 roles list --schema
auth0 roles list --schema --json
auth0 roles create --schema
auth0 roles update --schema

# Query filtering
auth0 roles list --query '{"name_filter":"admin"}' --json

# JSON input
auth0 roles create --data '{"name":"test-role","description":"a test role"}' --json
auth0 roles update <role-id> --data '{"description":"updated description"}' --json
echo '{"name":"updated-role"}' | auth0 roles update <role-id> --json

# Mutual exclusion guard
auth0 roles create --data '{"name":"x"}' --name "y"  # must error

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

ramya18101 and others added 2 commits September 16, 2026 18:42
Cover the createRoleCmd/updateRoleCmd --data JSON-input path and the
listRolesCmd --query path end to end: the command validates the payload against
the OpenAPI schema, then issues the right HTTP method and resource URI. A
capture client records the raw request runJSONWrite makes, and
prepareInteractivity clears the required-flag annotations for non-TTY input. A
schema-failure case proves validation short-circuits before any API call.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ramya18101
ramya18101 marked this pull request as ready for review September 16, 2026 13:26
@ramya18101
ramya18101 requested a review from a team as a code owner September 16, 2026 13:26

@developerkunal developerkunal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ramya18101
ramya18101 merged commit 305d199 into main Sep 16, 2026
6 checks passed
@ramya18101
ramya18101 deleted the DXCDT-2107-agent-rollout-for-roles branch September 16, 2026 14:47
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