@simulacrum/auth0-simulator 0.2.1 → 0.4.0
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.
- package/CHANGELOG.md +38 -0
- package/README.md +13 -9
- package/bin/index.js +2 -0
- package/dist/auth/date.js +1 -1
- package/dist/auth/date.js.map +1 -1
- package/dist/auth/jwt.d.ts +1 -1
- package/dist/auth/jwt.d.ts.map +1 -1
- package/dist/auth/jwt.js +5 -4
- package/dist/auth/jwt.js.map +1 -1
- package/dist/handlers/auth0-handlers.d.ts +1 -1
- package/dist/handlers/auth0-handlers.d.ts.map +1 -1
- package/dist/handlers/auth0-handlers.js +82 -31
- package/dist/handlers/auth0-handlers.js.map +1 -1
- package/dist/handlers/get-service-url.js +1 -1
- package/dist/handlers/get-service-url.js.map +1 -1
- package/dist/handlers/login-redirect.js +1 -1
- package/dist/handlers/login-redirect.js.map +1 -1
- package/dist/handlers/openid-handlers.js +2 -2
- package/dist/handlers/openid-handlers.js.map +1 -1
- package/dist/handlers/web-message.js +4 -4
- package/dist/handlers/web-message.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -28
- package/dist/index.js.map +1 -1
- package/dist/middleware/create-cors.js +1 -1
- package/dist/middleware/create-cors.js.map +1 -1
- package/dist/middleware/session.js +1 -1
- package/dist/middleware/session.js.map +1 -1
- package/dist/rules/parse-rules-files.js +2 -2
- package/dist/rules/parse-rules-files.js.map +1 -1
- package/dist/rules/rules-runner.js +3 -3
- package/dist/rules/rules-runner.js.map +1 -1
- package/dist/start.js +35 -3
- package/dist/start.js.map +1 -1
- package/dist/types.d.ts +21 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/views/login.js +1 -1
- package/dist/views/username-password.js +1 -1
- package/dist/views/username-password.js.map +1 -1
- package/dist/views/web-message.js +1 -1
- package/dist/views/web-message.js.map +1 -1
- package/package.json +19 -13
- package/docs/create-simulation.png +0 -0
- package/docs/person.png +0 -0
- package/src/auth/constants.ts +0 -16
- package/src/auth/date.ts +0 -4
- package/src/auth/jwt.ts +0 -23
- package/src/handlers/auth0-handlers.ts +0 -219
- package/src/handlers/get-service-url.ts +0 -10
- package/src/handlers/login-redirect.ts +0 -37
- package/src/handlers/openid-handlers.ts +0 -39
- package/src/handlers/url.ts +0 -1
- package/src/handlers/web-message.ts +0 -31
- package/src/index.ts +0 -70
- package/src/middleware/create-cors.ts +0 -14
- package/src/middleware/no-cache.ts +0 -7
- package/src/middleware/session.ts +0 -14
- package/src/rules/extensionless-file-name.ts +0 -4
- package/src/rules/parse-rules-files.ts +0 -40
- package/src/rules/rules-runner.ts +0 -72
- package/src/rules/types.ts +0 -25
- package/src/start.ts +0 -19
- package/src/types.ts +0 -29
- package/src/views/login.ts +0 -107
- package/src/views/public/img/frontside-logo.png +0 -0
- package/src/views/username-password.ts +0 -54
- package/src/views/web-message.ts +0 -72
- package/test/auth0.test.ts +0 -351
- package/test/helpers.ts +0 -23
- package/test/openid-handlers.test.ts +0 -57
- package/test/rules/avatar.js +0 -13
- package/test/rules/avatar.json +0 -5
- package/tsconfig.dist.json +0 -12
- package/tsconfig.dist.tsbuildinfo +0 -2236
- package/tsconfig.json +0 -11
- package/tsconfig.watch.json +0 -9
- package/watch.ts +0 -59
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## \[0.4.0]
|
|
4
|
+
|
|
5
|
+
- Enable @simulacrum/auth0-cypress to run against nextjs-auth0.
|
|
6
|
+
- [79a6f11](https://github.com/thefrontside/simulacrum/commit/79a6f11e6a5d516314182d5466f0d9657465c92e) Get user tokens ([#162](https://github.com/thefrontside/simulacrum/pull/162)) on 2022-01-04
|
|
7
|
+
- Update eslint-config and typescript versions
|
|
8
|
+
- [f852573](https://github.com/thefrontside/simulacrum/commit/f852573daefaf3da2675b1233c3c2db38a2b43ba) update eslint-config and typescript on 2021-10-26
|
|
9
|
+
|
|
10
|
+
## \[0.3.0]
|
|
11
|
+
|
|
12
|
+
- Add @simulacrum/auth0-cypress package
|
|
13
|
+
- [cb1ce68](https://github.com/thefrontside/simulacrum/commit/cb1ce68e6892532e1a4da82f736baaefe5ea2c09) update config.json on 2021-08-04
|
|
14
|
+
- [d0d2b33](https://github.com/thefrontside/simulacrum/commit/d0d2b33be40aaec3c2496a2439f9b3539df3b081) fix changes file auth0 reference on 2021-08-09
|
|
15
|
+
- [5ddc11e](https://github.com/thefrontside/simulacrum/commit/5ddc11e8a533241b4db3883595e0b2badcd05a9c) rename remaining cypress-auth0 => auth0-cypress on 2021-08-12
|
|
16
|
+
- Upgrade to effection 2.0
|
|
17
|
+
- [993857e](https://github.com/thefrontside/simulacrum/commit/993857e98b2d74a2cfbca255c5b82573f2db7a80) Upgrade to Effection 2.0 on 2021-10-12
|
|
18
|
+
- - [d0f1cc1](https://github.com/thefrontside/simulacrum/commit/d0f1cc192fd1266bbb1eef2e644f8042546e060b) Upgrade effection to latest buffer / stream APIs on 2021-09-30
|
|
19
|
+
- Upgrade effection to 2.0.0-beta.15
|
|
20
|
+
- [938e9bf](https://github.com/thefrontside/simulacrum/commit/938e9bfcabfcdc5806ecba01a909432b3de29971) Upgrade effection on 2021-09-07
|
|
21
|
+
|
|
22
|
+
## \[0.2.3]
|
|
23
|
+
|
|
24
|
+
- 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.
|
|
25
|
+
- [30d575b](https://github.com/thefrontside/simulacrum/commit/30d575bc652a5329d67568b013f657691d1d86b6) upgrade past @effection/core dist issue on 2021-08-13
|
|
26
|
+
- Add bin script to auth0-simulator so it can be started via npx.
|
|
27
|
+
- [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
|
|
28
|
+
|
|
29
|
+
## \[0.2.2]
|
|
30
|
+
|
|
31
|
+
- Fix bug where person scenario was not passing parameters down
|
|
32
|
+
- [cfe6862](https://github.com/thefrontside/simulacrum/commit/cfe68622e3609336e0cde6ea40c3d144710c3734) Transparently pass through person scenario on 2021-08-05
|
|
33
|
+
- fix malformed token that had `mail` field, not `email` field
|
|
34
|
+
- [da75afd](https://github.com/thefrontside/simulacrum/commit/da75afdd0b5c47901e05ae7df5a4f968d0d2d613) add changefile on 2021-08-05
|
|
35
|
+
- Add a `debug` option to server that will log errors when
|
|
36
|
+
createSimulation() fails
|
|
37
|
+
- [7db8e11](https://github.com/thefrontside/simulacrum/commit/7db8e110f5d262f37d7dbf670d10a98cfe29f066) add changeset on 2021-07-15
|
|
38
|
+
- [c2525dc](https://github.com/thefrontside/simulacrum/commit/c2525dcab303cc37a638c7cefe180ef9926ab9ee) remove redundant task.halt from logging effect on 2021-07-27
|
|
39
|
+
- [6c2f83e](https://github.com/thefrontside/simulacrum/commit/6c2f83e5b183906a0a45ec6f3b8c8b06369dbfdb) add description to change file on 2021-07-30
|
|
40
|
+
|
|
3
41
|
## \[0.2.1]
|
|
4
42
|
|
|
5
43
|
- rollback effection to beta-5.
|
package/README.md
CHANGED
|
@@ -21,14 +21,14 @@ If this does not meet your needs then please create a github issue to start a co
|
|
|
21
21
|
|
|
22
22
|
## Quick Start
|
|
23
23
|
|
|
24
|
+
This quick start assumes you have your own app with auth0. Check out [`nextjs with auth0 react`](./examples/nextjs-with-auth0-react) and [`nextjs with nextjs auth0`](./examples/nextjs-with-nextjs-auth0) for more complete examples that provides a barebone application.
|
|
25
|
+
|
|
24
26
|
### Graphql
|
|
25
27
|
|
|
26
28
|
Let's start our server.
|
|
27
29
|
|
|
28
30
|
```bash
|
|
29
|
-
|
|
30
|
-
cd ./packages/auth0 # when running from the simulacrum repo
|
|
31
|
-
PORT=4000 npm run start # this will start a test simulacrum server at http://localhost:4000
|
|
31
|
+
PORT=4000 npx auth0-simulator # this will start a test simulacrum server at http://localhost:4000
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
Open a browser at [http://localhost:4000](http://localhost:4000).
|
|
@@ -62,7 +62,7 @@ mutation CreateSimulation {
|
|
|
62
62
|
}
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
This mutation creates your first simulation
|
|
65
|
+
This mutation creates your first simulation. Every time you start the server, you will need to apply these mutations. This can also be done programmatically which will be your likely interface while writing tests.
|
|
66
66
|
|
|
67
67
|
.
|
|
68
68
|
|
|
@@ -94,19 +94,23 @@ You now have a running auth0 server!
|
|
|
94
94
|
|
|
95
95
|
An auth0 simulator can be created using the `@simulacrum/client` package. This is how you would apply the mutations programmatically.
|
|
96
96
|
|
|
97
|
+
```bash
|
|
98
|
+
npm install @simulacrum/client
|
|
99
|
+
npm install @simulacrum/auth0-simulator
|
|
100
|
+
```
|
|
101
|
+
|
|
97
102
|
The following examples are written in Typescript, but using Typescript is not a requirement. The Auth0 simulator creates a server with a graphql interface. This means that your interactions with the server can be written in any language or framework that can communicate over http / graphql.
|
|
98
103
|
|
|
104
|
+
|
|
99
105
|
```ts
|
|
100
106
|
import { main } from "effection";
|
|
101
107
|
import { createSimulationServer, Server } from "@simulacrum/server";
|
|
102
|
-
import { auth0 } from "
|
|
108
|
+
import { auth0 } from "@simulacrum/auth0-simulator";
|
|
103
109
|
import { createClient } from "@simulacrum/client";
|
|
104
110
|
|
|
105
111
|
const port = Number(process.env.PORT) ?? 4000; // port for the main simulation service
|
|
106
112
|
|
|
107
|
-
// effection is a structured concurrency library and
|
|
108
|
-
// this will help us handle errors and shutting down
|
|
109
|
-
// the server gracefully
|
|
113
|
+
// effection is a structured concurrency library and this will help us handle errors and shutting down the server gracefully
|
|
110
114
|
main(function* () {
|
|
111
115
|
let server: Server = yield createSimulationServer({
|
|
112
116
|
seed: 1,
|
|
@@ -178,7 +182,7 @@ async function setupClient({ url }) {
|
|
|
178
182
|
let simulation = await client.createSimulation("auth0", {
|
|
179
183
|
options: {
|
|
180
184
|
audience: "https://your-audience/",
|
|
181
|
-
scope: "openid profile
|
|
185
|
+
scope: "openid profile email offline_access",
|
|
182
186
|
clientId: "YOUR_AUTH0_CLIENT_ID",
|
|
183
187
|
},
|
|
184
188
|
services: {
|
package/bin/index.js
ADDED
package/dist/auth/date.js
CHANGED
|
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.expiresAt = exports.epochTime = void 0;
|
|
4
4
|
const epochTime = (date = Date.now()) => Math.floor(date / 1000);
|
|
5
5
|
exports.epochTime = epochTime;
|
|
6
|
-
const expiresAt = (hours = 1) => exports.epochTime() + hours * 60 * 60 * 1000;
|
|
6
|
+
const expiresAt = (hours = 1) => (0, exports.epochTime)() + hours * 60 * 60 * 1000;
|
|
7
7
|
exports.expiresAt = expiresAt;
|
|
8
8
|
//# sourceMappingURL=date.js.map
|
package/dist/auth/date.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.js","sourceRoot":"","sources":["../../src/auth/date.ts"],"names":[],"mappings":";;;AAAO,MAAM,SAAS,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,EAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;AAAnE,QAAA,SAAS,aAA0D;AAEzE,MAAM,SAAS,GAAG,CAAC,KAAK,GAAG,CAAC,EAAU,EAAE,CAC7C,iBAAS,
|
|
1
|
+
{"version":3,"file":"date.js","sourceRoot":"","sources":["../../src/auth/date.ts"],"names":[],"mappings":";;;AAAO,MAAM,SAAS,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,EAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;AAAnE,QAAA,SAAS,aAA0D;AAEzE,MAAM,SAAS,GAAG,CAAC,KAAK,GAAG,CAAC,EAAU,EAAE,CAC7C,IAAA,iBAAS,GAAE,GAAG,KAAK,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAD1B,QAAA,SAAS,aACiB"}
|
package/dist/auth/jwt.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SignOptions } from "jsonwebtoken";
|
|
2
2
|
export declare const parseKey: (key: string) => string;
|
|
3
3
|
export declare const createJsonWebToken: (payload: Record<string, unknown>, privateKey?: string, options?: SignOptions) => string;
|
|
4
|
-
export declare function createAuthJWT(authNamespace: string, audience: string): string;
|
|
4
|
+
export declare function createAuthJWT(authNamespace: string, audience: string, sub: string): string;
|
|
5
5
|
//# sourceMappingURL=jwt.d.ts.map
|
package/dist/auth/jwt.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwt.d.ts","sourceRoot":"","sources":["../../src/auth/jwt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,WAAW,EAAE,MAAM,cAAc,CAAC;AAGjD,eAAO,MAAM,QAAQ,QAAS,MAAM,KAAG,MAAoC,CAAC;AAE5E,eAAO,MAAM,kBAAkB,YACpB,OAAO,MAAM,EAAE,OAAO,CAAC,iCAEvB,WAAW,KAInB,MAEF,CAAC;AAEF,wBAAgB,aAAa,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"jwt.d.ts","sourceRoot":"","sources":["../../src/auth/jwt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,WAAW,EAAE,MAAM,cAAc,CAAC;AAGjD,eAAO,MAAM,QAAQ,QAAS,MAAM,KAAG,MAAoC,CAAC;AAE5E,eAAO,MAAM,kBAAkB,YACpB,OAAO,MAAM,EAAE,OAAO,CAAC,iCAEvB,WAAW,KAInB,MAEF,CAAC;AAEF,wBAAgB,aAAa,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAO1F"}
|
package/dist/auth/jwt.js
CHANGED
|
@@ -5,18 +5,19 @@ const jsonwebtoken_1 = require("jsonwebtoken");
|
|
|
5
5
|
const constants_1 = require("./constants");
|
|
6
6
|
const parseKey = (key) => key.split("~~").join("\n");
|
|
7
7
|
exports.parseKey = parseKey;
|
|
8
|
-
const createJsonWebToken = (payload, privateKey = exports.parseKey(constants_1.PRIVATE_KEY), options = {
|
|
8
|
+
const createJsonWebToken = (payload, privateKey = (0, exports.parseKey)(constants_1.PRIVATE_KEY), options = {
|
|
9
9
|
algorithm: "RS256",
|
|
10
10
|
keyid: constants_1.JWKS.keys[0].kid,
|
|
11
11
|
}) => {
|
|
12
|
-
return jsonwebtoken_1.sign(payload, privateKey, options);
|
|
12
|
+
return (0, jsonwebtoken_1.sign)(payload, privateKey, options);
|
|
13
13
|
};
|
|
14
14
|
exports.createJsonWebToken = createJsonWebToken;
|
|
15
|
-
function createAuthJWT(authNamespace, audience) {
|
|
16
|
-
return exports.createJsonWebToken({
|
|
15
|
+
function createAuthJWT(authNamespace, audience, sub) {
|
|
16
|
+
return (0, exports.createJsonWebToken)({
|
|
17
17
|
[`${authNamespace}`]: 'decorate token',
|
|
18
18
|
aud: audience,
|
|
19
19
|
iss: authNamespace,
|
|
20
|
+
sub,
|
|
20
21
|
});
|
|
21
22
|
}
|
|
22
23
|
exports.createAuthJWT = createAuthJWT;
|
package/dist/auth/jwt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwt.js","sourceRoot":"","sources":["../../src/auth/jwt.ts"],"names":[],"mappings":";;;AAAA,+CAAiD;AACjD,2CAAgD;AAEzC,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAU,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAA/D,QAAA,QAAQ,YAAuD;AAErE,MAAM,kBAAkB,GAAG,CAChC,OAAgC,EAChC,UAAU,GAAG,gBAAQ,
|
|
1
|
+
{"version":3,"file":"jwt.js","sourceRoot":"","sources":["../../src/auth/jwt.ts"],"names":[],"mappings":";;;AAAA,+CAAiD;AACjD,2CAAgD;AAEzC,MAAM,QAAQ,GAAG,CAAC,GAAW,EAAU,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAA/D,QAAA,QAAQ,YAAuD;AAErE,MAAM,kBAAkB,GAAG,CAChC,OAAgC,EAChC,UAAU,GAAG,IAAA,gBAAQ,EAAC,uBAAW,CAAC,EAClC,UAAuB;IACrB,SAAS,EAAE,OAAO;IAClB,KAAK,EAAE,gBAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG;CACxB,EACO,EAAE;IACV,OAAO,IAAA,mBAAI,EAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAC;AATW,QAAA,kBAAkB,sBAS7B;AAEF,SAAgB,aAAa,CAAC,aAAqB,EAAE,QAAgB,EAAE,GAAW;IAChF,OAAO,IAAA,0BAAkB,EAAC;QACxB,CAAC,GAAG,aAAa,EAAE,CAAC,EAAE,gBAAgB;QACtC,GAAG,EAAE,QAAQ;QACb,GAAG,EAAE,aAAa;QAClB,GAAG;KACJ,CAAC,CAAC;AACL,CAAC;AAPD,sCAOC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpHandler } from '@simulacrum/server';
|
|
2
2
|
import { Options } from '../types';
|
|
3
|
-
export declare type Routes = '/heartbeat' | '/authorize' | '/login' | '/usernamepassword/login' | '/login/callback' | '/oauth/token' | '/v2/logout';
|
|
3
|
+
export declare type Routes = '/heartbeat' | '/authorize' | '/login' | '/usernamepassword/login' | '/login/callback' | '/oauth/token' | '/v2/logout' | '/userinfo';
|
|
4
4
|
export declare const createAuth0Handlers: (options: Options) => Record<Routes, HttpHandler>;
|
|
5
5
|
//# sourceMappingURL=auth0-handlers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth0-handlers.d.ts","sourceRoot":"","sources":["../../src/handlers/auth0-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA6B,MAAM,oBAAoB,CAAC;AAC5E,OAAO,
|
|
1
|
+
{"version":3,"file":"auth0-handlers.d.ts","sourceRoot":"","sources":["../../src/handlers/auth0-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA6B,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAe,OAAO,EAA8B,MAAM,UAAU,CAAC;AAe5E,oBAAY,MAAM,GACd,YAAY,GACZ,YAAY,GACZ,QAAQ,GACR,yBAAyB,GACzB,iBAAiB,GACjB,cAAc,GACd,YAAY,GACZ,WAAW,CAAA;AAyBf,eAAO,MAAM,mBAAmB,YAAa,OAAO,KAAG,OAAO,MAAM,EAAE,WAAW,CA0OhF,CAAC"}
|
|
@@ -12,9 +12,10 @@ const date_1 = require("../auth/date");
|
|
|
12
12
|
const jwt_1 = require("../auth/jwt");
|
|
13
13
|
const get_service_url_1 = require("./get-service-url");
|
|
14
14
|
const rules_runner_1 = require("../rules/rules-runner");
|
|
15
|
+
const jsonwebtoken_1 = require("jsonwebtoken");
|
|
15
16
|
const getServiceUrlFromOptions = (options) => {
|
|
16
17
|
let service = options.services.get().find(({ name }) => name === 'auth0');
|
|
17
|
-
assert_ts_1.assert(!!service, `did not find auth0 service in set of running services`);
|
|
18
|
+
(0, assert_ts_1.assert)(!!service, `did not find auth0 service in set of running services`);
|
|
18
19
|
return new URL(service.url);
|
|
19
20
|
};
|
|
20
21
|
const createPersonQuery = (store) => (predicate) => {
|
|
@@ -32,10 +33,10 @@ const createPersonQuery = (store) => (predicate) => {
|
|
|
32
33
|
const createAuth0Handlers = (options) => {
|
|
33
34
|
let { audience, scope, store, clientId, rulesDirectory } = options;
|
|
34
35
|
let personQuery = createPersonQuery(store);
|
|
35
|
-
let rulesRunner = rules_runner_1.createRulesRunner(rulesDirectory);
|
|
36
|
+
let rulesRunner = (0, rules_runner_1.createRulesRunner)(rulesDirectory);
|
|
36
37
|
let authorizeHandlers = {
|
|
37
|
-
query: login_redirect_1.createLoginRedirectHandler(options),
|
|
38
|
-
web_message: web_message_1.createWebMessageHandler()
|
|
38
|
+
query: (0, login_redirect_1.createLoginRedirectHandler)(options),
|
|
39
|
+
web_message: (0, web_message_1.createWebMessageHandler)()
|
|
39
40
|
};
|
|
40
41
|
return {
|
|
41
42
|
['/heartbeat']: function* (_, res) {
|
|
@@ -43,17 +44,24 @@ const createAuth0Handlers = (options) => {
|
|
|
43
44
|
},
|
|
44
45
|
['/authorize']: function* (req, res) {
|
|
45
46
|
var _a;
|
|
47
|
+
let currentUser = req.query.currentUser;
|
|
48
|
+
(0, assert_ts_1.assert)(!!req.session, "no session");
|
|
49
|
+
if (currentUser) {
|
|
50
|
+
// the request is a silent login.
|
|
51
|
+
// We fake an existing login by
|
|
52
|
+
// adding the user to the session
|
|
53
|
+
req.session.username = currentUser;
|
|
54
|
+
}
|
|
46
55
|
let responseMode = ((_a = req.query.response_mode) !== null && _a !== void 0 ? _a : 'query');
|
|
47
|
-
assert_ts_1.assert(['query', 'web_message'].includes(responseMode), `unknown response_mode ${responseMode}`);
|
|
56
|
+
(0, assert_ts_1.assert)(['query', 'web_message'].includes(responseMode), `unknown response_mode ${responseMode}`);
|
|
48
57
|
let handler = authorizeHandlers[responseMode];
|
|
49
58
|
yield handler(req, res);
|
|
50
|
-
return;
|
|
51
59
|
},
|
|
52
60
|
['/login']: function* (req, res) {
|
|
53
61
|
let { redirect_uri } = req.query;
|
|
54
|
-
let url = get_service_url_1.getServiceUrl(options);
|
|
55
|
-
assert_ts_1.assert(!!clientId, `no clientId assigned`);
|
|
56
|
-
let html = login_1.loginView({
|
|
62
|
+
let url = (0, get_service_url_1.getServiceUrl)(options);
|
|
63
|
+
(0, assert_ts_1.assert)(!!clientId, `no clientId assigned`);
|
|
64
|
+
let html = (0, login_1.loginView)({
|
|
57
65
|
domain: url.host,
|
|
58
66
|
scope,
|
|
59
67
|
redirectUri: redirect_uri,
|
|
@@ -66,15 +74,15 @@ const createAuth0Handlers = (options) => {
|
|
|
66
74
|
},
|
|
67
75
|
['/usernamepassword/login']: function* (req, res) {
|
|
68
76
|
let { username, nonce, password } = req.body;
|
|
69
|
-
assert_ts_1.assert(!!username, 'no username in /usernamepassword/login');
|
|
70
|
-
assert_ts_1.assert(!!nonce, 'no nonce in /usernamepassword/login');
|
|
71
|
-
assert_ts_1.assert(!!req.session, "no session");
|
|
77
|
+
(0, assert_ts_1.assert)(!!username, 'no username in /usernamepassword/login');
|
|
78
|
+
(0, assert_ts_1.assert)(!!nonce, 'no nonce in /usernamepassword/login');
|
|
79
|
+
(0, assert_ts_1.assert)(!!req.session, "no session");
|
|
72
80
|
let user = personQuery(([, person]) => { var _a; return ((_a = person.email) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === username.toLowerCase() && person.password === password; });
|
|
73
81
|
if (!user) {
|
|
74
82
|
let { redirect_uri } = req.query;
|
|
75
83
|
let url = getServiceUrlFromOptions(options);
|
|
76
|
-
assert_ts_1.assert(!!clientId, `no clientId assigned`);
|
|
77
|
-
let html = login_1.loginView({
|
|
84
|
+
(0, assert_ts_1.assert)(!!clientId, `no clientId assigned`);
|
|
85
|
+
let html = (0, login_1.loginView)({
|
|
78
86
|
domain: url.host,
|
|
79
87
|
scope,
|
|
80
88
|
redirectUri: redirect_uri,
|
|
@@ -93,27 +101,44 @@ const createAuth0Handlers = (options) => {
|
|
|
93
101
|
nonce
|
|
94
102
|
}
|
|
95
103
|
});
|
|
96
|
-
res.status(200).send(username_password_1.userNamePasswordForm(req.body));
|
|
104
|
+
res.status(200).send((0, username_password_1.userNamePasswordForm)(req.body));
|
|
97
105
|
},
|
|
98
106
|
['/login/callback']: function* (req, res) {
|
|
99
107
|
let wctx = JSON.parse(req.body.wctx);
|
|
100
108
|
let { redirect_uri, state, nonce } = wctx;
|
|
101
109
|
let { username } = store.slice('auth0', nonce).get();
|
|
102
|
-
let encodedNonce = base64_url_1.encode(`${nonce}:${username}`);
|
|
103
|
-
let qs = querystring_1.stringify({ code: encodedNonce, state, nonce });
|
|
110
|
+
let encodedNonce = (0, base64_url_1.encode)(`${nonce}:${username}`);
|
|
111
|
+
let qs = (0, querystring_1.stringify)({ code: encodedNonce, state, nonce });
|
|
104
112
|
let routerUrl = `${redirect_uri}?${qs}`;
|
|
105
|
-
|
|
113
|
+
res.status(302).redirect(routerUrl);
|
|
106
114
|
},
|
|
107
115
|
['/oauth/token']: function* (req, res) {
|
|
108
|
-
let { code } = req.body;
|
|
109
|
-
let
|
|
116
|
+
let { code, grant_type } = req.body;
|
|
117
|
+
let user;
|
|
118
|
+
let nonce;
|
|
119
|
+
let username;
|
|
120
|
+
let password;
|
|
121
|
+
if (grant_type === 'password') {
|
|
122
|
+
username = req.body.username;
|
|
123
|
+
password = req.body.password;
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
(0, assert_ts_1.assert)(typeof code !== 'undefined', 'no code in /oauth/token');
|
|
127
|
+
[nonce, username] = (0, base64_url_1.decode)(code).split(":");
|
|
128
|
+
}
|
|
110
129
|
if (!username) {
|
|
111
130
|
res.status(400).send(`no nonce in store for ${code}`);
|
|
112
131
|
return;
|
|
113
132
|
}
|
|
114
|
-
|
|
115
|
-
assert_ts_1.assert(!!person.email, `no email defined on person scenario`);
|
|
116
|
-
|
|
133
|
+
user = personQuery(([, person]) => {
|
|
134
|
+
(0, assert_ts_1.assert)(!!person.email, `no email defined on person scenario`);
|
|
135
|
+
let valid = person.email.toLowerCase() === username.toLowerCase();
|
|
136
|
+
if (typeof password === 'undefined') {
|
|
137
|
+
return valid;
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
return valid && password === person.password;
|
|
141
|
+
}
|
|
117
142
|
});
|
|
118
143
|
if (!user) {
|
|
119
144
|
res.status(401).send('Unauthorized');
|
|
@@ -124,32 +149,58 @@ const createAuth0Handlers = (options) => {
|
|
|
124
149
|
alg: "RS256",
|
|
125
150
|
typ: "JWT",
|
|
126
151
|
iss: url,
|
|
127
|
-
exp: date_1.expiresAt(),
|
|
152
|
+
exp: (0, date_1.expiresAt)(),
|
|
128
153
|
iat: Date.now(),
|
|
129
|
-
|
|
154
|
+
email: username,
|
|
130
155
|
aud: clientId,
|
|
131
156
|
sub: user.id,
|
|
132
|
-
nonce,
|
|
133
157
|
};
|
|
134
|
-
|
|
158
|
+
if (typeof nonce !== 'undefined') {
|
|
159
|
+
idTokenData.nonce = nonce;
|
|
160
|
+
}
|
|
161
|
+
(0, assert_ts_1.assert)(!!clientId, 'no clientId in options');
|
|
135
162
|
let accessToken = {
|
|
136
163
|
scope,
|
|
137
164
|
};
|
|
138
165
|
let userData = {};
|
|
139
166
|
let context = { clientID: clientId, accessToken, idToken: idTokenData };
|
|
140
167
|
rulesRunner(userData, context);
|
|
141
|
-
let idToken = jwt_1.createJsonWebToken({ ...userData, ...context.idToken, ...context.accessToken });
|
|
168
|
+
let idToken = (0, jwt_1.createJsonWebToken)({ ...userData, ...context.idToken, ...context.accessToken });
|
|
142
169
|
res.status(200).json({
|
|
143
|
-
access_token: jwt_1.createAuthJWT(url, audience),
|
|
170
|
+
access_token: (0, jwt_1.createAuthJWT)(url, audience, idTokenData.sub),
|
|
144
171
|
id_token: idToken,
|
|
145
172
|
expires_in: 86400,
|
|
146
173
|
token_type: "Bearer",
|
|
147
174
|
});
|
|
148
175
|
},
|
|
149
176
|
['/v2/logout']: function* (req, res) {
|
|
150
|
-
|
|
177
|
+
var _a;
|
|
151
178
|
req.session = null;
|
|
152
|
-
|
|
179
|
+
let returnToUrl = (_a = req.query.returnTo) !== null && _a !== void 0 ? _a : req.headers.referer;
|
|
180
|
+
(0, assert_ts_1.assert)(typeof returnToUrl === 'string', `no logical returnTo url`);
|
|
181
|
+
res.redirect(returnToUrl);
|
|
182
|
+
},
|
|
183
|
+
['/userinfo']: function* (req, res) {
|
|
184
|
+
let authorizationHeader = req.headers.authorization;
|
|
185
|
+
(0, assert_ts_1.assert)(!!authorizationHeader, 'no authorization header');
|
|
186
|
+
let [, token] = authorizationHeader.split(' ');
|
|
187
|
+
let { sub } = (0, jsonwebtoken_1.decode)(token, { json: true });
|
|
188
|
+
let user = personQuery(([, person]) => {
|
|
189
|
+
(0, assert_ts_1.assert)(!!person.id, `no email defined on person scenario`);
|
|
190
|
+
return person.id === sub;
|
|
191
|
+
});
|
|
192
|
+
(0, assert_ts_1.assert)(!!user, 'no user in /userinfo');
|
|
193
|
+
let userinfo = {
|
|
194
|
+
sub,
|
|
195
|
+
name: user.name,
|
|
196
|
+
given_name: user.name,
|
|
197
|
+
family_name: user.name,
|
|
198
|
+
email: user.email,
|
|
199
|
+
email_verified: true,
|
|
200
|
+
locale: 'en',
|
|
201
|
+
hd: 'okta.com'
|
|
202
|
+
};
|
|
203
|
+
res.status(200).json(userinfo);
|
|
153
204
|
}
|
|
154
205
|
};
|
|
155
206
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth0-handlers.js","sourceRoot":"","sources":["../../src/handlers/auth0-handlers.ts"],"names":[],"mappings":";;;AAEA,qDAA8D;AAC9D,+CAAwD;AACxD,0CAA2C;AAC3C,yCAAmC;AACnC,6CAAwC;AACxC,2CAA4C;AAC5C,kEAAkE;AAClE,uCAAyC;AACzC,qCAAgE;AAChE,uDAAkD;AAClD,wDAA0D;
|
|
1
|
+
{"version":3,"file":"auth0-handlers.js","sourceRoot":"","sources":["../../src/handlers/auth0-handlers.ts"],"names":[],"mappings":";;;AAEA,qDAA8D;AAC9D,+CAAwD;AACxD,0CAA2C;AAC3C,yCAAmC;AACnC,6CAAwC;AACxC,2CAA4C;AAC5C,kEAAkE;AAClE,uCAAyC;AACzC,qCAAgE;AAChE,uDAAkD;AAClD,wDAA0D;AAE1D,+CAAqD;AAcrD,MAAM,wBAAwB,GAAG,CAAC,OAAgB,EAAE,EAAE;IACpD,IAAI,OAAO,GAAG,OAAO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AAE,EAAE,UAAU;aACd,CAAC;YAEH,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACjC,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AA1OW,QAAA,mBAAmB,uBA0O9B"}
|
|
@@ -4,7 +4,7 @@ exports.getServiceUrl = void 0;
|
|
|
4
4
|
const assert_ts_1 = require("assert-ts");
|
|
5
5
|
const getServiceUrl = (options) => {
|
|
6
6
|
let service = options.services.get().find(({ name }) => name === 'auth0');
|
|
7
|
-
assert_ts_1.assert(!!service, `did not find auth0 service in set of running services`);
|
|
7
|
+
(0, assert_ts_1.assert)(!!service, `did not find auth0 service in set of running services`);
|
|
8
8
|
return new URL(service.url);
|
|
9
9
|
};
|
|
10
10
|
exports.getServiceUrl = getServiceUrl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-service-url.js","sourceRoot":"","sources":["../../src/handlers/get-service-url.ts"],"names":[],"mappings":";;;AACA,yCAAmC;AAE5B,MAAM,aAAa,GAAG,CAAC,OAAgB,EAAO,EAAE;IACrD,IAAI,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,OAAO,CAAE,CAAC;IAE3E,kBAAM,
|
|
1
|
+
{"version":3,"file":"get-service-url.js","sourceRoot":"","sources":["../../src/handlers/get-service-url.ts"],"names":[],"mappings":";;;AACA,yCAAmC;AAE5B,MAAM,aAAa,GAAG,CAAC,OAAgB,EAAO,EAAE;IACrD,IAAI,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,OAAO,CAAE,CAAC;IAE3E,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"}
|
|
@@ -4,7 +4,7 @@ exports.createLoginRedirectHandler = void 0;
|
|
|
4
4
|
const querystring_1 = require("querystring");
|
|
5
5
|
const createLoginRedirectHandler = (options) => function* loginRedirect(req, res) {
|
|
6
6
|
let { client_id, redirect_uri, scope, state, nonce, response_mode, code_challenge, code_challenge_method, auth0Client, response_type, } = req.query;
|
|
7
|
-
res.status(302).redirect(`/login?${querystring_1.stringify({
|
|
7
|
+
res.status(302).redirect(`/login?${(0, querystring_1.stringify)({
|
|
8
8
|
state,
|
|
9
9
|
redirect_uri,
|
|
10
10
|
client: client_id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-redirect.js","sourceRoot":"","sources":["../../src/handlers/login-redirect.ts"],"names":[],"mappings":";;;AAEA,6CAAwC;AAGjC,MAAM,0BAA0B,GAAG,CAAC,OAAgB,EAAc,EAAE,CACzE,QAAQ,CAAC,CAAC,aAAa,CAAE,GAAY,EAAE,GAAa;IAClD,IAAI,EACF,SAAS,EACT,YAAY,EACZ,KAAK,EACL,KAAK,EACL,KAAK,EACL,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,aAAa,GACd,GAAG,GAAG,CAAC,KAAoB,CAAC;IAE7B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,CACtB,UAAU,uBAAS,
|
|
1
|
+
{"version":3,"file":"login-redirect.js","sourceRoot":"","sources":["../../src/handlers/login-redirect.ts"],"names":[],"mappings":";;;AAEA,6CAAwC;AAGjC,MAAM,0BAA0B,GAAG,CAAC,OAAgB,EAAc,EAAE,CACzE,QAAQ,CAAC,CAAC,aAAa,CAAE,GAAY,EAAE,GAAa;IAClD,IAAI,EACF,SAAS,EACT,YAAY,EACZ,KAAK,EACL,KAAK,EACL,KAAK,EACL,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,aAAa,GACd,GAAG,GAAG,CAAC,KAAoB,CAAC;IAE7B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,CACtB,UAAU,IAAA,uBAAS,EAAC;QAClB,KAAK;QACL,YAAY;QACZ,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,QAAQ;QAClB,KAAK;QACL,aAAa;QACb,aAAa;QACb,KAAK;QACL,cAAc;QACd,qBAAqB;QACrB,WAAW;QACX,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC3B,CAAC,EAAE,CACL,CAAC;AACJ,CAAC,CAAC;AA/BS,QAAA,0BAA0B,8BA+BnC"}
|
|
@@ -10,7 +10,7 @@ const createOpenIdHandlers = (options) => {
|
|
|
10
10
|
res.json(constants_1.JWKS);
|
|
11
11
|
},
|
|
12
12
|
['/.well-known/openid-configuration']: function* (_, res) {
|
|
13
|
-
let url = url_1.removeTrailingSlash(get_service_url_1.getServiceUrl(options).toString());
|
|
13
|
+
let url = (0, url_1.removeTrailingSlash)((0, get_service_url_1.getServiceUrl)(options).toString());
|
|
14
14
|
res.json({
|
|
15
15
|
issuer: `${url}/`,
|
|
16
16
|
authorization_endpoint: [url, "authorize"].join('/'),
|
|
@@ -18,7 +18,7 @@ const createOpenIdHandlers = (options) => {
|
|
|
18
18
|
userinfo_endpoint: [url, "userinfo"].join('/'),
|
|
19
19
|
jwks_uri: [url, ".well-known", "jwks.json"].join('/'),
|
|
20
20
|
});
|
|
21
|
-
}
|
|
21
|
+
},
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
exports.createOpenIdHandlers = createOpenIdHandlers;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openid-handlers.js","sourceRoot":"","sources":["../../src/handlers/openid-handlers.ts"],"names":[],"mappings":";;;AAEA,iDAAyC;AACzC,uDAAkD;AAClD,+BAA4C;AAgBrC,MAAM,oBAAoB,GAAG,CAAC,OAAgB,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AC,CAAC;AAlBW,QAAA,oBAAoB,wBAkB/B"}
|
|
@@ -5,13 +5,13 @@ const assert_ts_1 = require("assert-ts");
|
|
|
5
5
|
const base64_url_1 = require("base64-url");
|
|
6
6
|
const web_message_1 = require("../views/web-message");
|
|
7
7
|
const createWebMessageHandler = () => function* (req, res) {
|
|
8
|
-
assert_ts_1.assert(!!req.session, "no session");
|
|
8
|
+
(0, assert_ts_1.assert)(!!req.session, "no session");
|
|
9
9
|
let username = req.session.username;
|
|
10
|
-
assert_ts_1.assert(!!username, `no username in authorise`);
|
|
10
|
+
(0, assert_ts_1.assert)(!!username, `no username in authorise`);
|
|
11
11
|
let { redirect_uri, state, nonce } = req.query;
|
|
12
12
|
res.set("Content-Type", "text/html");
|
|
13
|
-
let message = web_message_1.webMessage({
|
|
14
|
-
code: base64_url_1.encode(`${nonce}:${username}`),
|
|
13
|
+
let message = (0, web_message_1.webMessage)({
|
|
14
|
+
code: (0, base64_url_1.encode)(`${nonce}:${username}`),
|
|
15
15
|
state,
|
|
16
16
|
redirect_uri,
|
|
17
17
|
nonce,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-message.js","sourceRoot":"","sources":["../../src/handlers/web-message.ts"],"names":[],"mappings":";;;AACA,yCAAmC;AACnC,2CAAoC;AAEpC,sDAAkD;AAE3C,MAAM,uBAAuB,GAAG,GAAe,EAAE,CACtD,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG;IACjB,kBAAM,
|
|
1
|
+
{"version":3,"file":"web-message.js","sourceRoot":"","sources":["../../src/handlers/web-message.ts"],"names":[],"mappings":";;;AACA,yCAAmC;AACnC,2CAAoC;AAEpC,sDAAkD;AAE3C,MAAM,uBAAuB,GAAG,GAAe,EAAE,CACtD,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG;IACjB,IAAA,kBAAM,EAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAEpC,IAAI,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC;IAEpC,IAAA,kBAAM,EAAC,CAAC,CAAC,QAAQ,EAAE,0BAA0B,CAAC,CAAC;IAE/C,IAAI,EACF,YAAY,EACZ,KAAK,EACL,KAAK,EACN,GAAG,GAAG,CAAC,KAAoB,CAAC;IAE7B,GAAG,CAAC,GAAG,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;IAErC,IAAI,OAAO,GAAG,IAAA,wBAAU,EAAC;QACvB,IAAI,EAAE,IAAA,mBAAM,EAAC,GAAG,KAAK,IAAI,QAAQ,EAAE,CAAC;QACpC,KAAK;QACL,YAAY;QACZ,KAAK;KACN,CAAC,CAAC;IAEH,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7C,CAAC,CAAC;AAxBS,QAAA,uBAAuB,2BAwBhC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAwB,MAAM,oBAAoB,CAAC;AAS1E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AA2ClC,eAAO,MAAM,KAAK,EAAE,SAAS,CAAC,OAAO,CAsBpC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,9 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.auth0 = void 0;
|
|
7
7
|
const server_1 = require("@simulacrum/server");
|
|
8
|
+
const server_2 = require("@simulacrum/server");
|
|
8
9
|
const express_1 = require("express");
|
|
9
10
|
const auth0_handlers_1 = require("./handlers/auth0-handlers");
|
|
10
|
-
const
|
|
11
|
+
const server_3 = require("@simulacrum/server");
|
|
11
12
|
const session_1 = require("./middleware/session");
|
|
12
13
|
const path_1 = __importDefault(require("path"));
|
|
13
14
|
const express_2 = __importDefault(require("express"));
|
|
@@ -20,46 +21,50 @@ const DefaultOptions = {
|
|
|
20
21
|
audience: 'https://thefrontside.auth0.com/api/v1/',
|
|
21
22
|
scope: "openid profile email offline_access",
|
|
22
23
|
};
|
|
23
|
-
const createAuth0Service = (handlers) => {
|
|
24
|
+
const createAuth0Service = (handlers, debug) => {
|
|
25
|
+
let app = (0, server_2.createHttpApp)()
|
|
26
|
+
.use(express_2.default.static(publicDir))
|
|
27
|
+
.use((0, session_1.createSession)())
|
|
28
|
+
.use((0, create_cors_1.createCors)())
|
|
29
|
+
.use((0, no_cache_1.noCache)())
|
|
30
|
+
.use((0, express_1.json)())
|
|
31
|
+
.use((0, express_1.urlencoded)({ extended: true }))
|
|
32
|
+
.get('/heartbeat', handlers['/heartbeat'])
|
|
33
|
+
.get('/authorize', handlers['/authorize'])
|
|
34
|
+
.get('/login', handlers['/login'])
|
|
35
|
+
.get('/u/login', handlers['/usernamepassword/login'])
|
|
36
|
+
.post('/usernamepassword/login', handlers['/usernamepassword/login'])
|
|
37
|
+
.post('/login/callback', handlers['/login/callback'])
|
|
38
|
+
.post('/oauth/token', handlers['/oauth/token'])
|
|
39
|
+
.get('/userinfo', handlers['/userinfo'])
|
|
40
|
+
.get('/v2/logout', handlers['/v2/logout'])
|
|
41
|
+
.get('/.well-known/jwks.json', handlers['/.well-known/jwks.json'])
|
|
42
|
+
.get('/.well-known/openid-configuration', handlers['/.well-known/openid-configuration']);
|
|
43
|
+
if (debug) {
|
|
44
|
+
app = app.use(server_1.consoleLogger);
|
|
45
|
+
}
|
|
24
46
|
return {
|
|
25
47
|
protocol: 'https',
|
|
26
|
-
app
|
|
27
|
-
.use(express_2.default.static(publicDir))
|
|
28
|
-
.use(session_1.createSession())
|
|
29
|
-
.use(create_cors_1.createCors())
|
|
30
|
-
.use(no_cache_1.noCache())
|
|
31
|
-
.use(express_1.json())
|
|
32
|
-
.use(express_1.urlencoded({ extended: true }))
|
|
33
|
-
.get('/heartbeat', handlers['/heartbeat'])
|
|
34
|
-
.get('/authorize', handlers['/authorize'])
|
|
35
|
-
.get('/login', handlers['/login'])
|
|
36
|
-
.get('/u/login', handlers['/usernamepassword/login'])
|
|
37
|
-
.post('/usernamepassword/login', handlers['/usernamepassword/login'])
|
|
38
|
-
.post('/login/callback', handlers['/login/callback'])
|
|
39
|
-
.post('/oauth/token', handlers['/oauth/token'])
|
|
40
|
-
.get('/v2/logout', handlers['/v2/logout'])
|
|
41
|
-
.get('/.well-known/jwks.json', handlers['/.well-known/jwks.json'])
|
|
42
|
-
.get('/.well-known/openid-configuration', handlers['/.well-known/openid-configuration'])
|
|
48
|
+
app
|
|
43
49
|
};
|
|
44
50
|
};
|
|
45
51
|
const auth0 = (slice, options) => {
|
|
46
52
|
let store = slice.slice('store');
|
|
47
53
|
let services = slice.slice('services');
|
|
54
|
+
let debug = !!slice.slice('debug').get();
|
|
48
55
|
let handlersOptions = { ...DefaultOptions, ...options, store, services };
|
|
49
|
-
let auth0Handlers = auth0_handlers_1.createAuth0Handlers(handlersOptions);
|
|
50
|
-
let openIdHandlers = openid_handlers_1.createOpenIdHandlers(handlersOptions);
|
|
56
|
+
let auth0Handlers = (0, auth0_handlers_1.createAuth0Handlers)(handlersOptions);
|
|
57
|
+
let openIdHandlers = (0, openid_handlers_1.createOpenIdHandlers)(handlersOptions);
|
|
51
58
|
return {
|
|
52
|
-
services: { auth0: createAuth0Service({ ...auth0Handlers, ...openIdHandlers }) },
|
|
59
|
+
services: { auth0: createAuth0Service({ ...auth0Handlers, ...openIdHandlers }, debug) },
|
|
53
60
|
scenarios: {
|
|
54
61
|
/**
|
|
55
|
-
* Here we just
|
|
56
|
-
*
|
|
57
|
-
*
|
|
62
|
+
* Here we just export the internal `person` scenario so that it can be
|
|
63
|
+
* used with the a standalone auth0 simulator. However,
|
|
64
|
+
* what we really need to have some way to _react_ to the person
|
|
58
65
|
* having been created and augment the record at that point.
|
|
59
66
|
*/
|
|
60
|
-
|
|
61
|
-
return yield server_2.person(store, faker);
|
|
62
|
-
}
|
|
67
|
+
person: server_3.person
|
|
63
68
|
}
|
|
64
69
|
};
|
|
65
70
|
};
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AACA,+CAAmD;AACnD,qCAA2C;AAC3C,8DAAgE;AAChE,+CAA4C;AAC5C,kDAAqD;AACrD,gDAAwB;AACxB,sDAA8B;AAE9B,0DAAsD;AACtD,oDAAgD;AAChD,gEAAkE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AACA,+CAAmD;AACnD,+CAAmD;AACnD,qCAA2C;AAC3C,8DAAgE;AAChE,+CAA4C;AAC5C,kDAAqD;AACrD,gDAAwB;AACxB,sDAA8B;AAE9B,0DAAsD;AACtD,oDAAgD;AAChD,gEAAkE;AAElE,MAAM,SAAS,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAE1D,MAAM,cAAc,GAAG;IACrB,QAAQ,EAAE,kCAAkC;IAC5C,QAAQ,EAAE,wCAAwC;IAClD,KAAK,EAAE,qCAAqC;CAC7C,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,QAA0F,EAAE,KAAc,EAAwB,EAAE;IAC9J,IAAI,GAAG,GAAG,IAAA,sBAAa,GAAE;SACtB,GAAG,CAAC,iBAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;SAC9B,GAAG,CAAC,IAAA,uBAAa,GAAE,CAAC;SACpB,GAAG,CAAC,IAAA,wBAAU,GAAE,CAAC;SACjB,GAAG,CAA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