Skip to content

Commit

Permalink
Merge branch 'v1' of https://github.com/auth0/auth0-cli into v1
Browse files Browse the repository at this point in the history
  • Loading branch information
willvedd committed Jan 20, 2023
2 parents 8d756cc + d724cf3 commit 0be9982
Show file tree
Hide file tree
Showing 35 changed files with 598 additions and 372 deletions.
97 changes: 97 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [1.0.0-beta.1](https://github.com/auth0/auth0-cli/tree/1.0.0-beta.1) (Jan 20, 2023)

### Added

- Ability to view user's assigned roles via `auth0 users roles show` [#604]
- Assign role(s) to user via `auth0 users roles assign` [#605]
- Remove user role(s) via `auth0 users roles remove` [#606]
- `perms` alias for `auth0 roles permissions` command [#534]
- Authenticating via client credentials with `auth0 login` [#546]
- Graceful access token regeneration [#547]
- Storing client secret in operating system keyring [#578]
- Supporting additional scopes through `--scopes` flag when authenticating as user [#538]
- Argument to specify log stream type for `auth0 logs streams create` and `auth0 logs streams update` [#599]
- Better guidance on authenticating in the `auth0 login` help text [#565]
- Confirmation prompts before applying editor updates [#603]

### Changed

- `--format json` flag/value pair consolidated to `--json` [#533]
- Flattened the `auth0 branding` commands into the root-level [#540], [#541]
- Moved `auth0 ips` command to `auth0 ap sit ips` [#618]
- Moved `auth0 users unblock` to `auth0 users blocks unblock` [#617]
- `--reveal` flag for reveal client secret renamed to `--reveal-secrets` [#591]
- Editorializing code "hints" throughout project [#570]

### Fixed

- "something went wrong" error during `auth0 branding texts update` [#584]
- Help text descriptions for most instances of `--number` flag [#610]
- Allow updating a non-existent email template with `auth0 email templates update` [#611]
- `--no-input` flag works for `auth0 test token` and `auth0 test login` commands [#613]
- `--no-color` flag works for all commands [#594]
- All available triggers present when running `auth0 actions create` [#597]
- Extraneous payload property when running `auth0 orgs update` [#583]
- Users search command enables pagination through `--number` flag [#588]
- Tenant commands now respect `--tenant` flag [#612]
- Log tail output now displays absolute time instead of relative [#590]
- Adding missing headers for `auth0 logs list` [#589]
- Output new action data when running `auth0 actions update` [#596]
- Log streams "no roles" errors message [#598]
- Removed erroneous `auth0 apis show --json` truncation message [#607]
- Skip interactive elements when `--json` and `--force` flags are passed [#616]

### Removed

- `--force` and `--json` flags relegated from global context, now applied only where appropriate [#536], [#595]
- Undocumented `auth0 config init` command [#532]
- `auth0 tenants add` command in favor of `auth0 login` [#546]
- Updating of action triggers which inevitably results in error [#597]

[#604]: https://github.com/auth0/auth0-cli/issues/604
[#605]: https://github.com/auth0/auth0-cli/issues/605
[#606]: https://github.com/auth0/auth0-cli/issues/606
[#534]: https://github.com/auth0/auth0-cli/issues/534
[#546]: https://github.com/auth0/auth0-cli/issues/546
[#547]: https://github.com/auth0/auth0-cli/issues/547
[#578]: https://github.com/auth0/auth0-cli/issues/578
[#538]: https://github.com/auth0/auth0-cli/issues/538
[#599]: https://github.com/auth0/auth0-cli/issues/599
[#565]: https://github.com/auth0/auth0-cli/issues/565
[#603]: https://github.com/auth0/auth0-cli/issues/603
[#533]: https://github.com/auth0/auth0-cli/issues/533
[#540]: https://github.com/auth0/auth0-cli/issues/540
[#541]: https://github.com/auth0/auth0-cli/issues/541
[#591]: https://github.com/auth0/auth0-cli/issues/591
[#570]: https://github.com/auth0/auth0-cli/issues/570
[#584]: https://github.com/auth0/auth0-cli/issues/584
[#610]: https://github.com/auth0/auth0-cli/issues/610
[#611]: https://github.com/auth0/auth0-cli/issues/611
[#613]: https://github.com/auth0/auth0-cli/issues/613
[#594]: https://github.com/auth0/auth0-cli/issues/594
[#597]: https://github.com/auth0/auth0-cli/issues/597
[#583]: https://github.com/auth0/auth0-cli/issues/583
[#588]: https://github.com/auth0/auth0-cli/issues/588
[#590]: https://github.com/auth0/auth0-cli/issues/590
[#589]: https://github.com/auth0/auth0-cli/issues/589
[#596]: https://github.com/auth0/auth0-cli/issues/596
[#598]: https://github.com/auth0/auth0-cli/issues/598
[#607]: https://github.com/auth0/auth0-cli/issues/607
[#616]: https://github.com/auth0/auth0-cli/issues/616
[#536]: https://github.com/auth0/auth0-cli/issues/536
[#532]: https://github.com/auth0/auth0-cli/issues/532
[#546]: https://github.com/auth0/auth0-cli/issues/546
[#597]: https://github.com/auth0/auth0-cli/issues/597
[#617]: https://github.com/auth0/auth0-cli/issues/617
[#618]: https://github.com/auth0/auth0-cli/issues/618
[#612]: https://github.com/auth0/auth0-cli/issues/612
[#595]: https://github.com/auth0/auth0-cli/issues/595
153 changes: 153 additions & 0 deletions MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
# Migration Guide

## Upgrading from v0.x → v1.0

As is to be expected with a major release, there are breaking changes in this update. Please ensure you read this guide
thoroughly and prepare your potential automated workflows before upgrading to the Auth0 CLI v1.

### Breaking Changes

- [Commands Reorganization](#commands-reorganization)
- [Authenticating With Client Credentials](#authenticating-with-client-credentials)
- [JSON Output Flag](#json-output-flag)
- [Reveal Client Secrets Flag](#reveal-client-secrets-flag)
- [Config Command Removal](#config-command-removal)

#### Commands Reorganization

Some commands have been reorganized to establish a more systematic hierarchy.
All other facets of the commands (arguments, flags, etc.) remain the same.

| **Before (v0)** | **After (v1)** |
|----------------------------|-------------------------------------------------|
| `auth0 ips` | `auth0 protection suspicious-ip-throttling ips` |
| `auth0 users unblock` | `auth0 users blocks unblock` |
| `auth0 branding domains` | `auth0 domains` |
| `auth0 branding emails` | `auth0 email templates` |
| `auth0 branding show` | `auth0 universal-login show` |
| `auth0 branding update` | `auth0 universal-login update` |
| `auth0 branding templates` | `auth0 universal-login templates` |
| `auth0 branding texts` | `auth0 universal-login prompts` |

#### Authenticating With Client Credentials

The `auth0 tenants add` command which enabled authenticating to a tenant via client credentials has been consolidated
into the `auth0 login` command. It can be interfaced interactively through the terminal or non-interactively by passing
in the client credentials through the flags.


<table>
<tr>
<th>Before (v0)</th>
<th>After (v1)</th>
</tr>
<tr>
<td>

```sh
# Example:
auth0 tenants add travel0.us.auth0.com \
--client-id tUIvAH7g2ykVM4lGriYEQ6BKV3je24Ka \
--client-secret XXXXXXXXXXXXXXXXXXXXXXXXXXXX
```
</td>
<td>

```sh
# Example:
auth0 login --domain travel0.us.auth0.com \
--client-id tUIvAH7g2ykVM4lGriYEQ6BKV3je24Ka \
--client-secret XXXXXXXXXXXXXXXXXXXXXXXXXXXX
```
</td>
</tr>
</table>

#### JSON Output Flag

The `--format json` flag-value pair has been condensed into the `--json` flag.

| **Before (v0)** | **After (v1)** |
|---------------------------------|--------------------------|
| `auth0 apps list --format json` | `auth0 apps list --json` |

#### Log Streams

In `v0.x`, the creation and updating of log streams through the `auth0 logs streams create` and
`auth0 log streams update` commands facilitated the management of all log stream types with a mass of
type-specific flags. For `v1.x`, the type of log stream is now required as an argument.
This change facilitates more ergonomic flags and type-specific validations.

<table>
<tr>
<th>Before (v0)</th>
<th>After (v1)</th>
</tr>
<tr>
<td>

```sh
# Example:
auth0 logs streams create \
--type datadog \
--name "My Datadog Log Stream" \
--datadog-id us \
--datadog-key 3c0c4965368b6b10f8640dbda46abfdc
```
</td>
<td>

```sh
# Example:
auth0 logs streams create datadog \
--name "My Datadog Log Stream" \
--region us \
--api-key 3c0c4965368b6b10f8640dbda46abfdc
```
</td>
</tr>
</table>

#### Reveal Client Secrets Flag

In `v0.x`, the `auth0 apps create` command has a `--reveal` flag that would reveal the client secrets in the output.
This flag has changed to `--reveal-secrets` to clarify what is being revealed.

| **Before (v0)** | **After (v1)** |
|------------------------------|--------------------------------------|
| `auth0 apps create --reveal` | `auth0 apps create --reveal-secrets` |


#### Config Command Removal

In `v0.x`, the undocumented `auth0 config init` command existed to authenticate with a tenant for E2E testing.
It authenticated with tenants via client credentials which were sourced from environment variables.
This command has been removed in favor of the `auth0 login` command.

<table>
<tr>
<th>Before (v0)</th>
<th>After (v1)</th>
</tr>
<tr>
<td>

```sh
# Example:
AUTH0_CLI_CLIENT_DOMAIN="travel0.us.auth0.com" \
AUTH0_CLI_CLIENT_ID="tUIvPH7g2ykVm4lGriYEQ6BKV3je24Ka" \
AUTH0_CLI_CLIENT_SECRET="XXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
auth0 config init
```
</td>
<td>

```sh
# Example:
auth0 login --domain travel0.us.auth0.com \
--client-id tUIvPH7g2ykVm4lGriYEQ6BKV3je24Ka \
--client-secret XXXXXXXXXXXXXXXXXXXXXXXXXXXX
```
</td>
</tr>
</table>
47 changes: 29 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
<div align="center">
<h1>Auth0 CLI</h1>

[![Release](https://img.shields.io/github/v/release/auth0/auth0-cli?include_prereleases&style=flat-square)](https://github.com/auth0/auth0-cli/releases) [![Build Status](https://img.shields.io/github/actions/workflow/status/auth0/auth0-cli/go.yml?branch=main)](https://github.com/auth0/auth0-cli/actions?query=branch%3Amain) [![Go Report Card](https://goreportcard.com/badge/github.com/auth0/auth0-cli?style=flat-square)](https://goreportcard.com/report/github.com/auth0/auth0-cli) [![License](https://img.shields.io/github/license/auth0/auth0-cli.svg?style=flat-square)](https://github.com/auth0/auth0-cli/blob/main/LICENSE)
[![GoDoc](https://pkg.go.dev/badge/github.com/auth0/auth0-cli.svg)](https://pkg.go.dev/github.com/auth0/auth0-cli)
[![Go Report Card](https://goreportcard.com/badge/github.com/auth0/auth0-cli?style=flat-square)](https://goreportcard.com/report/github.com/auth0/auth0-cli)
[![Release](https://img.shields.io/github/v/release/auth0/auth0-cli?logo=auth0&include_prereleases&style=flat-square)](https://github.com/auth0/auth0-cli/releases)
[![License](https://img.shields.io/github/license/auth0/auth0-cli.svg?logo=fossa&style=flat-square)](https://github.com/auth0/auth0-cli/blob/main/LICENSE)
[![Build Status](https://img.shields.io/github/actions/workflow/status/auth0/auth0-cli/go.yml?branch=main)](https://github.com/auth0/auth0-cli/actions?query=branch%3Amain)

</div>

---

Build, manage and test your [Auth0](https://auth0.com/) integrations from the command line.

![demo](./demo.gif)

## Highlights
## 🎢 Highlights

- **🧪 Test your universal login flow:** Emulate your end users' login experience by running `auth0 test login`.
- **🔍 Troubleshoot in real-time:** Inspect the events of your Auth0 integration as they happen with the `auth0 logs tail` command.
- **🔁 Simplify repetitive tasks:** Create, update, list and delete your Auth0 resources directly from the terminal.

## Table of Contents
## 📜 Table of Contents

- [Installation](#installation)
- [Authenticating to Your Tenant](#authenticating-to-your-tenant)
- [Available Commands](#available-commands)
- [Customization](#customization)
- [Anonymous Analytics](#anonymous-analytics)

## Installation
## 🪛 Installation

### macOS

Expand All @@ -49,6 +55,20 @@ Install via [cURL](https://curl.se/):
```bash
# Binary will be downloaded to "./auth0".
curl -sSfL https://raw.githubusercontent.com/auth0/auth0-cli/main/install.sh | sh -s -- -b .

# To be able to run the binary from any directory
# make sure you move it to a place in your $PATH
# sudo mv ./auth0 /usr/local/bin
```

### Go

Install via [Go](https://go.dev/):

```bash
# Make sure your $GOPATH/bin is exported on your $PATH
# to be able to run the binary from any directory.
go install github.com/auth0/auth0-cli/cmd/auth0@latest
```

### Manual
Expand All @@ -63,15 +83,7 @@ curl -sSfL https://raw.githubusercontent.com/auth0/auth0-cli/main/install.sh | s
> **Note**
> Autocompletion instructions for supported platforms available by running `auth0 completion -h`
### Go

Install via [Go](https://go.dev/):

```bash
go install github.com/auth0/auth0-cli/cmd/auth0@latest
```

## Authenticating to Your Tenant
## 🔐 Authenticating to Your Tenant

Authenticating to your Auth0 tenant is required for most functions of the CLI. It can be initiated by running:

Expand All @@ -87,7 +99,7 @@ There are two ways to authenticate:
> **Warning**
> Authenticating as a user is not supported for **private cloud** tenants. Instead, those users should authenticate with client credentials.
## Available Commands
## 💻 Available Commands

- [auth0 actions](https://auth0.github.io/auth0-cli/auth0_actions.html) - Manage resources for actions
- [auth0 api](https://auth0.github.io/auth0-cli/auth0_api.html) - Makes an authenticated HTTP request to the Auth0 Management API
Expand All @@ -96,7 +108,6 @@ There are two ways to authenticate:
- [auth0 completion](https://auth0.github.io/auth0-cli/auth0_completion.html) - Setup autocomplete features for this CLI on your terminal
- [auth0 domains](https://auth0.github.io/auth0-cli/auth0_domains.html) - Manage custom domains
- [auth0 email](https://auth0.github.io/auth0-cli/auth0_email.html) - Manage email settings
- [auth0 ips](https://auth0.github.io/auth0-cli/auth0_ips.html) - Manage blocked IP addresses
- [auth0 login](https://auth0.github.io/auth0-cli/auth0_login.html) - Authenticate the Auth0 CLI
- [auth0 logout](https://auth0.github.io/auth0-cli/auth0_logout.html) - Log out of a tenant's session
- [auth0 logs](https://auth0.github.io/auth0-cli/auth0_logs.html) - View tenant logs
Expand All @@ -110,7 +121,7 @@ There are two ways to authenticate:
- [auth0 universal-login](https://auth0.github.io/auth0-cli/auth0_universal-login.html) - Manage the Universal Login experience
- [auth0 users](https://auth0.github.io/auth0-cli/auth0_users.html) - Manage resources for users

## Customization
## 🖌️ Customization

To change the text editor used for editing templates, rules, and actions,
set the environment variable `EDITOR` to your preferred editor. Example:
Expand All @@ -121,15 +132,15 @@ export EDITOR="code -w"
export EDITOR="nano"
```

## Anonymized Analytics Disclosure
## 📊 Anonymized Analytics Disclosure

Anonymized data points are collected during the use of this CLI. This data includes the CLI version, operating system, timestamp, and other technical details that do not personally identify you.

Auth0 uses this data to better understand the usage of this tool to prioritize the features, enhancements and fixes that matter most to our users.

To **opt-out** of this collection, set the `AUTH0_CLI_ANALYTICS` environment variable to `false`.

## Feedback
## 🙇 Feedback

### Contributing

Expand Down
12 changes: 0 additions & 12 deletions docs/auth0_ips.md

This file was deleted.

Loading

0 comments on commit 0be9982

Please sign in to comment.