Skip to content

Commit

Permalink
Upgrading node-auth0 from v3 to v4 (#953)
Browse files Browse the repository at this point in the history
* Upgrade auth0 to v4

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: frederikprijck <[email protected]>
Co-authored-by: Adam Mcgrath <[email protected]>
Co-authored-by: Will Vedder <[email protected]>
  • Loading branch information
4 people authored Oct 21, 2024
1 parent f50106f commit 65ab9d2
Show file tree
Hide file tree
Showing 123 changed files with 14,386 additions and 18,774 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Commits

All commits should be signed to enhance security, authorship, trust and compliance.

[About commit signature verification](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification)
Expand Down
2 changes: 1 addition & 1 deletion docs/configuring-the-deploy-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ String. Separate value from audience value while retrieving an access token for

### `AUTH0_EXCLUDED_RULES`

Array of strings. Excludes the management of specific rules by name. **Note:** This configuration may be subject to deprecation in the future. See: [excluding resources from management](excluding-from-management.md).
Array of strings. Excludes the management of specific rules by ID. **Note:** This configuration may be subject to deprecation in the future. See: [excluding resources from management](excluding-from-management.md).

### `AUTH0_EXCLUDED_CLIENTS`

Expand Down
1 change: 0 additions & 1 deletion docs/excluding-from-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ For non-set-based resource configuration like tenant, email provider and brandin
#### Example of emptiness

```yaml
hooks: [] # Empty hooks
connections: [] # Empty connections
tenant: {} # Effectively a no-op, cannot delete tenant
emailProvider: {} # Will delete email provider
Expand Down
19 changes: 11 additions & 8 deletions docs/resource-specific-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ Folder structure when in YAML mode.

./databases/
/Username-Password-Authentication
/change_password.js
/create.js
/delete.js
/get_user.js
/login.js
/verify.js
/change_password.js
/create.js
/delete.js
/get_user.js
/login.js
/verify.js
./tenant.yaml
```
Expand Down Expand Up @@ -98,8 +98,8 @@ Folder structure when in directory mode.
./verify.js
```


Contents of `database.json`

```json
{
"options": {
Expand Down Expand Up @@ -169,8 +169,8 @@ Folder structure when in directory mode.
./password_reset.json
```


Contents of `login.json`

```json
{
"name": "login",
Expand All @@ -180,6 +180,7 @@ Contents of `login.json`
```

Contents of `error_page.json`

```json
{
"html": "./error_page.html",
Expand All @@ -190,6 +191,7 @@ Contents of `error_page.json`
```

Contents of `guardian_multifactor.json`

```json
{
"enabled": true,
Expand All @@ -199,6 +201,7 @@ Contents of `guardian_multifactor.json`
```

Contents of `password_reset.json`

```json
{
"enabled": true,
Expand Down
46 changes: 46 additions & 0 deletions docs/v8_MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# V8 Migration Guide

Guide to migrating from `7.x` to `8.x`

- [General](#general)
- [Node 18 or newer is required](#node-18-or-newer-is-required)
- [Auth0 V4 Migration Guide](https://github.com/auth0/node-auth0/blob/master/v4_MIGRATION_GUIDE.md)
- [Management Resources](#management-resources)
- [EmailProvider](#emailProvider)
- [Migrations](#migrations)

## General

### Node 18 or newer is required

Node 18 LTS and newer LTS releases are supported.

## Management Resources

| Resource | Change | Description |
|---------------|------------------|-----------------------------------------------|
| emailProvider | delete operation | Delete operation is deprecated on auth0 `4.x` |
| migrations | removed support | Not supported on auth0 `4.x` |

#### Note: Other resources from `7.x` are not affected and no changes are required.

#### emailProvider

The `delete` operation on the `emailProvider` resource will disable the email provider instead of deleting it.
This is because the email provider deletion operation is deprecated on auth0 `4.x`. User can disable the email provider
by email provider setting the `enabled` property to `false` from the configuration file.

```yaml
emailProvider:
# other properties
enabled: false
```
Rest of the operations on emailProvider resource will work the same as `7.x`.

#### migrations

The `migrations` resource is not supported on auth0 `4.x`. It's recommended to remove the `migrations` resource from the
configuration file. If it's not removed, the deploy CLI will ignore the `migrations` resource for operations.


7 changes: 0 additions & 7 deletions examples/directory/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@ repository =>
resource-servers
resource_server1.json
resource_server2.json
rules
rule1.js
rule1.json
rule2.js
rules-configs
env_param1.json
some_secret1.json
guardian
factors
sms.json
Expand Down
6 changes: 3 additions & 3 deletions examples/directory/config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
"ENV": "DEV"
},
"AUTH0_ALLOW_DELETE": false,
"INCLUDED_PROPS": {
"clients": [ "client_secret" ]
},
"AUTH0_EXCLUDED_RULES": [
"rule-1-name",
"rule-2-name"
],
"INCLUDED_PROPS": {
"clients": [ "client_secret" ]
},
"EXCLUDED_PROPS": {
"connections": [ "options.client_secret" ]
}
Expand Down
8 changes: 4 additions & 4 deletions examples/yaml/config.json.example
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"AUTH0_DOMAIN": "<YOUR_TENANT>.<YOUR_REGION>.auth0.com",
"AUTH0_DOMAIN": "<YOUR_TENANT>.<YOUR_REGION>.auth0.com",
"AUTH0_CLIENT_ID": "<client_id>",
"AUTH0_CLIENT_SECRET": "<client_secret>",
"AUTH0_KEYWORD_REPLACE_MAPPINGS": {
"AUTH0_TENANT_NAME": "<NAME>",
"ENV": "DEV"
},
"AUTH0_ALLOW_DELETE": false,
"INCLUDED_PROPS": {
"clients": [ "client_secret" ]
},
"AUTH0_EXCLUDED_RULES": [
"rule-1-name",
"rule-2-name"
],
"INCLUDED_PROPS": {
"clients": [ "client_secret" ]
},
"EXCLUDED_PROPS": {
"connections": [ "options.client_secret" ]
}
Expand Down
21 changes: 0 additions & 21 deletions examples/yaml/tenant.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,27 +63,6 @@ connections:
# Add other connection settings (https://auth0.com/docs/api/management/v2#!/Connections/post_connections)


rules:
- name: "Common-Functions"
order: 10
script: "rules/enrich_tokens.js"

rulesConfigs:
# Key/Value pairs for Rule configuration settings
- key: "SOME_SECRET"
value: 'some_key'

hooks:
- name: "Client Credentials Exchange"
triggerId: "credentials-exchange"
enabled: true
secrets:
api-key: "my custom api key"
dependencies:
bcrypt: "3.0.6"
script: "hooks/client-credentials-exchange.js"


resourceServers:
-
name: "My API"
Expand Down
Loading

0 comments on commit 65ab9d2

Please sign in to comment.