auth0-deploy-cli 8.4.3 → 8.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/lib/context/defaults.js +7 -0
  3. package/lib/context/defaults.js.map +1 -1
  4. package/lib/tools/auth0/handlers/emailProvider.js +3 -3
  5. package/lib/tools/auth0/handlers/emailProvider.js.map +1 -1
  6. package/package.json +2 -2
  7. package/.nyc_output/10fa88b6-c10a-45ce-8cb3-2a8dba4f95d2.json +0 -1
  8. package/.nyc_output/c42a459f-fc58-412c-a675-01cb9f92dcc9.json +0 -1
  9. package/.nyc_output/e49c3dcb-08e8-4563-ba45-9b005a768a65.json +0 -1
  10. package/.nyc_output/processinfo/10fa88b6-c10a-45ce-8cb3-2a8dba4f95d2.json +0 -1
  11. package/.nyc_output/processinfo/c42a459f-fc58-412c-a675-01cb9f92dcc9.json +0 -1
  12. package/.nyc_output/processinfo/e49c3dcb-08e8-4563-ba45-9b005a768a65.json +0 -1
  13. package/.nyc_output/processinfo/index.json +0 -1
  14. package/coverage/lcov-report/base.css +0 -224
  15. package/coverage/lcov-report/block-navigation.js +0 -87
  16. package/coverage/lcov-report/favicon.png +0 -0
  17. package/coverage/lcov-report/index.html +0 -251
  18. package/coverage/lcov-report/prettify.css +0 -1
  19. package/coverage/lcov-report/prettify.js +0 -2
  20. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  21. package/coverage/lcov-report/sorter.js +0 -196
  22. package/coverage/lcov.info +0 -9786
  23. package/docs/authenticating-with-tenant.md +0 -34
  24. package/docs/available-resource-config-formats.md +0 -19
  25. package/docs/configuring-the-deploy-cli.md +0 -180
  26. package/docs/excluding-from-management.md +0 -95
  27. package/docs/how-to-contribute.md +0 -49
  28. package/docs/keyword-replacement.md +0 -83
  29. package/docs/multi-environment-workflow.md +0 -98
  30. package/docs/resource-specific-documentation.md +0 -284
  31. package/docs/terraform-provider.md +0 -20
  32. package/docs/using-as-cli.md +0 -89
  33. package/docs/using-as-node-module.md +0 -114
  34. package/docs/v8_MIGRATION_GUIDE.md +0 -46
  35. package/examples/directory/README.md +0 -167
  36. package/examples/directory/actions/action-example/code.js +0 -4
  37. package/examples/directory/actions/action-example.json +0 -24
  38. package/examples/directory/clients/My SPA.json +0 -40
  39. package/examples/directory/config.json.example +0 -20
  40. package/examples/directory/connections/facebook.json +0 -60
  41. package/examples/directory/database-connections/users/change_email.js +0 -4
  42. package/examples/directory/database-connections/users/change_password.js +0 -4
  43. package/examples/directory/database-connections/users/create.js +0 -4
  44. package/examples/directory/database-connections/users/database.json +0 -20
  45. package/examples/directory/database-connections/users/delete.js +0 -4
  46. package/examples/directory/database-connections/users/get_user.js +0 -4
  47. package/examples/directory/database-connections/users/login.js +0 -4
  48. package/examples/directory/database-connections/users/verify.js +0 -4
  49. package/examples/directory/emails/blocked_account.html +0 -5
  50. package/examples/directory/emails/blocked_account.json +0 -10
  51. package/examples/directory/emails/enrollment_email.html +0 -5
  52. package/examples/directory/emails/enrollment_email.json +0 -8
  53. package/examples/directory/emails/mfa_oob_code.html +0 -5
  54. package/examples/directory/emails/mfa_oob_code.json +0 -8
  55. package/examples/directory/emails/provider.json +0 -10
  56. package/examples/directory/emails/reset_email.html +0 -5
  57. package/examples/directory/emails/reset_email.json +0 -10
  58. package/examples/directory/emails/stolen_credentials.html +0 -5
  59. package/examples/directory/emails/stolen_credentials.json +0 -8
  60. package/examples/directory/emails/verify_email.html +0 -5
  61. package/examples/directory/emails/verify_email.json +0 -10
  62. package/examples/directory/emails/verify_email_by_code.html +0 -5
  63. package/examples/directory/emails/verify_email_by_code.json +0 -8
  64. package/examples/directory/emails/welcome_email.html +0 -5
  65. package/examples/directory/emails/welcome_email.json +0 -8
  66. package/examples/directory/grants/m2m_myapp_api.json +0 -7
  67. package/examples/directory/guardian/factors/email.json +0 -4
  68. package/examples/directory/guardian/factors/otp.json +0 -4
  69. package/examples/directory/guardian/factors/push-notification.json +0 -4
  70. package/examples/directory/guardian/factors/sms.json +0 -4
  71. package/examples/directory/guardian/phoneFactorMessageTypes.json +0 -6
  72. package/examples/directory/guardian/phoneFactorSelectedProvider.json +0 -3
  73. package/examples/directory/guardian/policies.json +0 -5
  74. package/examples/directory/guardian/providers/sms-twilio.json +0 -7
  75. package/examples/directory/guardian/templates/sms.json +0 -5
  76. package/examples/directory/hooks/client-credentials-exchange.js +0 -22
  77. package/examples/directory/hooks/client-credentials-exchange.json +0 -12
  78. package/examples/directory/pages/login.html +0 -6
  79. package/examples/directory/pages/login.json +0 -4
  80. package/examples/directory/pages/password_reset.html +0 -6
  81. package/examples/directory/pages/password_reset.json +0 -4
  82. package/examples/directory/prompts/custom-text.json +0 -9
  83. package/examples/directory/prompts/prompts.json +0 -6
  84. package/examples/directory/prompts/screenRenderSettings/login-id_login-id.json +0 -33
  85. package/examples/directory/prompts/screenRenderSettings/signup-id_signup-id.json +0 -20
  86. package/examples/directory/resource-servers/My API.json +0 -19
  87. package/examples/directory/roles/Admin.json +0 -14
  88. package/examples/directory/roles/User.json +0 -10
  89. package/examples/directory/rules/Enrich-Identity-Token.js +0 -10
  90. package/examples/directory/rules/Enrich-Identity-Token.json +0 -7
  91. package/examples/directory/rules-configs/SOME_SECRET.json +0 -4
  92. package/examples/directory/tenant.json +0 -8
  93. package/examples/directory/triggers/triggers.json +0 -18
  94. package/examples/yaml/README.md +0 -111
  95. package/examples/yaml/actions/action-example/code.js +0 -4
  96. package/examples/yaml/config.json.example +0 -20
  97. package/examples/yaml/databases/users/change_email.js +0 -4
  98. package/examples/yaml/databases/users/change_password.js +0 -4
  99. package/examples/yaml/databases/users/create.js +0 -4
  100. package/examples/yaml/databases/users/delete.js +0 -4
  101. package/examples/yaml/databases/users/get_user.js +0 -4
  102. package/examples/yaml/databases/users/login.js +0 -4
  103. package/examples/yaml/databases/users/verify.js +0 -4
  104. package/examples/yaml/emails/change_email.html +0 -5
  105. package/examples/yaml/hooks/client-credentials-exchange.js +0 -22
  106. package/examples/yaml/pages/error_page.html +0 -6
  107. package/examples/yaml/pages/guardian_multifactor.html +0 -6
  108. package/examples/yaml/pages/login.html +0 -6
  109. package/examples/yaml/pages/password_reset.html +0 -6
  110. package/examples/yaml/prompts/screenRenderSettings/login-id_login-id.json +0 -33
  111. package/examples/yaml/prompts/screenRenderSettings/signup-id_signup-id.json +0 -20
  112. package/examples/yaml/rules/enrich_tokens.js +0 -10
  113. package/examples/yaml/tenant.yaml +0 -202
