Skip to content

Commit 65ab9d2

Browse files
kushalshit27frederikprijckadamjmcgrathwillvedd
authored
Upgrading node-auth0 from v3 to v4 (#953)
* 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]>
1 parent f50106f commit 65ab9d2

File tree

123 files changed

+14386
-18774
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+14386
-18774
lines changed

CONTRIBUTING.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
## Commits
2+
23
All commits should be signed to enhance security, authorship, trust and compliance.
34

45
[About commit signature verification](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification)

docs/configuring-the-deploy-cli.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ String. Separate value from audience value while retrieving an access token for
149149

150150
### `AUTH0_EXCLUDED_RULES`
151151

152-
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).
152+
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).
153153

154154
### `AUTH0_EXCLUDED_CLIENTS`
155155

docs/excluding-from-management.md

-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ For non-set-based resource configuration like tenant, email provider and brandin
8585
#### Example of emptiness
8686

8787
```yaml
88-
hooks: [] # Empty hooks
8988
connections: [] # Empty connections
9089
tenant: {} # Effectively a no-op, cannot delete tenant
9190
emailProvider: {} # Will delete email provider

docs/resource-specific-documentation.md

+11-8
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ Folder structure when in YAML mode.
5757

5858
./databases/
5959
/Username-Password-Authentication
60-
/change_password.js
61-
/create.js
62-
/delete.js
63-
/get_user.js
64-
/login.js
65-
/verify.js
60+
/change_password.js
61+
/create.js
62+
/delete.js
63+
/get_user.js
64+
/login.js
65+
/verify.js
6666
./tenant.yaml
6767
```
6868
@@ -98,8 +98,8 @@ Folder structure when in directory mode.
9898
./verify.js
9999
```
100100

101-
102101
Contents of `database.json`
102+
103103
```json
104104
{
105105
"options": {
@@ -169,8 +169,8 @@ Folder structure when in directory mode.
169169
./password_reset.json
170170
```
171171

172-
173172
Contents of `login.json`
173+
174174
```json
175175
{
176176
"name": "login",
@@ -180,6 +180,7 @@ Contents of `login.json`
180180
```
181181

182182
Contents of `error_page.json`
183+
183184
```json
184185
{
185186
"html": "./error_page.html",
@@ -190,6 +191,7 @@ Contents of `error_page.json`
190191
```
191192

192193
Contents of `guardian_multifactor.json`
194+
193195
```json
194196
{
195197
"enabled": true,
@@ -199,6 +201,7 @@ Contents of `guardian_multifactor.json`
199201
```
200202

201203
Contents of `password_reset.json`
204+
202205
```json
203206
{
204207
"enabled": true,

docs/v8_MIGRATION_GUIDE.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# V8 Migration Guide
2+
3+
Guide to migrating from `7.x` to `8.x`
4+
5+
- [General](#general)
6+
- [Node 18 or newer is required](#node-18-or-newer-is-required)
7+
- [Auth0 V4 Migration Guide](https://github.com/auth0/node-auth0/blob/master/v4_MIGRATION_GUIDE.md)
8+
- [Management Resources](#management-resources)
9+
- [EmailProvider](#emailProvider)
10+
- [Migrations](#migrations)
11+
12+
## General
13+
14+
### Node 18 or newer is required
15+
16+
Node 18 LTS and newer LTS releases are supported.
17+
18+
## Management Resources
19+
20+
| Resource | Change | Description |
21+
|---------------|------------------|-----------------------------------------------|
22+
| emailProvider | delete operation | Delete operation is deprecated on auth0 `4.x` |
23+
| migrations | removed support | Not supported on auth0 `4.x` |
24+
25+
#### Note: Other resources from `7.x` are not affected and no changes are required.
26+
27+
#### emailProvider
28+
29+
The `delete` operation on the `emailProvider` resource will disable the email provider instead of deleting it.
30+
This is because the email provider deletion operation is deprecated on auth0 `4.x`. User can disable the email provider
31+
by email provider setting the `enabled` property to `false` from the configuration file.
32+
33+
```yaml
34+
emailProvider:
35+
# other properties
36+
enabled: false
37+
```
38+
39+
Rest of the operations on emailProvider resource will work the same as `7.x`.
40+
41+
#### migrations
42+
43+
The `migrations` resource is not supported on auth0 `4.x`. It's recommended to remove the `migrations` resource from the
44+
configuration file. If it's not removed, the deploy CLI will ignore the `migrations` resource for operations.
45+
46+

examples/directory/README.md

-7
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@ repository =>
4040
resource-servers
4141
resource_server1.json
4242
resource_server2.json
43-
rules
44-
rule1.js
45-
rule1.json
46-
rule2.js
47-
rules-configs
48-
env_param1.json
49-
some_secret1.json
5043
guardian
5144
factors
5245
sms.json

examples/directory/config.json.example

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
"ENV": "DEV"
88
},
99
"AUTH0_ALLOW_DELETE": false,
10+
"INCLUDED_PROPS": {
11+
"clients": [ "client_secret" ]
12+
},
1013
"AUTH0_EXCLUDED_RULES": [
1114
"rule-1-name",
1215
"rule-2-name"
1316
],
14-
"INCLUDED_PROPS": {
15-
"clients": [ "client_secret" ]
16-
},
1717
"EXCLUDED_PROPS": {
1818
"connections": [ "options.client_secret" ]
1919
}

examples/yaml/config.json.example

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"AUTH0_DOMAIN": "<YOUR_TENANT>.<YOUR_REGION>.auth0.com",
2+
"AUTH0_DOMAIN": "<YOUR_TENANT>.<YOUR_REGION>.auth0.com",
33
"AUTH0_CLIENT_ID": "<client_id>",
44
"AUTH0_CLIENT_SECRET": "<client_secret>",
55
"AUTH0_KEYWORD_REPLACE_MAPPINGS": {
66
"AUTH0_TENANT_NAME": "<NAME>",
77
"ENV": "DEV"
88
},
99
"AUTH0_ALLOW_DELETE": false,
10+
"INCLUDED_PROPS": {
11+
"clients": [ "client_secret" ]
12+
},
1013
"AUTH0_EXCLUDED_RULES": [
1114
"rule-1-name",
1215
"rule-2-name"
1316
],
14-
"INCLUDED_PROPS": {
15-
"clients": [ "client_secret" ]
16-
},
1717
"EXCLUDED_PROPS": {
1818
"connections": [ "options.client_secret" ]
1919
}

examples/yaml/tenant.yaml

-21
Original file line numberDiff line numberDiff line change
@@ -63,27 +63,6 @@ connections:
6363
# Add other connection settings (https://auth0.com/docs/api/management/v2#!/Connections/post_connections)
6464

6565

66-
rules:
67-
- name: "Common-Functions"
68-
order: 10
69-
script: "rules/enrich_tokens.js"
70-
71-
rulesConfigs:
72-
# Key/Value pairs for Rule configuration settings
73-
- key: "SOME_SECRET"
74-
value: 'some_key'
75-
76-
hooks:
77-
- name: "Client Credentials Exchange"
78-
triggerId: "credentials-exchange"
79-
enabled: true
80-
secrets:
81-
api-key: "my custom api key"
82-
dependencies:
83-
bcrypt: "3.0.6"
84-
script: "hooks/client-credentials-exchange.js"
85-
86-
8766
resourceServers:
8867
-
8968
name: "My API"

0 commit comments

Comments
 (0)