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
1 change: 1 addition & 0 deletions docs/auth0_event-streams_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ auth0 event-streams create [flags]
auth0 event-streams create
auth0 event-streams create --name my-event-stream --type eventbridge --subscriptions "user.created,user.updated" --configuration '{"aws_account_id":"325235643634","aws_region":"us-east-2"}'
auth0 event-streams create --name my-event-stream --type webhook --subscriptions "user.created,user.deleted" --configuration '{"webhook_endpoint":"https://mywebhook.net","webhook_authorization":{"method":"bearer","token":"123456789"}}'
auth0 event-streams create --name my-event-stream --type action --subscriptions "user.created" --configuration '{"action_id":"b053e4ca-8b14-4233-b615-bd3bdb353977"}'
auth0 event-streams create -n my-event-stream -t webhook -s "user.created,user.deleted" -c '{"webhook_endpoint":"https://mywebhook.net","webhook_authorization":{"method":"bearer","token":"123456789"}}'
```

Expand Down
3 changes: 2 additions & 1 deletion docs/auth0_event-streams_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ auth0 event-streams update [flags]
auth0 event-streams update <event-id> --name my-event-stream --status enabled
auth0 event-streams update <event-id> --name my-event-stream --status enabled --subscriptions "user.created,user.updated"
auth0 event-streams update <event-id> --name my-event-stream --status disabled --subscriptions "user.deleted" --configuration '{"aws_account_id":"325235643634","aws_region":"us-east-2"}'
auth0 event-streams update <event-id> --name my-event-stream --status enabled --subscriptions "user.created" --configuration '{"webhook_endpoint":"https://my-new-webhook.net","webhook_authorization":{"method":"bearer","token":"0909090909"}}
auth0 event-streams update <event-id> --name my-event-stream --status enabled --subscriptions "user.created" --configuration '{"webhook_endpoint":"https://my-new-webhook.net","webhook_authorization":{"method":"bearer","token":"0909090909"}}'
auth0 event-streams create <event-id> --name my-event-stream --subscriptions "user.updated" --configuration '{"action_id":"b053e4ca-8b14-4233-b615-bd3bdb353977"}'
auth0 event-streams update <event-id> -n my-event-stream --status enabled -s "user.created" -c '{"webhook_endpoint":"https://my-new-webhook.net","webhook_authorization":{"method":"bearer","token":"987654321"}}
```

Expand Down
3 changes: 2 additions & 1 deletion internal/cli/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ var (
"send-phone-message": actionTemplateSendPhoneMessage,
"custom-email-provider": actionTemplateCustomEmailProvider,
"custom-phone-provider": actionTemplateCustomPhoneProvider,
"event-stream": actionTemplateEventStream,
}
)

Expand Down Expand Up @@ -201,7 +202,7 @@ func createActionCmd(cli *cli) *cobra.Command {
Example: ` auth0 actions create
auth0 actions create --name myaction
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)" --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"
Expand Down
3 changes: 3 additions & 0 deletions internal/cli/actions_embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,7 @@ var (

//go:embed data/action-template-empty.js
actionTemplateEmpty string

//go:embed data/action-template-event-stream.js
actionTemplateEventStream string
)
9 changes: 9 additions & 0 deletions internal/cli/data/action-template-event-stream.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Handler that will be called during the execution of a EventStream flow.
*
* @param {Event} event - Details about the user and the context in which they are logging in.
* @param {EventStreamAPI} api - Methods and utilities to help
*/
exports.onExecuteEventStream = async (event, api) => {

};
10 changes: 7 additions & 3 deletions internal/cli/event_streams.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,12 @@ func createEventStreamCmd(cli *cli) *cobra.Command {
Short: "Create a new event stream",
Long: "Create a new event stream.\n\n" +
"To create interactively, use `auth0 event-streams create` with no flags.\n\n" +
"To create non-interactively, supply the event stream name, type, subscriptions and configuration through the flags.",
"To create non-interactively, supply the event stream name, type, subscriptions and configuration through the flags. \n" +
"Only deployed actions can be used for action configuration",
Example: ` auth0 event-streams create
auth0 event-streams create --name my-event-stream --type eventbridge --subscriptions "user.created,user.updated" --configuration '{"aws_account_id":"325235643634","aws_region":"us-east-2"}'
auth0 event-streams create --name my-event-stream --type webhook --subscriptions "user.created,user.deleted" --configuration '{"webhook_endpoint":"https://mywebhook.net","webhook_authorization":{"method":"bearer","token":"123456789"}}'
auth0 event-streams create --name my-event-stream --type action --subscriptions "user.created" --configuration '{"action_id":"b053e4ca-8b14-4233-b615-bd3bdb353977"}'
auth0 event-streams create -n my-event-stream -t webhook -s "user.created,user.deleted" -c '{"webhook_endpoint":"https://mywebhook.net","webhook_authorization":{"method":"bearer","token":"123456789"}}'`,
RunE: func(cmd *cobra.Command, args []string) error {
if err := eventStreamName.Ask(cmd, &inputs.Name, nil); err != nil {
Expand Down Expand Up @@ -269,13 +271,15 @@ func updateEventStreamCmd(cli *cli) *cobra.Command {
"To update non-interactively, supply the event id, name, status, subscriptions and " +
"configuration through the flags. An event stream type CANNOT be updated hence the configuration " +
"should match the schema based on the type of event stream. Configuration for `eventbridge` streams " +
"cannot be updated.",
"cannot be updated." +
"Only deployed actions can be used for action configuration",
Example: ` auth0 event-streams update <event-id>
auth0 event-streams update <event-id> --name my-event-stream
auth0 event-streams update <event-id> --name my-event-stream --status enabled
auth0 event-streams update <event-id> --name my-event-stream --status enabled --subscriptions "user.created,user.updated"
auth0 event-streams update <event-id> --name my-event-stream --status disabled --subscriptions "user.deleted" --configuration '{"aws_account_id":"325235643634","aws_region":"us-east-2"}'
auth0 event-streams update <event-id> --name my-event-stream --status enabled --subscriptions "user.created" --configuration '{"webhook_endpoint":"https://my-new-webhook.net","webhook_authorization":{"method":"bearer","token":"0909090909"}}
auth0 event-streams update <event-id> --name my-event-stream --status enabled --subscriptions "user.created" --configuration '{"webhook_endpoint":"https://my-new-webhook.net","webhook_authorization":{"method":"bearer","token":"0909090909"}}'
auth0 event-streams create <event-id> --name my-event-stream --subscriptions "user.updated" --configuration '{"action_id":"b053e4ca-8b14-4233-b615-bd3bdb353977"}'
auth0 event-streams update <event-id> -n my-event-stream --status enabled -s "user.created" -c '{"webhook_endpoint":"https://my-new-webhook.net","webhook_authorization":{"method":"bearer","token":"987654321"}}`,
RunE: func(cmd *cobra.Command, args []string) error {
if len(args) > 0 {
Expand Down
Loading