@@ -1,6 +0,0 @@
1
- <html>
2
- <body>
3
- <h1>This is just an example, go update your password reset page :)</h1>
4
- <h2>Env is @@ENV@@</h2>
5
- </body>
6
- </html>
@@ -1,4 +0,0 @@
1
- {
2
- "name": "password_reset",
3
- "enabled": false
4
- }
@@ -1,9 +0,0 @@
1
- {
2
- "en": {
3
- "login-id": {
4
- "login-id": {
5
- "invalid-email-format": "Email is not valid."
6
- }
7
- }
8
- }
9
- }
@@ -1,6 +0,0 @@
1
- {
2
- "universal_login_experience": "new",
3
- "identifier_first": false,
4
- "webauthn_platform_first_factor": true,
5
- "enable_ulp_wcag_compliance": false
6
- }
@@ -1,33 +0,0 @@
1
- {
2
- "prompt": "login-id",
3
- "screen": "login-id",
4
- "rendering_mode": "advanced",
5
- "context_configuration": [
6
- "branding.settings",
7
- "branding.themes.default"
8
- ],
9
- "default_head_tags_disabled": true,
10
- "head_tags": [
11
- {
12
- "tag": "script",
13
- "attributes": {
14
- "src": "http://127.0.0.1:8090/index.js",
15
- "defer": true
16
- }
17
- },
18
- {
19
- "tag": "link",
20
- "attributes": {
21
- "rel": "stylesheet",
22
- "href": "http://127.0.0.1:8090/index.css"
23
- }
24
- },
25
- {
26
- "tag": "meta",
27
- "attributes": {
28
- "name": "viewport",
29
- "content": "width=device-width, initial-scale=1"
30
- }
31
- }
32
- ]
33
- }
@@ -1,20 +0,0 @@
1
- {
2
- "prompt": "signup-id",
3
- "screen": "signup-id",
4
- "rendering_mode": "advanced",
5
- "context_configuration": [],
6
- "default_head_tags_disabled": false,
7
- "head_tags": [
8
- {
9
- "tag": "script",
10
- "attributes": {
11
- "src": "URL_TO_YOUR_ASSET",
12
- "async": true,
13
- "defer": true,
14
- "integrity": [
15
- "ASSET_SHA"
16
- ]
17
- }
18
- }
19
- ]
20
- }
@@ -1,19 +0,0 @@
1
- {
2
- "name": "My API",
3
- "identifier": "https://##ENV##.myapp.com/api/v1",
4
- "allow_offline_access": false,
5
- "skip_consent_for_verifiable_first_party_clients": true,
6
- "token_lifetime": 86400,
7
- "token_lifetime_for_web": 7200,
8
- "signing_alg": "RS256",
9
- "scopes": [
10
- {
11
- "value": "write:messages",
12
- "description": "write messages"
13
- },
14
- {
15
- "value": "read:messages",
16
- "description": "read:messages"
17
- }
18
- ]
19
- }
@@ -1,14 +0,0 @@
1
- {
2
- "name": "Admin",
3
- "description": "App Admin",
4
- "permissions": [
5
- {
6
- "permission_name": "write:messages",
7
- "resource_server_identifier": "https://##ENV##.myapp.com/api/v1"
8
- },
9
- {
10
- "permission_name": "read:messages",
11
- "resource_server_identifier": "https://##ENV##.myapp.com/api/v1"
12
- }
13
- ]
14
- }
@@ -1,10 +0,0 @@
1
- {
2
- "name": "User",
3
- "description": "App User",
4
- "permissions": [
5
- {
6
- "permission_name": "read:messages",
7
- "resource_server_identifier": "https://##ENV##.myapp.com/api/v1"
8
- }
9
- ]
10
- }
@@ -1,10 +0,0 @@
1
- function (user, context, callback) {
2
- const env = @@ENV@@;
3
-
4
- console.log(`env is ${env}`);
5
-
6
- // Add Env to Token
7
- context.idToken['https://myapp.com/env'] = @@ENV@@;
8
-
9
- callback(new Error(`This is just an example from auth0-deploy-cli, don\'t use this rule!`), user, context);
10
- }
@@ -1,7 +0,0 @@
1
- {
2
- "enabled": true,
3
- "name": "Enrich-Identity-Token",
4
- "order": 1,
5
- "stage": "login_success",
6
- "script": "./Enrich-Identity-Token.js"
7
- }
@@ -1,4 +0,0 @@
1
- {
2
- "key": "THISDATA_API_KEY",
3
- "value": "##MY_SECRET##"
4
- }
@@ -1,8 +0,0 @@
1
- {
2
- "friendly_name": "My Company",
3
- "support_email": "support@company.com",
4
- "session_lifetime": 168,
5
- "default_directory": "users",
6
- "sandbox_version": "8",
7
- "idle_session_lifetime": 72
8
- }
@@ -1,18 +0,0 @@
1
- {
2
- "post-login": [
3
- {
4
- "action_name": "action-example",
5
- "display_name": "action-example"
6
- }
7
- ],
8
- "credentials-exchange": [],
9
- "pre-user-registration": [],
10
- "post-user-registration": [],
11
- "post-change-password": [],
12
- "send-phone-message": [
13
- {
14
- "action_name": "ldoorz",
15
- "display_name": "ldoorz"
16
- }
17
- ]
18
- }
@@ -1,111 +0,0 @@
1
- # Auth0 Deploy CLI using YAML
2
-
3
- This README will document how to use the YAML Option of the Auth0-deploy-cli tool. Please refer to the main project [README.md](../../README.md) for more information on the Auth0 Deploy CLI.
4
-
5
- # Overview
6
- The YAML option supports exporting and importing the Auth0 tenant configuration via a YAML file.
7
-
8
- For more information on YAML please refer to [http://yaml.org/](http://yaml.org/)
9
-
10
- ## Example Export
11
- You can export your current tenant configuration. For example the following command will export your tenant configuration.
12
-
13
- `a0deploy export -c config.json -f yaml -o path/to/export`
14
-
15
- > NOTE: The config value `AUTH0_EXPORT_IDENTIFIERS: true` (or `--export_ids` option) can be used to export the identifier fields to the Auth0 objects. This means you won't be able to import these objects as the tool cannot find the existing objects by their id.
16
-
17
- > NOTE: Some of the settings cannot be exported for example emailProvider credentials, rulesConfigs values and others. After export you may need to update the `tenant.yaml` values if you experience schema errors on import.
18
-
19
- ## Example Import
20
- Please refer to [tenant.yaml](tenant.yaml) for an example configuration.
21
-
22
- ### Instructions
23
-
24
- 1. Copy config.json.example and fill out details
25
- 2. Run deploy
26
- ```bash
27
- a0deploy import -c config.json -i tenant.yaml
28
- ```
29
-
30
- # Usage
31
-
32
- ## Config
33
- The config will need the client ID and secret from your newly created client (the client is named `auth0-deploy-cli-extension` if you used the extension).
34
-
35
- You can either set environment variables (ie in your terminal) or place the values in a config file anywhere on the filesystem.
36
-
37
- > NOTE: By default the tool will also merge in your current environment variables and override the config.json which have the same top key. You can disable this via the command line with the `--no-env` option.
38
-
39
- Here is the example of a config.json:
40
-
41
- ```json
42
- {
43
- "AUTH0_DOMAIN": "<your auth0 domain (e.g. fabrikam-dev.auth0.com) >",
44
- "AUTH0_CLIENT_SECRET": "<your deploy client secret>",
45
- "AUTH0_CLIENT_ID": "<your deploy client ID>",
46
- "AUTH0_ALLOW_DELETE": false,
47
- "AUTH0_KEYWORD_REPLACE_MAPPINGS": {
48
- "YOUR_ARRAY_KEY": [
49
- "http://localhost:8080",
50
- "https://somedomain.com"
51
- ],
52
- "YOUR_STRING_KEY": "some environment specific string"
53
- },
54
- "INCLUDED_PROPS": {
55
- "clients": [ "client_secret" ]
56
- },
57
- "EXCLUDED_PROPS": {
58
- "connections": [ "options.client_secret" ]
59
- },
60
- "AUTH0_EXCLUDED_RULES": [ "auth0-account-link-extension" ],
61
- "AUTH0_EXCLUDED_CLIENTS": [ "auth0-account-link" ],
62
- "AUTH0_EXCLUDED_RESOURCE_SERVERS": [ "SSO Dashboard API" ],
63
- "AUTH0_EXCLUDED_DEFAULTS": ["emailProvider"]
64
- }
65
- ```
66
-
67
- ## Environment Variables and AUTH0_KEYWORD_REPLACE_MAPPINGS
68
- The `auth0-deploy-cli` supports environment variables replacements, also known as mappings. This means you can deploy the same Auth0 Tenant configuration across your environments (i.e. dev, uat, staging, and prod). The tool will automatically inject the right values for each environment (i.e callback urls).
69
-
70
- Environment variables can be set on the terminal and within the `config.json`. At run time the variables defined in your terminal and `config.json` will be merged. You can disable this via the command line with the `--no-env` option. The terminal variables will take priority over `config.json`
71
-
72
- There are two ways to use the keyword mappings in your Auth0 Tenant configuration files. You can inject values using `@@key@@` or `##key##`.
73
-
74
- If you use the `@` symbols, it will do a JSON.stringify on your value before replacing it. So if it is a string it will add quotes, if it is an array or object it will add braces.
75
-
76
- If you use the `#` symbol instead, it will do a literal replacement. It will not add quotes or brackets.
77
-
78
- For example, you could specify a different JWT timeout in your dev environment then prod for testing and a different environment URL:
79
-
80
- Client.json:
81
- ```json
82
- {
83
- ...
84
- "callbacks": [
85
- "##ENVIRONMENT_URL##/auth/callback"
86
- ],
87
- "jwt_configuration": {
88
- "lifetime_in_seconds": @@JWT_TIMEOUT@@,
89
- "secret_encoded": true
90
- }
91
- ...
92
- }
93
- ```
94
-
95
- Dev Config.json:
96
- ```json
97
- "AUTH0_KEYWORD_REPLACE_MAPPINGS": {
98
- "ENVIRONMENT_URL": "http://dev.fabrikam.com",
99
- "JWT_TIMEOUT": 120,
100
- ...
101
- }
102
- ```
103
-
104
- Prod Config.json:
105
- ```json
106
- "AUTH0_KEYWORD_REPLACE_MAPPINGS": {
107
- "ENVIRONMENT_URL": "http://fabrikam.com",
108
- "JWT_TIMEOUT": 3600,
109
- ...
110
- }
111
- ```
@@ -1,4 +0,0 @@
1
- /** @type {PostLoginAction} */
2
- module.exports = async (event, context) => {
3
- return {};
4
- };
@@ -1,20 +0,0 @@
1
- {
2
- "AUTH0_DOMAIN": "<YOUR_TENANT>.<YOUR_REGION>.auth0.com",
3
- "AUTH0_CLIENT_ID": "<client_id>",
4
- "AUTH0_CLIENT_SECRET": "<client_secret>",
5
- "AUTH0_KEYWORD_REPLACE_MAPPINGS": {
6
- "AUTH0_TENANT_NAME": "<NAME>",
7
- "ENV": "DEV"
8
- },
9
- "AUTH0_ALLOW_DELETE": false,
10
- "INCLUDED_PROPS": {
11
- "clients": [ "client_secret" ]
12
- },
13
- "AUTH0_EXCLUDED_RULES": [
14
- "rule-1-name",
15
- "rule-2-name"
16
- ],
17
- "EXCLUDED_PROPS": {
18
- "connections": [ "options.client_secret" ]
19
- }
20
- }
@@ -1,4 +0,0 @@
1
- function changeEmail(email, callback) {
2
- const msg = 'Please implement the change email script for this database connection';
3
- return callback(new Error(msg));
4
- }
@@ -1,4 +0,0 @@
1
- function changePassword (email, newPassword, callback) {
2
- const msg = 'Please implement the change password script for this database connection';
3
- return callback(new Error(msg));
4
- }
@@ -1,4 +0,0 @@
1
- function login(user, callback) {
2
- const msg = 'Please implement the create script for this database connection';
3
- return callback(new Error(msg));
4
- }
@@ -1,4 +0,0 @@
1
- function remove (id, callback) {
2
- const msg = 'Please implement the delete script for this database connection';
3
- return callback(new Error(msg));
4
- }
@@ -1,4 +0,0 @@
1
- function getUser(email, callback) {
2
- const msg = 'Please implement the get user script for this database connection';
3
- return callback(new Error(msg));
4
- }
@@ -1,4 +0,0 @@
1
- function login(email, password, callback) {
2
- const msg = 'Please implement the login script for this database connection';
3
- return callback(new Error(msg));
4
- }
@@ -1,4 +0,0 @@
1
- function login(email, callback) {
2
- const msg = 'Please implement the verify script for this database connection';
3
- return callback(new Error(msg));
4
- }
@@ -1,5 +0,0 @@
1
- <html>
2
- <body>
3
- test email
4
- </body>
5
- </html>
@@ -1,22 +0,0 @@
1
- /**
2
- @param {object} client - information about the client
3
- @param {string} client.name - name of client
4
- @param {string} client.id - client id
5
- @param {string} client.tenant - Auth0 tenant name
6
- @param {object} client.metadata - client metadata
7
- @param {array|undefined} scope - array of strings representing the scope claim or undefined
8
- @param {string} audience - token's audience claim
9
- @param {object} context - additional authorization context
10
- @param {object} context.webtask - webtask context
11
- @param {function} cb - function (error, accessTokenClaims)
12
- */
13
- module.exports = function(client, scope, audience, context, cb) {
14
- var access_token = {};
15
- access_token.scope = scope;
16
-
17
- // Modify scopes or add extra claims
18
- // access_token['https://example.com/claim'] = 'bar';
19
- // access_token.scope.push('extra');
20
-
21
- cb(null, access_token);
22
- };
@@ -1,6 +0,0 @@
1
- <html>
2
- <body>
3
- <h1>This is just an example, go update your error page :)</h1>
4
- <h2>Env is @@ENV@@</h2>
5
- </body>
6
- </html>
@@ -1,6 +0,0 @@
1
- <html>
2
- <body>
3
- <h1>This is just an example, go update your MFA page :)</h1>
4
- <h2>Env is @@ENV@@</h2>
5
- </body>
6
- </html>
@@ -1,6 +0,0 @@
1
- <html>
2
- <body>
3
- <h1>This is just an example, go update your login page :)</h1>
4
- <h2>Env is @@ENV@@</h2>
5
- </body>
6
- </html>
@@ -1,6 +0,0 @@
1
- <html>
2
- <body>
3
- <h1>This is just an example, go update your password reset page :)</h1>
4
- <h2>Env is @@ENV@@</h2>
5
- </body>
6
- </html>
@@ -1,33 +0,0 @@
1
- {
2
- "prompt": "login-id",
3
- "screen": "login-id",
4
- "rendering_mode": "advanced",
5
- "context_configuration": [
6
- "branding.settings",
7
- "branding.themes.default"
8
- ],
9
- "default_head_tags_disabled": true,
10
- "head_tags": [
11
- {
12
- "tag": "script",
13
- "attributes": {
14
- "src": "http://127.0.0.1:8090/index.js",
15
- "defer": true
16
- }
17
- },
18
- {
19
- "tag": "link",
20
- "attributes": {
21
- "rel": "stylesheet",
22
- "href": "http://127.0.0.1:8090/index.css"
23
- }
24
- },
25
- {
26
- "tag": "meta",
27
- "attributes": {
28
- "name": "viewport",
29
- "content": "width=device-width, initial-scale=1"
30
- }
31
- }
32
- ]
33
- }
@@ -1,20 +0,0 @@
1
- {
2
- "prompt": "signup-id",
3
- "screen": "signup-id",
4
- "rendering_mode": "advanced",
5
- "context_configuration": [],
6
- "default_head_tags_disabled": false,
7
- "head_tags": [
8
- {
9
- "tag": "script",
10
- "attributes": {
11
- "src": "URL_TO_YOUR_ASSET",
12
- "async": true,
13
- "defer": true,
14
- "integrity": [
15
- "ASSET_SHA"
16
- ]
17
- }
18
- }
19
- ]
20
- }
@@ -1,10 +0,0 @@
1
- function (user, context, callback) {
2
- const env = @@ENV@@;
3
-
4
- console.log(`env is ${env}`);
5
-
6
- // Add Env to Token
7
- context.idToken['https://myapp.com/env'] = @@ENV@@;
8
-
9
- callback(new Error(`This is just an example from auth0-deploy-cli, don\'t use this rule!`), user, context);
10
- }