@simulacrum/auth0-simulator 0.9.0 → 0.10.1

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 (105) hide show
  1. package/README.md +28 -206
  2. package/bin/start.js +14 -0
  3. package/dist/auth/constants.d.ts.map +1 -1
  4. package/dist/auth/constants.js.map +1 -1
  5. package/dist/auth/date.d.ts.map +1 -1
  6. package/dist/auth/jwt.d.ts +1 -1
  7. package/dist/auth/jwt.d.ts.map +1 -1
  8. package/dist/auth/jwt.js +5 -5
  9. package/dist/auth/jwt.js.map +1 -1
  10. package/dist/auth/refresh-token.d.ts +2 -2
  11. package/dist/auth/refresh-token.d.ts.map +1 -1
  12. package/dist/auth/refresh-token.js +7 -8
  13. package/dist/auth/refresh-token.js.map +1 -1
  14. package/dist/config/get-config.d.ts +6 -6
  15. package/dist/config/get-config.d.ts.map +1 -1
  16. package/dist/config/get-config.js +10 -10
  17. package/dist/config/get-config.js.map +1 -1
  18. package/dist/handlers/auth0-handlers.d.ts +6 -10
  19. package/dist/handlers/auth0-handlers.d.ts.map +1 -1
  20. package/dist/handlers/auth0-handlers.js +96 -70
  21. package/dist/handlers/auth0-handlers.js.map +1 -1
  22. package/dist/handlers/index.d.ts +5 -0
  23. package/dist/handlers/index.d.ts.map +1 -0
  24. package/dist/handlers/index.js +43 -0
  25. package/dist/handlers/index.js.map +1 -0
  26. package/dist/handlers/login-redirect.d.ts +2 -2
  27. package/dist/handlers/login-redirect.d.ts.map +1 -1
  28. package/dist/handlers/login-redirect.js.map +1 -1
  29. package/dist/handlers/oauth-handlers.d.ts +10 -9
  30. package/dist/handlers/oauth-handlers.d.ts.map +1 -1
  31. package/dist/handlers/oauth-handlers.js +56 -50
  32. package/dist/handlers/oauth-handlers.js.map +1 -1
  33. package/dist/handlers/openid-handlers.d.ts +4 -4
  34. package/dist/handlers/openid-handlers.d.ts.map +1 -1
  35. package/dist/handlers/openid-handlers.js +10 -10
  36. package/dist/handlers/openid-handlers.js.map +1 -1
  37. package/dist/handlers/url.d.ts.map +1 -1
  38. package/dist/handlers/url.js +1 -1
  39. package/dist/handlers/url.js.map +1 -1
  40. package/dist/handlers/utils.d.ts +11 -4
  41. package/dist/handlers/utils.d.ts.map +1 -1
  42. package/dist/handlers/utils.js +5 -4
  43. package/dist/handlers/utils.js.map +1 -1
  44. package/dist/handlers/web-message.d.ts +1 -1
  45. package/dist/handlers/web-message.d.ts.map +1 -1
  46. package/dist/handlers/web-message.js +3 -3
  47. package/dist/handlers/web-message.js.map +1 -1
  48. package/dist/index.d.ts +16 -18
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +22 -125
  51. package/dist/index.js.map +1 -1
  52. package/dist/middleware/create-cors.d.ts +1 -1
  53. package/dist/middleware/create-cors.js.map +1 -1
  54. package/dist/middleware/error-handling.d.ts +3 -0
  55. package/dist/middleware/error-handling.d.ts.map +1 -0
  56. package/dist/{error-handling-middleware.js → middleware/error-handling.js} +5 -8
  57. package/dist/middleware/error-handling.js.map +1 -0
  58. package/dist/middleware/no-cache.d.ts +1 -1
  59. package/dist/middleware/session.d.ts +1 -1
  60. package/dist/middleware/session.js.map +1 -1
  61. package/dist/rules/extensionless-file-name.d.ts.map +1 -1
  62. package/dist/rules/parse-rules-files.d.ts.map +1 -1
  63. package/dist/rules/parse-rules-files.js +7 -8
  64. package/dist/rules/parse-rules-files.js.map +1 -1
  65. package/dist/rules/rules-runner.d.ts +2 -2
  66. package/dist/rules/rules-runner.d.ts.map +1 -1
  67. package/dist/rules/rules-runner.js +49 -41
  68. package/dist/rules/rules-runner.js.map +1 -1
  69. package/dist/rules/types.d.ts +1 -1
  70. package/dist/rules/types.d.ts.map +1 -1
  71. package/dist/store/entities.d.ts +111 -0
  72. package/dist/store/entities.d.ts.map +1 -0
  73. package/dist/store/entities.js +43 -0
  74. package/dist/store/entities.js.map +1 -0
  75. package/dist/store/index.d.ts +37 -0
  76. package/dist/store/index.d.ts.map +1 -0
  77. package/dist/store/index.js +40 -0
  78. package/dist/store/index.js.map +1 -0
  79. package/dist/types.d.ts +20 -20
  80. package/dist/types.d.ts.map +1 -1
  81. package/dist/types.js +10 -11
  82. package/dist/types.js.map +1 -1
  83. package/dist/views/login.d.ts +2 -2
  84. package/dist/views/login.d.ts.map +1 -1
  85. package/dist/views/login.js +81 -30
  86. package/dist/views/login.js.map +1 -1
  87. package/dist/views/username-password.d.ts +2 -2
  88. package/dist/views/username-password.d.ts.map +1 -1
  89. package/dist/views/web-message.d.ts +1 -1
  90. package/dist/views/web-message.d.ts.map +1 -1
  91. package/dist/views/web-message.js.map +1 -1
  92. package/package.json +26 -41
  93. package/CHANGELOG.md +0 -176
  94. package/bin/index.js +0 -2
  95. package/dist/error-handling-middleware.d.ts +0 -3
  96. package/dist/error-handling-middleware.d.ts.map +0 -1
  97. package/dist/error-handling-middleware.js.map +0 -1
  98. package/dist/handlers/get-service-url.d.ts +0 -3
  99. package/dist/handlers/get-service-url.d.ts.map +0 -1
  100. package/dist/handlers/get-service-url.js +0 -11
  101. package/dist/handlers/get-service-url.js.map +0 -1
  102. package/dist/start.d.ts +0 -2
  103. package/dist/start.d.ts.map +0 -1
  104. package/dist/start.js +0 -77
  105. package/dist/start.js.map +0 -1
