@simulacrum/auth0-simulator 0.6.3 → 0.7.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 +6 -0
- package/dist/config/get-config.d.ts +3 -3
- package/dist/config/get-config.d.ts.map +1 -1
- package/dist/config/get-config.js +1 -10
- package/dist/config/get-config.js.map +1 -1
- package/dist/handlers/auth0-handlers.d.ts +12 -3
- package/dist/handlers/auth0-handlers.d.ts.map +1 -1
- package/dist/handlers/auth0-handlers.js +22 -45
- package/dist/handlers/auth0-handlers.js.map +1 -1
- package/dist/handlers/get-service-url.d.ts +2 -2
- package/dist/handlers/get-service-url.d.ts.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.d.ts +3 -3
- package/dist/handlers/login-redirect.d.ts.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.d.ts +2 -3
- package/dist/handlers/openid-handlers.d.ts.map +1 -1
- package/dist/handlers/openid-handlers.js +4 -5
- package/dist/handlers/openid-handlers.js.map +1 -1
- package/dist/handlers/web-message.d.ts +2 -2
- package/dist/handlers/web-message.d.ts.map +1 -1
- package/dist/handlers/web-message.js +1 -1
- package/dist/handlers/web-message.js.map +1 -1
- package/dist/index.d.ts +12 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +96 -44
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +0 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## \[0.7.0]
|
|
4
|
+
|
|
5
|
+
- now exports a `createAuth0Server` operation which can be used directly without
|
|
6
|
+
starting a Simulacrum server
|
|
7
|
+
- [875def0](https://github.com/thefrontside/simulacrum/commit/875def0277a9c6d6d1f5ea05d8dbffcfcc65d1a2) Add change entry on 2022-10-01
|
|
8
|
+
|
|
3
9
|
## \[0.6.3]
|
|
4
10
|
|
|
5
11
|
- The simulation server can return null events on shutdown, and the logger did not consider this. Check for undefined within the filter.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { cosmiconfigSync } from 'cosmiconfig';
|
|
2
|
-
import type { Auth0Configuration,
|
|
2
|
+
import type { Auth0Configuration, Schema } from '../types';
|
|
3
3
|
export declare const DefaultArgs: Schema;
|
|
4
4
|
declare type Explorer = ReturnType<typeof cosmiconfigSync>;
|
|
5
|
-
export declare function getConfigCreator(explorer: Explorer): (options?:
|
|
6
|
-
export declare const getConfig: (options?:
|
|
5
|
+
export declare function getConfigCreator(explorer: Explorer): (options?: Partial<Auth0Configuration> | undefined) => Auth0Configuration;
|
|
6
|
+
export declare const getConfig: (options?: Partial<Auth0Configuration> | undefined) => Auth0Configuration;
|
|
7
7
|
export {};
|
|
8
8
|
//# sourceMappingURL=get-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-config.d.ts","sourceRoot":"","sources":["../../src/config/get-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"get-config.d.ts","sourceRoot":"","sources":["../../src/config/get-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAK3D,eAAO,MAAM,WAAW,EAAE,MAIzB,CAAC;AAEF,aAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAkBnD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,0DACiB,kBAAkB,CAgBrF;AAID,eAAO,MAAM,SAAS,yDApB8C,kBAoBjB,CAAC"}
|
|
@@ -3,15 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getConfig = exports.getConfigCreator = exports.DefaultArgs = void 0;
|
|
4
4
|
const cosmiconfig_1 = require("cosmiconfig");
|
|
5
5
|
const types_1 = require("../types");
|
|
6
|
-
function omit(obj, ...keys) {
|
|
7
|
-
let copy = {};
|
|
8
|
-
let remaining = Object.keys(obj)
|
|
9
|
-
.flatMap(c => keys.includes(c) === false ? [c] : []);
|
|
10
|
-
for (let k of remaining) {
|
|
11
|
-
copy[k] = obj[k];
|
|
12
|
-
}
|
|
13
|
-
return copy;
|
|
14
|
-
}
|
|
15
6
|
const DefaultAuth0Port = 4400;
|
|
16
7
|
exports.DefaultArgs = {
|
|
17
8
|
clientID: '00000000000000000000000000000000',
|
|
@@ -35,7 +26,7 @@ function getConfigCreator(explorer) {
|
|
|
35
26
|
return function getConfig(options) {
|
|
36
27
|
let searchResult = explorer.search();
|
|
37
28
|
let config = searchResult === null ? exports.DefaultArgs : searchResult.config;
|
|
38
|
-
let strippedOptions =
|
|
29
|
+
let strippedOptions = options !== null && options !== void 0 ? options : {};
|
|
39
30
|
let configuration = { ...exports.DefaultArgs, ...config, ...strippedOptions };
|
|
40
31
|
configuration.port = getPort(configuration);
|
|
41
32
|
types_1.configurationSchema.parse(configuration);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-config.js","sourceRoot":"","sources":["../../src/config/get-config.ts"],"names":[],"mappings":";;;AAAA,6CAA8C;AAE9C,oCAA+C;AAE/C,
|
|
1
|
+
{"version":3,"file":"get-config.js","sourceRoot":"","sources":["../../src/config/get-config.ts"],"names":[],"mappings":";;;AAAA,6CAA8C;AAE9C,oCAA+C;AAE/C,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAEjB,QAAA,WAAW,GAAW;IACjC,QAAQ,EAAE,kCAAkC;IAC5C,QAAQ,EAAE,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type { Person } from '@simulacrum/server';
|
|
2
|
+
import type { Auth0Configuration } from '../types';
|
|
3
|
+
import type { RequestHandler } from 'express';
|
|
3
4
|
export declare type Routes = '/heartbeat' | '/authorize' | '/login' | '/usernamepassword/login' | '/login/callback' | '/oauth/token' | '/v2/logout' | '/userinfo';
|
|
4
|
-
export declare
|
|
5
|
+
export declare type AuthSession = {
|
|
6
|
+
username: string;
|
|
7
|
+
nonce: string;
|
|
8
|
+
};
|
|
9
|
+
export interface Auth0Store {
|
|
10
|
+
get(nonce: string): AuthSession;
|
|
11
|
+
set(nonce: string, session: AuthSession): void;
|
|
12
|
+
}
|
|
13
|
+
export declare const createAuth0Handlers: (store: Auth0Store, people: Iterable<Person>, serviceURL: () => URL, options: Auth0Configuration) => Record<Routes, RequestHandler>;
|
|
5
14
|
//# 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,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"auth0-handlers.d.ts","sourceRoot":"","sources":["../../src/handlers/auth0-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAsB,kBAAkB,EAA2C,MAAM,UAAU,CAAC;AAChH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAc9C,oBAAY,MAAM,GACd,YAAY,GACZ,YAAY,GACZ,QAAQ,GACR,yBAAyB,GACzB,iBAAiB,GACjB,cAAc,GACd,YAAY,GACZ,WAAW,CAAA;AAIf,oBAAY,WAAW,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D,MAAM,WAAW,UAAU;IACzB,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC;IAChC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;CAChD;AAMD,eAAO,MAAM,mBAAmB,UAAW,UAAU,UAAU,SAAS,MAAM,CAAC,cAAc,MAAM,GAAG,WAAW,kBAAkB,KAAG,OAAO,MAAM,EAAE,cAAc,CAqOlK,CAAC"}
|
|
@@ -10,39 +10,24 @@ const base64_url_1 = require("base64-url");
|
|
|
10
10
|
const username_password_1 = require("../views/username-password");
|
|
11
11
|
const date_1 = require("../auth/date");
|
|
12
12
|
const jwt_1 = require("../auth/jwt");
|
|
13
|
-
const get_service_url_1 = require("./get-service-url");
|
|
14
13
|
const rules_runner_1 = require("../rules/rules-runner");
|
|
15
14
|
const jsonwebtoken_1 = require("jsonwebtoken");
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
(0, assert_ts_1.assert)(!!service, `did not find auth0 service in set of running services`);
|
|
19
|
-
return new URL(service.url);
|
|
15
|
+
const createPersonQuery = (people) => (predicate) => {
|
|
16
|
+
return [...people].find(predicate);
|
|
20
17
|
};
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
let
|
|
24
|
-
let entry = Object.entries(people).find(predicate);
|
|
25
|
-
if (!entry) {
|
|
26
|
-
return undefined;
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
let [, person] = entry;
|
|
30
|
-
return person;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const createAuth0Handlers = (options) => {
|
|
34
|
-
let { audience, scope, store, clientID, rulesDirectory } = options;
|
|
35
|
-
let personQuery = createPersonQuery(store);
|
|
18
|
+
const createAuth0Handlers = (store, people, serviceURL, options) => {
|
|
19
|
+
let { audience, scope, clientID, rulesDirectory } = options;
|
|
20
|
+
let personQuery = createPersonQuery(people);
|
|
36
21
|
let rulesRunner = (0, rules_runner_1.createRulesRunner)(rulesDirectory);
|
|
37
22
|
let authorizeHandlers = {
|
|
38
23
|
query: (0, login_redirect_1.createLoginRedirectHandler)(options),
|
|
39
24
|
web_message: (0, web_message_1.createWebMessageHandler)()
|
|
40
25
|
};
|
|
41
26
|
return {
|
|
42
|
-
['/heartbeat']: function
|
|
27
|
+
['/heartbeat']: function (_, res) {
|
|
43
28
|
res.status(200).json({ ok: true });
|
|
44
29
|
},
|
|
45
|
-
['/authorize']: function
|
|
30
|
+
['/authorize']: function (req, res, next) {
|
|
46
31
|
var _a;
|
|
47
32
|
let currentUser = req.query.currentUser;
|
|
48
33
|
(0, assert_ts_1.assert)(!!req.session, "no session");
|
|
@@ -55,14 +40,13 @@ const createAuth0Handlers = (options) => {
|
|
|
55
40
|
let responseMode = ((_a = req.query.response_mode) !== null && _a !== void 0 ? _a : 'query');
|
|
56
41
|
(0, assert_ts_1.assert)(['query', 'web_message'].includes(responseMode), `unknown response_mode ${responseMode}`);
|
|
57
42
|
let handler = authorizeHandlers[responseMode];
|
|
58
|
-
|
|
43
|
+
handler(req, res, next);
|
|
59
44
|
},
|
|
60
|
-
['/login']: function
|
|
45
|
+
['/login']: function (req, res) {
|
|
61
46
|
let { redirect_uri } = req.query;
|
|
62
|
-
let url = (0, get_service_url_1.getServiceUrl)(options);
|
|
63
47
|
(0, assert_ts_1.assert)(!!clientID, `no clientID assigned`);
|
|
64
48
|
let html = (0, login_1.loginView)({
|
|
65
|
-
domain:
|
|
49
|
+
domain: serviceURL().host,
|
|
66
50
|
scope,
|
|
67
51
|
redirectUri: redirect_uri,
|
|
68
52
|
clientID,
|
|
@@ -72,18 +56,17 @@ const createAuth0Handlers = (options) => {
|
|
|
72
56
|
res.set("Content-Type", "text/html");
|
|
73
57
|
res.status(200).send(Buffer.from(html));
|
|
74
58
|
},
|
|
75
|
-
['/usernamepassword/login']: function
|
|
59
|
+
['/usernamepassword/login']: function (req, res) {
|
|
76
60
|
let { username, nonce, password } = req.body;
|
|
77
61
|
(0, assert_ts_1.assert)(!!username, 'no username in /usernamepassword/login');
|
|
78
62
|
(0, assert_ts_1.assert)(!!nonce, 'no nonce in /usernamepassword/login');
|
|
79
63
|
(0, assert_ts_1.assert)(!!req.session, "no session");
|
|
80
|
-
let user = personQuery((
|
|
64
|
+
let user = personQuery((person) => { var _a; return ((_a = person.email) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === username.toLowerCase() && person.password === password; });
|
|
81
65
|
if (!user) {
|
|
82
66
|
let { redirect_uri } = req.query;
|
|
83
|
-
let url = getServiceUrlFromOptions(options);
|
|
84
67
|
(0, assert_ts_1.assert)(!!clientID, `no clientID assigned`);
|
|
85
68
|
let html = (0, login_1.loginView)({
|
|
86
|
-
domain:
|
|
69
|
+
domain: serviceURL().host,
|
|
87
70
|
scope,
|
|
88
71
|
redirectUri: redirect_uri,
|
|
89
72
|
clientID,
|
|
@@ -95,24 +78,19 @@ const createAuth0Handlers = (options) => {
|
|
|
95
78
|
return;
|
|
96
79
|
}
|
|
97
80
|
req.session.username = username;
|
|
98
|
-
store.
|
|
99
|
-
[nonce]: {
|
|
100
|
-
username,
|
|
101
|
-
nonce
|
|
102
|
-
}
|
|
103
|
-
});
|
|
81
|
+
store.set(nonce, { username, nonce });
|
|
104
82
|
res.status(200).send((0, username_password_1.userNamePasswordForm)(req.body));
|
|
105
83
|
},
|
|
106
|
-
['/login/callback']: function
|
|
84
|
+
['/login/callback']: function (req, res) {
|
|
107
85
|
let wctx = JSON.parse(req.body.wctx);
|
|
108
86
|
let { redirect_uri, state, nonce } = wctx;
|
|
109
|
-
let { username } = store.
|
|
87
|
+
let { username } = store.get(nonce);
|
|
110
88
|
let encodedNonce = (0, base64_url_1.encode)(`${nonce}:${username}`);
|
|
111
89
|
let qs = (0, querystring_1.stringify)({ code: encodedNonce, state, nonce });
|
|
112
90
|
let routerUrl = `${redirect_uri}?${qs}`;
|
|
113
91
|
res.status(302).redirect(routerUrl);
|
|
114
92
|
},
|
|
115
|
-
['/oauth/token']: function
|
|
93
|
+
['/oauth/token']: function (req, res) {
|
|
116
94
|
let { code, grant_type } = req.body;
|
|
117
95
|
let user;
|
|
118
96
|
let nonce;
|
|
@@ -130,7 +108,7 @@ const createAuth0Handlers = (options) => {
|
|
|
130
108
|
res.status(400).send(`no nonce in store for ${code}`);
|
|
131
109
|
return;
|
|
132
110
|
}
|
|
133
|
-
user = personQuery((
|
|
111
|
+
user = personQuery((person) => {
|
|
134
112
|
(0, assert_ts_1.assert)(!!person.email, `no email defined on person scenario`);
|
|
135
113
|
let valid = person.email.toLowerCase() === username.toLowerCase();
|
|
136
114
|
if (typeof password === 'undefined') {
|
|
@@ -144,12 +122,11 @@ const createAuth0Handlers = (options) => {
|
|
|
144
122
|
res.status(401).send('Unauthorized');
|
|
145
123
|
return;
|
|
146
124
|
}
|
|
147
|
-
let url = getServiceUrlFromOptions(options).toString();
|
|
148
125
|
(0, assert_ts_1.assert)(!!clientID, 'no clientID in options');
|
|
149
126
|
let idTokenData = {
|
|
150
127
|
alg: "RS256",
|
|
151
128
|
typ: "JWT",
|
|
152
|
-
iss:
|
|
129
|
+
iss: serviceURL().toString(),
|
|
153
130
|
exp: (0, date_1.expiresAt)(),
|
|
154
131
|
iat: (0, date_1.epochTime)(),
|
|
155
132
|
email: username,
|
|
@@ -178,19 +155,19 @@ const createAuth0Handlers = (options) => {
|
|
|
178
155
|
token_type: "Bearer",
|
|
179
156
|
});
|
|
180
157
|
},
|
|
181
|
-
['/v2/logout']: function
|
|
158
|
+
['/v2/logout']: function (req, res) {
|
|
182
159
|
var _a;
|
|
183
160
|
req.session = null;
|
|
184
161
|
let returnToUrl = (_a = req.query.returnTo) !== null && _a !== void 0 ? _a : req.headers.referer;
|
|
185
162
|
(0, assert_ts_1.assert)(typeof returnToUrl === 'string', `no logical returnTo url`);
|
|
186
163
|
res.redirect(returnToUrl);
|
|
187
164
|
},
|
|
188
|
-
['/userinfo']: function
|
|
165
|
+
['/userinfo']: function (req, res) {
|
|
189
166
|
let authorizationHeader = req.headers.authorization;
|
|
190
167
|
(0, assert_ts_1.assert)(!!authorizationHeader, 'no authorization header');
|
|
191
168
|
let [, token] = authorizationHeader.split(' ');
|
|
192
169
|
let { sub } = (0, jsonwebtoken_1.decode)(token, { json: true });
|
|
193
|
-
let user = personQuery((
|
|
170
|
+
let user = personQuery((person) => {
|
|
194
171
|
(0, assert_ts_1.assert)(!!person.id, `no email defined on person scenario`);
|
|
195
172
|
return person.id === sub;
|
|
196
173
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth0-handlers.js","sourceRoot":"","sources":["../../src/handlers/auth0-handlers.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"auth0-handlers.js","sourceRoot":"","sources":["../../src/handlers/auth0-handlers.ts"],"names":[],"mappings":";;;AAGA,qDAA8D;AAC9D,+CAAwD;AACxD,0CAA2C;AAC3C,yCAAmC;AACnC,6CAAwC;AACxC,2CAA4C;AAC5C,kEAAkE;AAClE,uCAAoD;AACpD,qCAAiD;AACjD,wDAA0D;AAE1D,+CAAqD;AAqBrD,MAAM,iBAAiB,GAAG,CAAC,MAAwB,EAAE,EAAE,CAAC,CAAC,SAA4B,EAAE,EAAE;IACvF,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACrC,CAAC,CAAC;AAEK,MAAM,mBAAmB,GAAG,CAAC,KAAiB,EAAE,MAAwB,EAAE,UAAqB,EAAE,OAA2B,EAAkC,EAAE;IACrK,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC;IAC5D,IAAI,WAAW,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC5C,IAAI,WAAW,GAAG,IAAA,gCAAiB,EAAC,cAAc,CAAC,CAAC;IAEpD,IAAI,iBAAiB,GAA0C;QAC7D,KAAK,EAAE,IAAA,2CAA0B,EAAC,OAAO,CAAC;QAC1C,WAAW,EAAE,IAAA,qCAAuB,GAAE;KACvC,CAAC;IAGF,OAAO;QACL,CAAC,YAAY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mB,uBAqO9B"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const getServiceUrl: (options:
|
|
1
|
+
import type { SimulationState } from '@simulacrum/server';
|
|
2
|
+
export declare const getServiceUrl: (options: SimulationState) => URL;
|
|
3
3
|
//# sourceMappingURL=get-service-url.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-service-url.d.ts","sourceRoot":"","sources":["../../src/handlers/get-service-url.ts"],"names":[],"mappings":"
|
|
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"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getServiceUrl = void 0;
|
|
4
4
|
const assert_ts_1 = require("assert-ts");
|
|
5
5
|
const getServiceUrl = (options) => {
|
|
6
|
-
let service = options.services.
|
|
6
|
+
let service = options.services.find(({ name }) => name === 'auth0');
|
|
7
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
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-service-url.js","sourceRoot":"","sources":["../../src/handlers/get-service-url.ts"],"names":[],"mappings":";;;
|
|
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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
export declare const createLoginRedirectHandler: (options:
|
|
1
|
+
import type { RequestHandler } from 'express';
|
|
2
|
+
import type { Auth0Configuration } from '../types';
|
|
3
|
+
export declare const createLoginRedirectHandler: (options: Auth0Configuration) => RequestHandler;
|
|
4
4
|
//# sourceMappingURL=login-redirect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-redirect.d.ts","sourceRoot":"","sources":["../../src/handlers/login-redirect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"login-redirect.d.ts","sourceRoot":"","sources":["../../src/handlers/login-redirect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,cAAc,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAe,MAAM,UAAU,CAAC;AAGhE,eAAO,MAAM,0BAA0B,YAAa,kBAAkB,KAAG,cA+BtE,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createLoginRedirectHandler = void 0;
|
|
4
4
|
const querystring_1 = require("querystring");
|
|
5
|
-
const createLoginRedirectHandler = (options) => function
|
|
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
7
|
res.status(302).redirect(`/login?${(0, querystring_1.stringify)({
|
|
8
8
|
state,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-redirect.js","sourceRoot":"","sources":["../../src/handlers/login-redirect.ts"],"names":[],"mappings":";;;AAEA,6CAAwC;
|
|
1
|
+
{"version":3,"file":"login-redirect.js","sourceRoot":"","sources":["../../src/handlers/login-redirect.ts"],"names":[],"mappings":";;;AAEA,6CAAwC;AAEjC,MAAM,0BAA0B,GAAG,CAAC,OAA2B,EAAkB,EAAE,CACxF,SAAS,aAAa,CAAE,GAAY,EAAE,GAAa;IACjD,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"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Options } from 'src/types';
|
|
1
|
+
import type { RequestHandler } from 'express';
|
|
3
2
|
declare type Routes = '/jwks.json' | '/openid-configuration';
|
|
4
3
|
export declare type OpenIdRoutes = `${`/.well-known`}${Routes}`;
|
|
5
4
|
export interface OpenIdConfiguration {
|
|
@@ -9,6 +8,6 @@ export interface OpenIdConfiguration {
|
|
|
9
8
|
userinfo_endpoint: string;
|
|
10
9
|
jwks_uri: string;
|
|
11
10
|
}
|
|
12
|
-
export declare const createOpenIdHandlers: (
|
|
11
|
+
export declare const createOpenIdHandlers: (serviceURL: () => URL) => Record<OpenIdRoutes, RequestHandler>;
|
|
13
12
|
export {};
|
|
14
13
|
//# sourceMappingURL=openid-handlers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openid-handlers.d.ts","sourceRoot":"","sources":["../../src/handlers/openid-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"openid-handlers.d.ts","sourceRoot":"","sources":["../../src/handlers/openid-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAI9C,aAAK,MAAM,GACP,YAAY,GACZ,uBAAuB,CAAA;AAE3B,oBAAY,YAAY,GAAG,GAAG,cAAc,GAAG,MAAM,EAAE,CAAA;AAEvD,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB,EAAE,MAAM,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,oBAAoB,eAAgB,MAAM,GAAG,KAAG,OAAO,YAAY,EAAE,cAAc,CAkB/F,CAAC"}
|
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createOpenIdHandlers = void 0;
|
|
4
4
|
const constants_1 = require("../auth/constants");
|
|
5
|
-
const get_service_url_1 = require("./get-service-url");
|
|
6
5
|
const url_1 = require("./url");
|
|
7
|
-
const createOpenIdHandlers = (
|
|
6
|
+
const createOpenIdHandlers = (serviceURL) => {
|
|
8
7
|
return {
|
|
9
|
-
['/.well-known/jwks.json']: function
|
|
8
|
+
['/.well-known/jwks.json']: function (_, res) {
|
|
10
9
|
res.json(constants_1.JWKS);
|
|
11
10
|
},
|
|
12
|
-
['/.well-known/openid-configuration']: function
|
|
13
|
-
let url = (0, url_1.removeTrailingSlash)((
|
|
11
|
+
['/.well-known/openid-configuration']: function (_, res) {
|
|
12
|
+
let url = (0, url_1.removeTrailingSlash)(serviceURL().toString());
|
|
14
13
|
res.json({
|
|
15
14
|
issuer: `${url}/`,
|
|
16
15
|
authorization_endpoint: [url, "authorize"].join('/'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openid-handlers.js","sourceRoot":"","sources":["../../src/handlers/openid-handlers.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"openid-handlers.js","sourceRoot":"","sources":["../../src/handlers/openid-handlers.ts"],"names":[],"mappings":";;;AACA,iDAAyC;AACzC,+BAA4C;AAgBrC,MAAM,oBAAoB,GAAG,CAAC,UAAqB,EAAwC,EAAE;IAClG,OAAO;QACL,CAAC,wBAAwB,CAAC,EAAE,UAAS,CAAC,EAAE,GAAG;YACzC,GAAG,CAAC,IAAI,CAAC,gBAAI,CAAC,CAAC;QACjB,CAAC;QAED,CAAC,mCAAmC,CAAC,EAAE,UAAS,CAAC,EAAE,GAAG;YACpD,IAAI,GAAG,GAAG,IAAA,yBAAmB,EAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;YAEvD,GAAG,CAAC,IAAI,CAAC;gBACP,MAAM,EAAE,GAAG,GAAG,GAAG;gBACjB,sBAAsB,EAAE,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;gBACpD,cAAc,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;gBACjD,iBAAiB,EAAE,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;gBAC9C,QAAQ,EAAE,CAAC,GAAG,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;aACtD,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAlBW,QAAA,oBAAoB,wBAkB/B"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const createWebMessageHandler: () =>
|
|
1
|
+
import type { RequestHandler } from 'express';
|
|
2
|
+
export declare const createWebMessageHandler: () => RequestHandler;
|
|
3
3
|
//# sourceMappingURL=web-message.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-message.d.ts","sourceRoot":"","sources":["../../src/handlers/web-message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"web-message.d.ts","sourceRoot":"","sources":["../../src/handlers/web-message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAM9C,eAAO,MAAM,uBAAuB,QAAO,cAwBxC,CAAC"}
|
|
@@ -4,7 +4,7 @@ exports.createWebMessageHandler = void 0;
|
|
|
4
4
|
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
|
-
const createWebMessageHandler = () => function
|
|
7
|
+
const createWebMessageHandler = () => function (req, res) {
|
|
8
8
|
(0, assert_ts_1.assert)(!!req.session, "no session");
|
|
9
9
|
let username = req.session.username;
|
|
10
10
|
(0, assert_ts_1.assert)(!!username, `no username in authorise`);
|
|
@@ -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,
|
|
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,GAAmB,EAAE,CAC1D,UAAS,GAAG,EAAE,GAAG;IACf,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
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import type { Simulator } from '@simulacrum/server';
|
|
2
|
-
import type {
|
|
1
|
+
import type { Person, Simulator } from '@simulacrum/server';
|
|
2
|
+
import type { Auth0Store } from './handlers/auth0-handlers';
|
|
3
|
+
import type { Auth0Configuration } from './types';
|
|
3
4
|
export { getConfig } from './config/get-config';
|
|
4
|
-
export
|
|
5
|
+
export interface Auth0ServerOptions {
|
|
6
|
+
config: Auth0Configuration;
|
|
7
|
+
store: Auth0Store;
|
|
8
|
+
people: Iterable<Person>;
|
|
9
|
+
serviceURL: () => URL;
|
|
10
|
+
port?: number;
|
|
11
|
+
debug?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const auth0: Simulator;
|
|
5
14
|
//# sourceMappingURL=index.d.ts.map
|
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,MAAM,EAA2B,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAMrF,OAAO,KAAK,EAAE,UAAU,EAAe,MAAM,2BAA2B,CAAC;AAOzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAQhD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAoFD,eAAO,MAAM,KAAK,EAAE,SAanB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,63 +1,115 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
2
21
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
23
|
};
|
|
5
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
25
|
exports.auth0 = exports.getConfig = void 0;
|
|
7
26
|
const server_1 = require("@simulacrum/server");
|
|
8
|
-
const
|
|
9
|
-
const express_1 = require("express");
|
|
10
|
-
const auth0_handlers_1 = require("./handlers/auth0-handlers");
|
|
11
|
-
const server_3 = require("@simulacrum/server");
|
|
12
|
-
const session_1 = require("./middleware/session");
|
|
27
|
+
const express_1 = __importStar(require("express"));
|
|
13
28
|
const path_1 = __importDefault(require("path"));
|
|
14
|
-
const
|
|
29
|
+
const get_config_1 = require("./config/get-config");
|
|
30
|
+
const auth0_handlers_1 = require("./handlers/auth0-handlers");
|
|
31
|
+
const get_service_url_1 = require("./handlers/get-service-url");
|
|
32
|
+
const openid_handlers_1 = require("./handlers/openid-handlers");
|
|
15
33
|
const create_cors_1 = require("./middleware/create-cors");
|
|
16
34
|
const no_cache_1 = require("./middleware/no-cache");
|
|
17
|
-
const
|
|
18
|
-
const get_config_1 = require("./config/get-config");
|
|
35
|
+
const session_1 = require("./middleware/session");
|
|
19
36
|
var get_config_2 = require("./config/get-config");
|
|
20
37
|
Object.defineProperty(exports, "getConfig", { enumerable: true, get: function () { return get_config_2.getConfig; } });
|
|
21
38
|
const publicDir = path_1.default.join(__dirname, 'views', 'public');
|
|
22
|
-
const createAuth0Service = (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
.
|
|
30
|
-
.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
const createAuth0Service = (slice, options) => ({
|
|
40
|
+
name: 'Auth0Service',
|
|
41
|
+
*init() {
|
|
42
|
+
let debug = !!slice.slice('debug').get();
|
|
43
|
+
let { port } = options;
|
|
44
|
+
let config = (0, get_config_1.getConfig)(slice.slice('options').slice('options').get());
|
|
45
|
+
let serviceURL = () => (0, get_service_url_1.getServiceUrl)(slice.get());
|
|
46
|
+
let auth0Store = slice.slice('store').slice('auth0');
|
|
47
|
+
auth0Store.set({});
|
|
48
|
+
let store = {
|
|
49
|
+
get: (nonce) => auth0Store.slice(nonce).get(),
|
|
50
|
+
set: (nonce, session) => auth0Store.slice(nonce).set(session),
|
|
51
|
+
};
|
|
52
|
+
let people = {
|
|
53
|
+
*[Symbol.iterator]() {
|
|
54
|
+
var _a;
|
|
55
|
+
let values = Object.values((_a = slice.slice('store').slice('people').get()) !== null && _a !== void 0 ? _a : {});
|
|
56
|
+
for (let person of values) {
|
|
57
|
+
yield person;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
let server = yield createAuth0Server({
|
|
62
|
+
debug,
|
|
63
|
+
config,
|
|
64
|
+
store,
|
|
65
|
+
serviceURL,
|
|
66
|
+
people,
|
|
67
|
+
port
|
|
68
|
+
});
|
|
69
|
+
return {
|
|
70
|
+
port: server.port,
|
|
71
|
+
protocol: 'https',
|
|
72
|
+
};
|
|
43
73
|
}
|
|
74
|
+
});
|
|
75
|
+
function createAuth0Server(options) {
|
|
76
|
+
let { config, serviceURL, store, people, port, debug = true } = options;
|
|
77
|
+
let auth0 = (0, auth0_handlers_1.createAuth0Handlers)(store, people, serviceURL, config);
|
|
78
|
+
let openid = (0, openid_handlers_1.createOpenIdHandlers)(serviceURL);
|
|
44
79
|
return {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
80
|
+
name: 'Auth0Server',
|
|
81
|
+
*init() {
|
|
82
|
+
let app = (0, express_1.default)()
|
|
83
|
+
.use(express_1.default.static(publicDir))
|
|
84
|
+
.use((0, session_1.createSession)())
|
|
85
|
+
.use((0, create_cors_1.createCors)())
|
|
86
|
+
.use((0, no_cache_1.noCache)())
|
|
87
|
+
.use((0, express_1.json)())
|
|
88
|
+
.use((0, express_1.urlencoded)({ extended: true }))
|
|
89
|
+
.get('/heartbeat', auth0['/heartbeat'])
|
|
90
|
+
.get('/authorize', auth0['/authorize'])
|
|
91
|
+
.get('/login', auth0['/login'])
|
|
92
|
+
.get('/u/login', auth0['/usernamepassword/login'])
|
|
93
|
+
.post('/usernamepassword/login', auth0['/usernamepassword/login'])
|
|
94
|
+
.post('/login/callback', auth0['/login/callback'])
|
|
95
|
+
.post('/oauth/token', auth0['/oauth/token'])
|
|
96
|
+
.get('/userinfo', auth0['/userinfo'])
|
|
97
|
+
.get('/v2/logout', auth0['/v2/logout'])
|
|
98
|
+
.get('/.well-known/jwks.json', openid['/.well-known/jwks.json'])
|
|
99
|
+
.get('/.well-known/openid-configuration', openid['/.well-known/openid-configuration']);
|
|
100
|
+
if (debug) {
|
|
101
|
+
app.use(server_1.consoleLogger);
|
|
102
|
+
}
|
|
103
|
+
let server = yield (0, server_1.createServer)(app, { protocol: 'https', port });
|
|
104
|
+
return {
|
|
105
|
+
port: server.address.port
|
|
106
|
+
};
|
|
107
|
+
}
|
|
48
108
|
};
|
|
49
|
-
}
|
|
50
|
-
const auth0 = (
|
|
51
|
-
let store = slice.slice('store');
|
|
52
|
-
let services = slice.slice('services');
|
|
53
|
-
let debug = !!slice.slice('debug').get();
|
|
54
|
-
let config = (0, get_config_1.getConfig)(options);
|
|
55
|
-
let handlersOptions = { ...config, store, services };
|
|
56
|
-
let auth0Handlers = (0, auth0_handlers_1.createAuth0Handlers)(handlersOptions);
|
|
57
|
-
let openIdHandlers = (0, openid_handlers_1.createOpenIdHandlers)(handlersOptions);
|
|
58
|
-
let serviceOptions = { debug, port: config.port };
|
|
109
|
+
}
|
|
110
|
+
const auth0 = () => {
|
|
59
111
|
return {
|
|
60
|
-
services: { auth0: createAuth0Service
|
|
112
|
+
services: { auth0: createAuth0Service },
|
|
61
113
|
scenarios: {
|
|
62
114
|
/**
|
|
63
115
|
* Here we just export the internal `person` scenario so that it can be
|
|
@@ -65,7 +117,7 @@ const auth0 = (slice, options) => {
|
|
|
65
117
|
* what we really need to have some way to _react_ to the person
|
|
66
118
|
* having been created and augment the record at that point.
|
|
67
119
|
*/
|
|
68
|
-
person:
|
|
120
|
+
person: server_1.person
|
|
69
121
|
}
|
|
70
122
|
};
|
|
71
123
|
};
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,+CAAyE;AAEzE,mDAAoD;AACpD,gDAAwB;AACxB,oDAAgD;AAEhD,8DAAgE;AAChE,gEAA2D;AAC3D,gEAAkE;AAClE,0DAAsD;AACtD,oDAAgD;AAChD,kDAAqD;AAGrD,kDAAgD;AAAvC,uGAAA,SAAS,OAAA;AAElB,MAAM,SAAS,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAe1D,MAAM,kBAAkB,GAA2B,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;IACtE,IAAI,EAAE,cAAc;IACpB,CAAC,IAAI;QACH,IAAI,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC;QACzC,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;QACvB,IAAI,MAAM,GAAG,IAAA,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,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;iBACtC,GAAG,CAAC,wBAAwB,EAAE,MAAM,CAAC,wBAAwB,CAAC,CAAC;iBAC/D,GAAG,CAAC,mCAAmC,EAAE,MAAM,CAAC,mCAAmC,CAAC,CAAC,CAAC;YAEzF,IAAI,KAAK,EAAE;gBACT,GAAG,CAAC,GAAG,CAAC,sBAAa,CAAC,CAAC;aACxB;YAED,IAAI,MAAM,GAAG,MAAM,IAAA,qBAAY,EAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;YAElE,OAAO;gBACL,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI;aAC1B,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC;AAEM,MAAM,KAAK,GAAc,GAAG,EAAE;IACnC,OAAO;QACL,QAAQ,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE;QACvC,SAAS,EAAE;YACT;;;;;eAKG;YACH,MAAM,EAAN,eAAM;SACP;KACF,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,KAAK,SAahB"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { SimulationState, Store } from '@simulacrum/server';
|
|
2
|
-
import type { Slice } from '@effection/atom';
|
|
3
1
|
import { z } from 'zod';
|
|
4
2
|
export declare const configurationSchema: z.ZodObject<{
|
|
5
3
|
port: z.ZodOptional<z.ZodNumber>;
|
|
@@ -41,10 +39,6 @@ export declare const configurationSchema: z.ZodObject<{
|
|
|
41
39
|
export declare type Schema = z.infer<typeof configurationSchema>;
|
|
42
40
|
declare type ReadonlyFields = 'audience' | 'clientID' | 'scope' | 'port';
|
|
43
41
|
export declare type Auth0Configuration = Required<Pick<Schema, ReadonlyFields>> & Omit<Schema, ReadonlyFields>;
|
|
44
|
-
export declare type Options = Auth0Configuration & {
|
|
45
|
-
store: Store;
|
|
46
|
-
services: Slice<SimulationState['services']>;
|
|
47
|
-
};
|
|
48
42
|
export declare type ResponseModes = 'query' | 'web_message';
|
|
49
43
|
export declare type QueryParams = {
|
|
50
44
|
state: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY9B,CAAC;AAEH,oBAAY,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEzD,aAAK,cAAc,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;AAEjE,oBAAY,kBAAkB,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,GACpC,IAAI,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAChE,oBAAY,aAAa,GAAG,OAAO,GAAG,aAAa,CAAC;AAEpD,oBAAY,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB,EAAE,MAAM,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,WAAW,QAAQ;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IAEd,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;CAC3C;AAED,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,kBAAkB,CAAC;CAC7B"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,0BAA0B;AACb,QAAA,mBAAmB,GAAG,OAAC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
|
|
4
4
|
"description": "Run local instance of Auth0 API for local development and integration testing",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": "bin/index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@effection/process": "^2.0.1",
|
|
42
42
|
"@simulacrum/client": "0.5.4",
|
|
43
|
-
"@simulacrum/server": "0.6.
|
|
43
|
+
"@simulacrum/server": "0.6.2",
|
|
44
44
|
"@types/faker": "^5.1.7",
|
|
45
45
|
"assert-ts": "^0.3.2",
|
|
46
46
|
"base64-url": "^2.3.3",
|