Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ out/
.github/copilot-instructions.md

# LLM files
.remember/
.remember/
16 changes: 15 additions & 1 deletion docs/auth0_actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,21 @@ has_children: true
---
# auth0 actions

Actions are secure, tenant-specific, versioned functions written in Node.js that execute at certain points within the Auth0 platform. Actions are used to customize and extend Auth0's capabilities with custom logic.
Actions are secure, tenant-specific, versioned functions written in Node.js that execute
at certain points within the Auth0 platform. Actions are used to customize and extend Auth0's
capabilities with custom logic.

## Schema Discovery & JSON Input

Use '--schema' on a command to print its request payload schema, and '--data'
to provide that payload programmatically (validated against the schema before the call).

Examples:
auth0 actions create --schema # Show the create payload schema
auth0 actions create --data @action.json # Create from JSON file
auth0 actions create --data '{"name":"..."}' # Create from inline JSON

For more details: https://auth0.com/docs/api/management/v2

## Commands

Expand Down
36 changes: 28 additions & 8 deletions docs/auth0_actions_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,20 @@ has_toc: false

Create a new action.

To create interactively, use `auth0 actions create` with no flags.
To create interactively, use 'auth0 actions create' with no flags.

To create non-interactively, supply the action name, trigger, code, secrets and dependencies through the flags.

## JSON Input (for agents and automation)

Use '--schema' to print the request payload schema, then '--data' to provide
action data as JSON:
- Inline JSON: --data '{"name":"my-action",...}'
- From file: --data @action.json
- From stdin: pipe data in (e.g. cat action.json | auth0 actions create)

The JSON is validated against the OpenAPI schema before sending to the API.

## Usage
```
auth0 actions create [flags]
Expand All @@ -19,29 +29,39 @@ auth0 actions create [flags]
## Examples

```
# Interactive mode
auth0 actions create
auth0 actions create --name myaction

# Flag-based mode
auth0 actions create --name myaction --trigger post-login
auth0 actions create --name myaction --trigger post-login --code "$(cat path/to/code.js)" --runtime node18
auth0 actions create --name myaction --trigger post-login --code "$(cat path/to/code.js)" --dependency "lodash=4.0.0"
auth0 actions create --name myaction --trigger post-login --code "$(cat path/to/code.js)" --dependency "lodash=4.0.0" --secret "SECRET=value"
auth0 actions create --name myaction --trigger post-login --code "$(cat path/to/code.js)" --dependency "lodash=4.0.0" --dependency "uuid=9.0.0" --secret "API_KEY=value" --secret "SECRET=value"
auth0 actions create --name myaction --trigger post-login --code "$(cat path/to/code.js)" --module "module_id=mod_123,module_version_id=ver_456"
auth0 actions create -n myaction -t post-login -c "$(cat path/to/code.js)" -r node18 -d "lodash=4.0.0" -d "uuid=9.0.0" -s "API_KEY=value" -s "SECRET=value" --json
auth0 actions create -n myaction -t post-login -c "$(cat path/to/code.js)" -r node18 -d "lodash=4.0.0" -d "uuid=9.0.0" -s "API_KEY=value" -s "SECRET=value" --json-compact
auth0 actions create -n myaction -t post-login -c "$(cat path/to/code.js)" -r node18 --json
auth0 actions create -n myaction -t post-login -c "$(cat path/to/code.js)" -d "lodash=4.0.0" -s "API_KEY=value" --json-compact

# Discover the payload schema (add --json for machine-readable output)
auth0 actions create --schema
auth0 actions create --schema --json

# JSON input mode (for agents and automation)
auth0 actions create --data '{"name":"my-action","supported_triggers":[{"id":"post-login","version":"v3"}]}'
auth0 actions create --data @action.json
cat action.json | auth0 actions create
auth0 actions create --data @action.json --json
```


## Flags

```
-c, --code string Code content for the action.
--data string JSON payload for the operation, as a JSON string or file path (@file.json). Can also be piped via stdin.
-d, --dependency stringToString Third party npm module, and its version, that the action depends on. (default [])
--json Output in json format.
--json-compact Output in compact json format.
-m, --module stringArray Action module to associate with the action, as comma-separated key=value pairs matching the API fields: module_id and module_version_id (both required, UUIDs). Can be passed multiple times to associate several modules.
-n, --name string Name of the action.
-r, --runtime string Runtime to be used in the action. Possible values are: node22(recommended), node18, node16, node12
--schema Print the request payload schema for this command and exit. Use with --json or --json-compact for machine-readable output.
-s, --secret stringToString Secrets to be used in the action. (default [])
-t, --trigger string Trigger of the action. At this time, an action can only target a single trigger at a time.
```
Expand Down
38 changes: 28 additions & 10 deletions docs/auth0_actions_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@ has_toc: false

Update an action.

To update interactively, use `auth0 actions update` with no arguments.

To update interactively, use 'auth0 actions update' with no arguments.
To update non-interactively, supply the action id, name, code, secrets and dependencies through the flags.
## JSON Input (for agents and automation)

Use '--schema' to print the request payload schema, then '--data' to provide
update data as JSON:
- Inline JSON: --data '{"name":"updated-name","runtime":"node22"}'
- From file: --data @update.json
- From stdin: pipe data in (e.g. cat update.json | auth0 actions update <id>)

The JSON is validated against the OpenAPI schema before sending to the API.

## Usage
```
Expand All @@ -19,30 +27,40 @@ auth0 actions update [flags]
## Examples