package/CHANGELOG.md DELETED
@@ -1,176 +0,0 @@
1
- # Changelog
2
-
3
- ## \[0.9.0]
4
-
5
- - Add the `refresh_token` flow
6
- - [7e4e918](https://github.com/thefrontside/simulacrum/commit/7e4e918b83484116021b06eeb0f5407ea3458628) Refresh token ([#252](https://github.com/thefrontside/simulacrum/pull/252)) on 2023-02-11
7
-
8
- ## \[0.8.3]
9
-
10
- - The auth0-simulator `/login/callback` is difficult to inspect. We need the `client_id` passed, but it seems safe to pass the whole `wctx` object as query strings.
11
- - [6b18117](https://github.com/thefrontside/simulacrum/commit/6b18117093e650713fe00d5b0614ba085186db9f) /login/callback should pass all wctx ([#241](https://github.com/thefrontside/simulacrum/pull/241)) on 2022-11-30
12
- - The auth0-simulator userData does not consider the Auth0 email verification functionality. Set it to `true` as a default to enable minimal functionality.
13
- - [547ef7f](https://github.com/thefrontside/simulacrum/commit/547ef7f3a9f7d99023078ff18307bed2b30223af) default auth0 simulator userData email_verified to true on 2022-11-29
14
- - The login form needs `event.preventDefault()` to allow the Auth0 library functions to run instead of default form functionality.
15
- - [046f49f](https://github.com/thefrontside/simulacrum/commit/046f49f3603a7865f3e62c84d81851637971f97f) add event.preventDefault() to login form for submit event on 2022-11-29
16
- - The auth0-simulator uses a logger that was refactored and broke the middleware logging. As a stopgap to the required, involved refactor, log out based on the debug flag.
17
- - [67e2f7f](https://github.com/thefrontside/simulacrum/commit/67e2f7f18d90a2fa53f2f216291ee770aab60440) add stopgap debug in auth0-simulator ([#237](https://github.com/thefrontside/simulacrum/pull/237)) on 2022-11-30
18
-
19
- ## \[0.8.2]
20
-
21
- - Added specific support for the `grant_type` `client_credentials` which is required for machine-to-machine tokens. This grant_type specifically does not run the rules. The `scope` option now accepts an array of objects to specify specific scopes for specific clients.
22
- - [4ffde63](https://github.com/thefrontside/simulacrum/commit/4ffde63842c0984f7bf5d6b3bd0f3d98ad938799) support client_credentials grant_type on 2022-11-17
23
- - [9bb1b43](https://github.com/thefrontside/simulacrum/commit/9bb1b43bb80332e5357123550d72eef8681ae416) update change file with note about scope adjustments on 2022-11-23
24
- - Tweaks the login form so the button is a true form submission button. This allows the form to input validate, and enables all form submission options (enter primarily the addition).
25
- - [fa4a9e2](https://github.com/thefrontside/simulacrum/commit/fa4a9e27f72b6609419ee93d3c55b620a5feb6bc) auth0 submit as form button on 2022-11-21
26
- - The simulator should consider the audience and client_id passed in the request. The values may be important for logic in user defined rules, and is used in validating the token, e.g. in `auth0-react`.
27
- - [86cd7d0](https://github.com/thefrontside/simulacrum/commit/86cd7d06d5747c81d31a241726999955425a8e65) consider client_id and audience in auth0 sim request on 2022-11-16
28
-
29
- ## \[0.8.1]
30
-
31
- - Async rules were not properly processing and would run as a race condition mutating the `user` and `context` objects. This would mean part of the rule might be applied. This adds some additional wrappers in the rule running to properly handle and `await` on async code.
32
- - [013b5db](https://github.com/thefrontside/simulacrum/commit/013b5dbf12d1995efe1fb6fba90b55d3fe05f523) change file on 2022-11-03
33
-
34
- ## \[0.8.0]
35
-
36
- - export `createAuth0Server` operation for running Auth0 server standalone.
37
- - [cd2f869](https://github.com/thefrontside/simulacrum/commit/cd2f8695ef8f4d4088a7fd37a8383fb7cc0d8c49) Export standalone Auth0 creation function on 2022-11-01
38
-
39
- ## \[0.7.1]
40
-
41
- - The auth0 simulator `/userinfo` endpoint will fall back to check for the `access_token` query parameter if the authorization header is not set.
42
- - [e3c55cd](https://github.com/thefrontside/simulacrum/commit/e3c55cdb3b0087a7e1be95d4c68674074956dfa2) change file on 2022-10-27
43
- - The auth0 simulator `/oauth/token` endpoint passes the user data through which is important as input for rules.
44
- - [f039985](https://github.com/thefrontside/simulacrum/commit/f039985b8768aa0c447b9304f2a624170f5e5782) pass user data at /oauth/token on 2022-10-31
45
-
46
- ## \[0.7.0]
47
-
48
- - now exports a `createAuth0Server` operation which can be used directly without
49
- starting a Simulacrum server
50
- - [875def0](https://github.com/thefrontside/simulacrum/commit/875def0277a9c6d6d1f5ea05d8dbffcfcc65d1a2) Add change entry on 2022-10-01
51
-
52
- ## \[0.6.3]
53
-
54
- - The simulation server can return null events on shutdown, and the logger did not consider this. Check for undefined within the filter.
55
- - Bumped due to a bump in @simulacrum/server.
56
- - [43bb4cf](https://github.com/thefrontside/simulacrum/commit/43bb4cfde8884595496ecdd27f6c94ceff95765d) simulation filter may include null, include check ([#210](https://github.com/thefrontside/simulacrum/pull/210)) on 2022-08-23
57
-
58
- ## \[0.6.2]
59
-
60
- - add missing @simulacrum/client to auth0 package
61
- - [6b0c7d1](https://github.com/thefrontside/simulacrum/commit/6b0c7d1cdca0f19455b5e9017216520bcae06ff2) add missing @simulacrum/client to auth0 package ([#205](https://github.com/thefrontside/simulacrum/pull/205)) on 2022-04-20
62
-
63
- ## \[0.6.1]
64
-
65
- - Add cosmiconfig as a dependency to the auth0-simulator
66
- - [7bd03b4](https://github.com/thefrontside/simulacrum/commit/7bd03b4313bd34a498c06bf8823f9e1559df4d38) add cosmiconfig as a dependency to @simularcurm/auth0-simulator ([#203](https://github.com/thefrontside/simulacrum/pull/203)) on 2022-04-20
67
-
68
- ## \[0.6.0]
69
-
70
- - Add cosmiconfig and zod to @simulacrum/auth0-simulator
71
- - [3dfacdc](https://github.com/thefrontside/simulacrum/commit/3dfacdcf84ca55a7f965dd297675245efb794f69) Add Cosmiconfig and zod to @simulacrum/auth0-config ([#190](https://github.com/thefrontside/simulacrum/pull/190)) on 2022-04-01
72
-
73
- ## \[0.5.1]
74
-
75
- - Make the iat field epoch time.
76
- - [6e08689](https://github.com/thefrontside/simulacrum/commit/6e086899eaf085d1e12e2c8edfea56139d8b705b) make iat field epoch time ([#187](https://github.com/thefrontside/simulacrum/pull/187)) on 2022-03-15
77
-
78
- ## \[0.5.0]
79
-
80
- - apply @typescript/consistent-types
81
- - [746a2ab](https://github.com/thefrontside/simulacrum/commit/746a2ab46333ff836808dd4d1bf8e98f2a20afae) Eslint consitent types ([#181](https://github.com/thefrontside/simulacrum/pull/181)) on 2022-02-22
82
- - Apply rules changes to the accessToken
83
- - [ad51c3a](https://github.com/thefrontside/simulacrum/commit/ad51c3af6f74aad72b00e3ea71fc01042a6287c5) Rules tests ([#183](https://github.com/thefrontside/simulacrum/pull/183)) on 2022-03-14
84
-
85
- ## \[0.4.1]
86
-
87
- - Simplify createSimulation and destroySimulation by removing them from the effects.
88
- - Bumped due to a bump in @simulacrum/server.
89
- - [04d5aaf](https://github.com/thefrontside/simulacrum/commit/04d5aaf0077d744badd8739936aad328156d64e2) Simplify createSimulation and destroySimulation ([#174](https://github.com/thefrontside/simulacrum/pull/174)) on 2022-01-19
90
- - wait for simulation to be destroyed before creating a new one
91
- - Bumped due to a bump in @simulacrum/server.
92
- - [b1412da](https://github.com/thefrontside/simulacrum/commit/b1412daa2d7846ec4c8eefeea2dfbf94e19b7261) wait for simulation to be destroyed before creating a new one ([#171](https://github.com/thefrontside/simulacrum/pull/171)) on 2022-01-18
93
-
94
- ## \[0.4.0]
95
-
96
- - Enable @simulacrum/auth0-cypress to run against nextjs-auth0.
97
- - [79a6f11](https://github.com/thefrontside/simulacrum/commit/79a6f11e6a5d516314182d5466f0d9657465c92e) Get user tokens ([#162](https://github.com/thefrontside/simulacrum/pull/162)) on 2022-01-04
98
- - Update eslint-config and typescript versions
99
- - [f852573](https://github.com/thefrontside/simulacrum/commit/f852573daefaf3da2675b1233c3c2db38a2b43ba) update eslint-config and typescript on 2021-10-26
100
-
101
- ## \[0.3.0]
102
-
103
- - Add @simulacrum/auth0-cypress package
104
- - [cb1ce68](https://github.com/thefrontside/simulacrum/commit/cb1ce68e6892532e1a4da82f736baaefe5ea2c09) update config.json on 2021-08-04
105
- - [d0d2b33](https://github.com/thefrontside/simulacrum/commit/d0d2b33be40aaec3c2496a2439f9b3539df3b081) fix changes file auth0 reference on 2021-08-09
106
- - [5ddc11e](https://github.com/thefrontside/simulacrum/commit/5ddc11e8a533241b4db3883595e0b2badcd05a9c) rename remaining cypress-auth0 => auth0-cypress on 2021-08-12
107
- - Upgrade to effection 2.0
108
- - [993857e](https://github.com/thefrontside/simulacrum/commit/993857e98b2d74a2cfbca255c5b82573f2db7a80) Upgrade to Effection 2.0 on 2021-10-12
109
- - - [d0f1cc1](https://github.com/thefrontside/simulacrum/commit/d0f1cc192fd1266bbb1eef2e644f8042546e060b) Upgrade effection to latest buffer / stream APIs on 2021-09-30
110
- - Upgrade effection to 2.0.0-beta.15
111
- - [938e9bf](https://github.com/thefrontside/simulacrum/commit/938e9bfcabfcdc5806ecba01a909432b3de29971) Upgrade effection on 2021-09-07
112
-
113
- ## \[0.2.3]
114
-
115
- - Increment all of the `effection` and related `@effection` packages. There was an issue in `@effection/core` with `dist` assets and this ensures it won't exist in the user's lock file.
116
- - [30d575b](https://github.com/thefrontside/simulacrum/commit/30d575bc652a5329d67568b013f657691d1d86b6) upgrade past @effection/core dist issue on 2021-08-13
117
- - Add bin script to auth0-simulator so it can be started via npx.
118
- - [88292f4](https://github.com/thefrontside/simulacrum/commit/88292f4f7f0f73ad8832943abcf342d7756fa2b5) add bin script to enable npx auth0-simulator via [#113](https://github.com/thefrontside/simulacrum/pull/113) on 2021-08-16
119
-
120
- ## \[0.2.2]
121
-
122
- - Fix bug where person scenario was not passing parameters down
123
- - [cfe6862](https://github.com/thefrontside/simulacrum/commit/cfe68622e3609336e0cde6ea40c3d144710c3734) Transparently pass through person scenario on 2021-08-05
124
- - fix malformed token that had `mail` field, not `email` field
125
- - [da75afd](https://github.com/thefrontside/simulacrum/commit/da75afdd0b5c47901e05ae7df5a4f968d0d2d613) add changefile on 2021-08-05
126
- - Add a `debug` option to server that will log errors when
127
- createSimulation() fails
128
- - [7db8e11](https://github.com/thefrontside/simulacrum/commit/7db8e110f5d262f37d7dbf670d10a98cfe29f066) add changeset on 2021-07-15
129
- - [c2525dc](https://github.com/thefrontside/simulacrum/commit/c2525dcab303cc37a638c7cefe180ef9926ab9ee) remove redundant task.halt from logging effect on 2021-07-27
130
- - [6c2f83e](https://github.com/thefrontside/simulacrum/commit/6c2f83e5b183906a0a45ec6f3b8c8b06369dbfdb) add description to change file on 2021-07-30
131
-
132
- ## \[0.2.1]
133
-
134
- - rollback effection to beta-5.
135
- - Bumped due to a bump in @simulacrum/client.
136
- - [793c074](https://github.com/thefrontside/simulacrum/commit/793c074c73d4958a9db5231b7ffdd54b5f103d4a) rollback effection to beta-5 on 2021-07-30
137
-
138
- ## \[0.2.0]
139
-
140
- - Fix auth0-simulator dependencies in examples
141
- - [e2ba50a](https://github.com/thefrontside/simulacrum/commit/e2ba50ae8371dea129d5e981d91da93c07fd5e5c) Fix auth0-simulator dependencies in examples on 2021-07-30
142
-
143
- ## \[0.1.0]
144
-
145
- - rename @simualcrum/auth0 to @simualcrum/auth0-simulator
146
- - [089d67f](https://github.com/thefrontside/simulacrum/commit/089d67f270fa3f9706ed69099631a19fffc822c3) rename @simualcrum/auth0 to @simualcrum/auth0-simulator on 2021-07-27
147
- - Add initial /authorize endpoint.
148
- - [c27dd61](https://github.com/thefrontside/simulacrum/commit/c27dd61c86eb675d66f4a770cb588e0711f0fc88) flesh out /authorize endpoint and add /login stub on 2021-06-29
149
- - [8caabd3](https://github.com/thefrontside/simulacrum/commit/8caabd3295580b6c94fb7f6347487db0654cf040) add /login view on 2021-06-29
150
- - [7c22f79](https://github.com/thefrontside/simulacrum/commit/7c22f799629e69859c04938f9dbedc7f775bf1a8) flow up until /oauth/token on 2021-06-29
151
- - [089d67f](https://github.com/thefrontside/simulacrum/commit/089d67f270fa3f9706ed69099631a19fffc822c3) rename @simualcrum/auth0 to @simualcrum/auth0-simulator on 2021-07-27
152
- - Fix public directory resolution in auth0.
153
- - [7ce0767](https://github.com/thefrontside/simulacrum/commit/7ce076758d3c25e07ee8a62715518b9c3d87dd5e) Fix public directory resolution in auth0 on 2021-07-22
154
- - [089d67f](https://github.com/thefrontside/simulacrum/commit/089d67f270fa3f9706ed69099631a19fffc822c3) rename @simualcrum/auth0 to @simualcrum/auth0-simulator on 2021-07-27
155
- - Implement login functionality.
156
- - [7c22f79](https://github.com/thefrontside/simulacrum/commit/7c22f799629e69859c04938f9dbedc7f775bf1a8) flow up until /oauth/token on 2021-06-29
157
- - [089d67f](https://github.com/thefrontside/simulacrum/commit/089d67f270fa3f9706ed69099631a19fffc822c3) rename @simualcrum/auth0 to @simualcrum/auth0-simulator on 2021-07-27
158
- - Add `/v2/logout` and remaining pieces
159
- - [0430761](https://github.com/thefrontside/simulacrum/commit/0430761982c8819b3eb4fe7335c2b2f0505b9a92) add logout route on 2021-07-14
160
- - [089d67f](https://github.com/thefrontside/simulacrum/commit/089d67f270fa3f9706ed69099631a19fffc822c3) rename @simualcrum/auth0 to @simualcrum/auth0-simulator on 2021-07-27
161
- - Add openid endpoints `/.well-known/jwks.json` and `/.well-known/openid-configuration`.
162
- - [1e15e42](https://github.com/thefrontside/simulacrum/commit/1e15e42c57bb4208d30f12afe14d000c47e400b9) Add openid endpoints and . on 2021-07-09
163
- - [b36ca42](https://github.com/thefrontside/simulacrum/commit/b36ca42a0fd0c77c16a6139b0ac3a1303f40ebd9) fix ./well-known/openid-configuration typo on 2021-07-14
164
- - [089d67f](https://github.com/thefrontside/simulacrum/commit/089d67f270fa3f9706ed69099631a19fffc822c3) rename @simualcrum/auth0 to @simualcrum/auth0-simulator on 2021-07-27
165
- - Add the initial rules-runner code
166
- - [f60f31e](https://github.com/thefrontside/simulacrum/commit/f60f31e8ea65d08f45c472e5a945cc7f2c2dfd1e) add changeset on 2021-07-14
167
- - [089d67f](https://github.com/thefrontside/simulacrum/commit/089d67f270fa3f9706ed69099631a19fffc822c3) rename @simualcrum/auth0 to @simualcrum/auth0-simulator on 2021-07-27
168
- - Ensure the same auth0 state exists throughout and fix issuer forward slash issues.
169
- - [3487d1b](https://github.com/thefrontside/simulacrum/commit/3487d1bd056ca105dde3283a164f672724b5f92d) pass state to auth0-js and fix trailing for openid endpoints on 2021-07-27
170
- - [089d67f](https://github.com/thefrontside/simulacrum/commit/089d67f270fa3f9706ed69099631a19fffc822c3) rename @simualcrum/auth0 to @simualcrum/auth0-simulator on 2021-07-27
171
- - Add the /oauth/token endpoint that actually issues the jwt.
172
- - [258673e](https://github.com/thefrontside/simulacrum/commit/258673e6dd815f102c5893c1c13a49c3a1b2dfb4) add /oauth/token test on 2021-07-07
173
- - [089d67f](https://github.com/thefrontside/simulacrum/commit/089d67f270fa3f9706ed69099631a19fffc822c3) rename @simualcrum/auth0 to @simualcrum/auth0-simulator on 2021-07-27
174
- - Add a handler for `/authorize` for `response_mode` web_message
175
- - [43cbc9c](https://github.com/thefrontside/simulacrum/commit/43cbc9c513c8f27dddbade8733c5f61d7bc17348) add /authorize web_message handler on 2021-07-08
176
- - [089d67f](https://github.com/thefrontside/simulacrum/commit/089d67f270fa3f9706ed69099631a19fffc822c3) rename @simualcrum/auth0 to @simualcrum/auth0-simulator on 2021-07-27
package/bin/index.js DELETED
@@ -1,2 +0,0 @@
1
- #! /usr/bin/env node
2
- require('@simulacrum/auth0-simulator/dist/start');
@@ -1,3 +0,0 @@
1
- import type { Request, Response, NextFunction } from 'express';
2
- export declare function defaultErrorHandler(error: Error, _req: Request, res: Response, next: NextFunction): void;
3
- //# sourceMappingURL=error-handling-middleware.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"error-handling-middleware.d.ts","sourceRoot":"","sources":["../src/error-handling-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE/D,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,QA8BjG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"error-handling-middleware.js","sourceRoot":"","sources":["../src/error-handling-middleware.ts"],"names":[],"mappings":";;;AAEA,SAAgB,mBAAmB,CAAC,KAAY,EAAE,IAAa,EAAE,GAAa,EAAE,IAAkB;;IAChG,IAAI,GAAG,CAAC,WAAW,EAAE;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;KACpB;IAED,IAAI,eAAe,GAAG,2BAA2B,CAAC;IAElD,IAAI,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,0CAAE,UAAU,CAAC,eAAe,CAAC,EAAE;QAC/C,IAAI,SAAS,GAAG,GAAG,CAAC;QACpB,IAAI,aAAa,GAAG,KAAK,CAAC,OAAO,CAAC;QAElC,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;YAChC,IAAI,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YAC/D,SAAS,GAAG,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YAC/C,aAAa,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SACvC;QAED,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;KAC3C;SAAM;QACL,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,GAAG;aACA,MAAM,CAAC,GAAG,CAAC;aACX,IAAI,CAAC;YACJ,KAAK,EAAE;gBACL,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,KAAK,EAAE,KAAK,CAAC,KAAK;aACnB;SACF,CAAC,CAAC;KACN;AACH,CAAC;AA9BD,kDA8BC"}
@@ -1,3 +0,0 @@
1
- import type { SimulationState } from '@simulacrum/server';
2
- export declare const getServiceUrl: (options: SimulationState) => URL;
3
- //# sourceMappingURL=get-service-url.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-service-url.d.ts","sourceRoot":"","sources":["../../src/handlers/get-service-url.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,eAAO,MAAM,aAAa,YAAa,eAAe,KAAG,GAMxD,CAAC"}
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getServiceUrl = void 0;
4
- const assert_ts_1 = require("assert-ts");
5
- const getServiceUrl = (options) => {
6
- let service = options.services.find(({ name }) => name === 'auth0');
7
- (0, assert_ts_1.assert)(!!service, `did not find auth0 service in set of running services`);
8
- return new URL(service.url);
9
- };
10
- exports.getServiceUrl = getServiceUrl;
11
- //# sourceMappingURL=get-service-url.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-service-url.js","sourceRoot":"","sources":["../../src/handlers/get-service-url.ts"],"names":[],"mappings":";;;AAAA,yCAAmC;AAG5B,MAAM,aAAa,GAAG,CAAC,OAAwB,EAAO,EAAE;IAC7D,IAAI,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,OAAO,CAAE,CAAC;IAErE,IAAA,kBAAM,EAAC,CAAC,CAAC,OAAO,EAAE,uDAAuD,CAAC,CAAC;IAE3E,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC9B,CAAC,CAAC;AANW,QAAA,aAAa,iBAMxB"}
package/dist/start.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=start.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../src/start.ts"],"names":[],"mappings":""}
package/dist/start.js DELETED
@@ -1,77 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- var _a, _b;
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const effection_1 = require("effection");
8
- const server_1 = require("@simulacrum/server");
9
- const _1 = require(".");
10
- const dedent_1 = __importDefault(require("dedent"));
11
- const client_1 = require("@simulacrum/client");
12
- const port = process.env.PORT ? parseInt(process.env.PORT) : undefined;
13
- const args = process.argv.slice(2);
14
- const isStandAlone = args.indexOf('--standalone') >= 0;
15
- const userName = (_a = args.find(arg => arg.startsWith('--username='))) === null || _a === void 0 ? void 0 : _a.split('=')[1];
16
- const password = (_b = args.find(arg => arg.startsWith('--password='))) === null || _b === void 0 ? void 0 : _b.split('=')[1];
17
- function* startInStandAloneMode(url) {
18
- let client = (0, client_1.createClient)(url);
19
- try {
20
- let simulation = yield client.createSimulation("auth0");
21
- let person = yield client.given(simulation, "person", {
22
- email: userName,
23
- password
24
- });
25
- console.log(`store populated with user`);
26
- console.log(`username = ${person.data.email} password = ${person.data.password}`);
27
- }
28
- finally {
29
- client.dispose();
30
- }
31
- }
32
- (0, effection_1.main)(function* () {
33
- let server = yield (0, server_1.createSimulationServer)({
34
- debug: true,
35
- seed: 1,
36
- port,
37
- simulators: { auth0: _1.auth0 }
38
- });
39
- let url = `http://localhost:${server.address.port}`;
40
- console.log(`Started Simulacrum simulation server on ${url}.`);
41
- if (isStandAlone) {
42
- console.log('starting in standalone mode');
43
- yield startInStandAloneMode(url);
44
- }
45
- else {
46
- console.log((0, dedent_1.default) `
47
- GraphiQL interface is running on ${url}/graphql.
48
-
49
- To start auth0 simulator send the following mutation to GraphQL server.
50
-
51
- mutation CreateSimulation {
52
- createSimulation(simulator: "auth0",
53
- options: {
54
- options:{
55
- audience: "[your audience]",
56
- scope: "[your scope]",
57
- clientID: "[your client-id]"
58
- },
59
- services:{
60
- auth0:{
61
- port: 4400
62
- }
63
- }
64
- }) {
65
- id
66
- status
67
- services {
68
- url
69
- name
70
- }
71
- }
72
- }
73
- `);
74
- }
75
- yield;
76
- });
77
- //# sourceMappingURL=start.js.map
package/dist/start.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"start.js","sourceRoot":"","sources":["../src/start.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAiC;AAEjC,+CAA4D;AAC5D,wBAA0B;AAC1B,oDAA4B;AAE5B,+CAAkD;AAElD,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAEvE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnC,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AACvD,MAAM,QAAQ,GAAG,MAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,0CAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAChF,MAAM,QAAQ,GAAG,MAAA,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,0CAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAEhF,QAAS,CAAC,CAAC,qBAAqB,CAAC,GAAW;IAC1C,IAAI,MAAM,GAAG,IAAA,qBAAY,EAAC,GAAG,CAAC,CAAC;IAE/B,IAAI;QACF,IAAI,UAAU,GAAe,MAAM,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAEpE,IAAI,MAAM,GAAqB,MAAM,MAAM,CAAC,KAAK,CAAC,UAAU,EAAE,QAAQ,EAAE;YACtE,KAAK,EAAE,QAAQ;YACf,QAAQ;SACT,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;QACzC,OAAO,CAAC,GAAG,CAAC,cAAc,MAAM,CAAC,IAAI,CAAC,KAAK,eAAe,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;KACnF;YAAS;QACR,MAAM,CAAC,OAAO,EAAE,CAAC;KAClB;AACH,CAAC;AAED,IAAA,gBAAI,EAAC,QAAQ,CAAC;IACZ,IAAI,MAAM,GAAW,MAAM,IAAA,+BAAsB,EAAC;QAChD,KAAK,EAAE,IAAI;QACX,IAAI,EAAE,CAAC;QACP,IAAI;QACJ,UAAU,EAAE,EAAE,KAAK,EAAL,QAAK,EAAE;KACtB,CAAC,CAAC;IAEH,IAAI,GAAG,GAAG,oBAAoB,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IAEpD,OAAO,CAAC,GAAG,CAAC,2CAA2C,GAAG,GAAG,CAAC,CAAC;IAE/D,IAAG,YAAY,EAAE;QACf,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;QAE3C,MAAM,qBAAqB,CAAC,GAAG,CAAC,CAAC;KAClC;SAAM;QACL,OAAO,CAAC,GAAG,CAAC,IAAA,gBAAM,EAAA;uCACiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;IA0BtC,CAAC,CAAC;KACH;IAED,KAAK,CAAC;AACR,CAAC,CAAC,CAAC"}