feat: add native connections command - #1662
Merged
Merged
Conversation
Add a first-class 'auth0 connections' command tree for managing connections: list, create, show, update, delete, and enabled-clients (show/update). - Reads (list, enabled-clients) use the go-auth0 v3 SDK with checkpoint pagination; create/read/update go through the schema-validated raw HTTP path so strategy-specific options are preserved without loss. - Supports --data (inline/@file/stdin JSON), --query for list filtering, and --schema for payload discovery. - Interactive flows: connection pickers, name/strategy prompts on create, an editor pre-filled with the mutable config on update, and a pre-selected application multi-select on enabled-clients update. - Fix runJSONQuery to expand JSON array values into repeated query params (also fixes actions/forms list filtering). - Add missing create:connections and delete:connections auth scopes. - Add commander integration tests and regenerate command docs.
…ns-command # Conflicts: # internal/cli/query_json.go
…g create - Add connections_json_test.go covering invalid --query, create --data (valid and schema-invalid), and update --data write paths - Wrap create/update API errors with the expected-schema hint for humans, keeping the JSON error envelope clean in agent mode - Send the flag-based create body raw instead of through the schema handler so name/strategy creation still works when the OpenAPI schema is unreachable - Call markDataExclusive on connections update to match the other resources - Add --schema to connections enabled-clients update - Use the shared listQueryFlag for connections list
A request body whose top-level type is an array (e.g. PATCH
/connections/{id}/clients, an array of {client_id, status}) previously
rendered as a bare "Type: array" in --schema text mode, hiding the item
fields. formatSchema now descends into the array item schema so the
fields surface, matching the JSON output which already included them.
Satisfies gocritic ifElseChain after adding the top-level array branch.
developerkunal
enabled auto-merge (squash)
September 18, 2026 08:32
ramya18101
approved these changes
Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔧 Changes
Adds a first-class
auth0 connectionscommand tree so connections can be managed natively instead of throughauth0 api.New commands:
auth0 connections list— list connections, with--queryfor JSON-based filtering and--schemato see available query parameters.auth0 connections create— create a connection interactively (name prompt + strategy picker) or non-interactively via--name/--strategyor--data.auth0 connections show <id>— show a connection's full, strategy-specific configuration.auth0 connections update <id>— update via--data, or interactively through an editor pre-filled with the current mutable configuration.auth0 connections delete <id...>— delete one or more connections, with confirmation and--force.auth0 connections enabled-clients show <id>— list the applications that have the connection enabled.auth0 connections enabled-clients update <id>— update enabled clients via--data(with--schemato print the expected payload), or interactively through an application multi-select pre-populated with the currently-enabled clients (only the diff is sent).Implementation notes:
list,enabled-clients) use the go-auth0 v3 SDK with checkpoint pagination.--datacreate and update go through the schema-validated raw HTTP path so strategy-specificoptionsare preserved without loss from typed models.--name/--strategy) sends its trivially-valid body straight to the raw HTTP path without loading the OpenAPI schema, so interactive and flag-based creation still work when the schema cannot be fetched (for example, a fresh machine that is offline).--dataaccepts inline JSON,@file, or piped stdin, validated against the OpenAPI schema before the request. When an operation has no local schema, the payload is sent unvalidated and a diagnostic says so, matching the other--datacommands.list --queryuses the shared query flag and encoder, so a JSON array value expands into repeated query parameters ({"strategy":["auth0","oidc"]}sendsstrategy=auth0&strategy=oidc), numbers keep their literal, anullis omitted, and a nested object is rejected as a validation error.id,name,strategy) from the editor, since thePATCH /connections/{id}schema does not accept them (display_nameremains editable).create:connectionsanddelete:connectionsscopes to the login authorization request.📚 References
N/A
🔬 Testing
TestCollectConnections), the connection strategy picker (TestConnectionPickerOptions), and immutable-field stripping on interactive update (TestStripConnectionImmutableFields).connections_json_test.gocovering the JSON write path:list --querywith invalid JSON errors before any API call,create --datasends a validated payload toPOST /connectionsand rejects a schema-invalid payload without reaching the API, andupdate --datasends toPATCH /connections/{id}.test/integration/connections-test-cases.yaml, 17 cases) covering list, create (flags, JSON, and invalid JSON), query filtering, the create and enabled-clients update schemas, show, update, enabled-clients, the interactive-update guard, agent-mode delete refusal, and delete, plus cleanup wiring intest-cleanup.sh.make docs;make test-unit,go vet, andgolangci-lintare clean.📝 Checklist