```
# Interactive mode
auth0 actions update
auth0 actions update <action-id>

# Flag-based mode
auth0 actions update <action-id> --runtime node18
auth0 actions update <action-id> --name myaction --runtime node18
auth0 actions update <action-id> --name myaction --code "$(cat path/to/code.js) --r node18"
auth0 actions update <action-id> --name myaction --code "$(cat path/to/code.js)" --dependency "lodash=4.0.0"
auth0 actions update <action-id> --name myaction --code "$(cat path/to/code.js)" --dependency "lodash=4.0.0" --secret "SECRET=value"
auth0 actions update <action-id> --name myaction --code "$(cat path/to/code.js)" --dependency "lodash=4.0.0" --dependency "uuid=9.0.0" --secret "API_KEY=value" --secret "SECRET=value"
auth0 actions update <action-id> --module "module_id=mod_123,module_version_id=ver_456"
auth0 actions update <action-id> -n myaction -c "$(cat path/to/code.js)" -r node18 -d "lodash=4.0.0" -d "uuid=9.0.0" -s "API_KEY=value" -s "SECRET=value" --json
auth0 actions update <action-id> -n myaction -c "$(cat path/to/code.js)" -r node18 -d "lodash=4.0.0" -d "uuid=9.0.0" -s "API_KEY=value" -s "SECRET=value" --json-compact
auth0 actions update <action-id> --name myaction --code "$(cat path/to/code.js)"
auth0 actions update <action-id> --module "module_id=mod_123,module_version_id=ver_456" --json
auth0 actions update <action-id> -n myaction -c "$(cat path/to/code.js)" -d "lodash=4.0.0" --json-compact

# Discover the payload schema (add --json for machine-readable output)
auth0 actions update --schema
auth0 actions update --schema --json

# JSON input mode (for agents and automation)
auth0 actions update <action-id> --data '{"name":"updated-name","runtime":"node22"}'
auth0 actions update <action-id> --data @update.json
cat update.json | auth0 actions update <action-id>
```


## Flags

```
-c, --code string Code content for the action.
--data string JSON payload for the operation, as a JSON string or file path (@file.json). Can also be piped via stdin.
-d, --dependency stringToString Third party npm module, and its version, that the action depends on. (default [])
--force Skip confirmation.
--json Output in json format.
--json-compact Output in compact json format.
-m, --module stringArray Action module to associate with the action, as comma-separated key=value pairs matching the API fields: module_id and module_version_id (both required, UUIDs). Can be passed multiple times to associate several modules.
-n, --name string Name of the action.
-r, --runtime string Runtime to be used in the action. Possible values are: node22(recommended), node18, node16, node12
--schema Print the request payload schema for this command and exit. Use with --json or --json-compact for machine-readable output.
-s, --secret stringToString Secrets to be used in the action. (default [])
```

Expand Down
7 changes: 6 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ require (
github.com/charmbracelet/glamour v1.0.0
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
github.com/fsnotify/fsnotify v1.10.1
github.com/getkin/kin-openapi v0.145.0
github.com/getsentry/sentry-go v0.48.0
github.com/golang/mock v1.6.0
github.com/google/go-cmp v0.7.0
Expand Down Expand Up @@ -62,14 +63,15 @@ require (
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.1 // indirect
github.com/dlclark/regexp2 v1.11.5 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/go-openapi/jsonpointer v0.22.5 // indirect
github.com/go-openapi/swag/jsonname v0.25.5 // indirect
github.com/goccy/go-json v0.10.6 // indirect
github.com/godbus/dbus/v5 v5.2.2 // indirect
github.com/gorilla/css v1.0.1 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-retryablehttp v0.7.8 // indirect
github.com/hashicorp/terraform-json v0.28.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lestrrat-go/blackmagic v1.0.4 // indirect
github.com/lestrrat-go/dsig v1.3.0 // indirect
github.com/lestrrat-go/dsig-secp256k1 v1.0.0 // indirect
Expand All @@ -87,7 +89,10 @@ require (
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/muesli/termenv v0.16.0 // indirect
github.com/oasdiff/yaml v0.1.1 // indirect
github.com/oasdiff/yaml3 v0.0.14 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect
github.com/segmentio/asm v1.2.1 // indirect
github.com/valyala/fastjson v1.6.10 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
Expand Down
15 changes: 14 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn
github.com/cloudflare/circl v1.6.3 h1:9GPOhQGF9MCYUeXyMYlqTR6a5gTrgR/fBLXvUgtVcg8=
github.com/cloudflare/circl v1.6.3/go.mod h1:2eXP6Qfat4O/Yhh8BznvKnJ+uzEoTQ6jVKJRn81BiS4=
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI=
github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
github.com/cyphar/filepath-securejoin v0.6.1 h1:5CeZ1jPXEiYt3+Z6zqprSAgSWiggmpVyciv8syjIpVE=
Expand All @@ -85,6 +84,8 @@ github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
github.com/fsnotify/fsnotify v1.10.1 h1:b0/UzAf9yR5rhf3RPm9gf3ehBPpf0oZKIjtpKrx59Ho=
github.com/fsnotify/fsnotify v1.10.1/go.mod h1:TLheqan6HD6GBK6PrDWyDPBaEV8LspOxvPSjC+bVfgo=
github.com/getkin/kin-openapi v0.145.0 h1:htBX+Q7SevVaCUqymFegUKzH2WCbewl9tsmyn2FMGWY=
github.com/getkin/kin-openapi v0.145.0/go.mod h1:3BH9M9XDe/y9M5DSvEocVYAYq1w0qrhJHjC/vZi0AaY=
github.com/getsentry/sentry-go v0.48.0 h1:FRZNr7Uk1C86ev1bSJmYlUkL9oyivQA6YOcdYfaaMmY=
github.com/getsentry/sentry-go v0.48.0/go.mod h1:E5UkA5wp1qR2+MDydNYlVeUiNN2xEdjYMidkgf0Qoss=
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
Expand All @@ -95,6 +96,12 @@ github.com/go-git/go-billy/v5 v5.9.0 h1:jItGXszUDRtR/AlferWPTMN4j38BQ88XnXKbilmm
github.com/go-git/go-billy/v5 v5.9.0/go.mod h1:jCnQMLj9eUgGU7+ludSTYoZL/GGmii14RxKFj7ROgHw=
github.com/go-git/go-git/v5 v5.19.2 h1:wkfn7vOlUBu8ivAWKBWisTiwJK4jYHzTF8Ndv1LyGqY=
github.com/go-git/go-git/v5 v5.19.2/go.mod h1:QqCBE1EFN5ddFmrliLQ3/ntRCUjZU3EJuwuB/jWEHjk=
github.com/go-openapi/jsonpointer v0.22.5 h1:8on/0Yp4uTb9f4XvTrM2+1CPrV05QPZXu+rvu2o9jcA=
github.com/go-openapi/jsonpointer v0.22.5/go.mod h1:gyUR3sCvGSWchA2sUBJGluYMbe1zazrYWIkWPjjMUY0=
github.com/go-openapi/swag/jsonname v0.25.5 h1:8p150i44rv/Drip4vWI3kGi9+4W9TdI3US3uUYSFhSo=
github.com/go-openapi/swag/jsonname v0.25.5/go.mod h1:jNqqikyiAK56uS7n8sLkdaNY/uq6+D2m2LANat09pKU=
github.com/go-openapi/testify/v2 v2.4.0 h1:8nsPrHVCWkQ4p8h1EsRVymA2XABB4OT40gcvAu+voFM=
github.com/go-openapi/testify/v2 v2.4.0/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54=
github.com/goccy/go-json v0.10.6 h1:p8HrPJzOakx/mn/bQtjgNjdTcN+/S6FcG2CTtQOrHVU=
github.com/goccy/go-json v0.10.6/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
github.com/godbus/dbus/v5 v5.2.2 h1:TUR3TgtSVDmjiXOgAAyaZbYmIeP3DPkld3jgKGV8mXQ=
Expand Down Expand Up @@ -197,6 +204,10 @@ github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s=
github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8=
github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc=
github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk=
github.com/oasdiff/yaml v0.1.1 h1:6nHx+pn9gBRM6YpBlFZFQGCCd1nuvqOBtTD3KKTgGxY=
github.com/oasdiff/yaml v0.1.1/go.mod h1:EYJNoyktvWMJ0Hmhx+6qTaqMOsalUaRGT8Sj1hNcegU=
github.com/oasdiff/yaml3 v0.0.14 h1:aLJee3hxBK2H5wdXd9iPcIXb93Nty1Ge0pT171eHtkw=
github.com/oasdiff/yaml3 v0.0.14/go.mod h1:csto2xfDjYccdUn/yw/bPjj/cYTdp6HtFA0J4TWG+gg=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
Expand All @@ -217,6 +228,8 @@ github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUc
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 h1:KRzFb2m7YtdldCEkzs6KqmJw4nqEVZGK7IN2kJkjTuQ=
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU=
github.com/schollz/progressbar/v3 v3.19.1 h1:iv8BgwOvdML/S3p84uBpy/IMigv4U9594vPZYa2EdrU=
github.com/schollz/progressbar/v3 v3.19.1/go.mod h1:LFL7jqimKxfhero4K1eCkUr/6R39AgQeiPCJtlTWIW8=
github.com/segmentio/asm v1.2.1 h1:DTNbBqs57ioxAD4PrArqftgypG4/qNpXoJx8TVXxPR0=
Expand Down
Loading
Loading