@auth0/auth0-express 1.0.0-beta.1 → 1.0.0-beta.3
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/README.md +26 -2
- package/dist/app-base-url.d.ts +31 -0
- package/dist/app-base-url.d.ts.map +1 -0
- package/dist/app-base-url.js +106 -0
- package/dist/app-base-url.js.map +1 -0
- package/dist/config.d.ts +15 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +106 -0
- package/dist/config.js.map +1 -0
- package/dist/errors/index.d.ts +6 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +9 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/handlers/backchannel-logout-handler.d.ts +3 -0
- package/dist/handlers/backchannel-logout-handler.d.ts.map +1 -0
- package/dist/handlers/backchannel-logout-handler.js +15 -0
- package/dist/handlers/backchannel-logout-handler.js.map +1 -0
- package/dist/handlers/callback-handler.d.ts +4 -0
- package/dist/handlers/callback-handler.d.ts.map +1 -0
- package/dist/handlers/callback-handler.js +30 -0
- package/dist/handlers/callback-handler.js.map +1 -0
- package/dist/handlers/login-handler.d.ts +4 -0
- package/dist/handlers/login-handler.d.ts.map +1 -0
- package/dist/handlers/login-handler.js +83 -0
- package/dist/handlers/login-handler.js.map +1 -0
- package/dist/handlers/logout-handler.d.ts +4 -0
- package/dist/handlers/logout-handler.d.ts.map +1 -0
- package/dist/handlers/logout-handler.js +22 -0
- package/dist/handlers/logout-handler.js.map +1 -0
- package/dist/handlers/start-enterprise-login.d.ts +21 -0
- package/dist/handlers/start-enterprise-login.d.ts.map +1 -0
- package/dist/handlers/start-enterprise-login.js +26 -0
- package/dist/handlers/start-enterprise-login.js.map +1 -0
- package/dist/index.d.ts +14 -343
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -521
- package/dist/index.js.map +1 -1
- package/dist/middleware/claim-auth.d.ts +28 -0
- package/dist/middleware/claim-auth.d.ts.map +1 -0
- package/dist/middleware/claim-auth.js +2 -0
- package/dist/middleware/claim-auth.js.map +1 -0
- package/dist/middleware/claim-check.d.ts +41 -0
- package/dist/middleware/claim-check.d.ts.map +1 -0
- package/dist/middleware/claim-check.js +62 -0
- package/dist/middleware/claim-check.js.map +1 -0
- package/dist/middleware/claim-equals.d.ts +27 -0
- package/dist/middleware/claim-equals.d.ts.map +1 -0
- package/dist/middleware/claim-equals.js +48 -0
- package/dist/middleware/claim-equals.js.map +1 -0
- package/dist/middleware/claim-includes.d.ts +37 -0
- package/dist/middleware/claim-includes.d.ts.map +1 -0
- package/dist/middleware/claim-includes.js +68 -0
- package/dist/middleware/claim-includes.js.map +1 -0
- package/dist/middleware/require-auth.d.ts +48 -0
- package/dist/middleware/require-auth.d.ts.map +1 -0
- package/dist/middleware/require-auth.js +61 -0
- package/dist/middleware/require-auth.js.map +1 -0
- package/dist/migration/index.d.ts +5 -0
- package/dist/migration/index.d.ts.map +1 -0
- package/dist/migration/index.js +3 -0
- package/dist/migration/index.js.map +1 -0
- package/dist/router.d.ts +34 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/router.js +76 -0
- package/dist/router.js.map +1 -0
- package/dist/store/express-cookie-handler.d.ts +17 -0
- package/dist/store/express-cookie-handler.d.ts.map +1 -0
- package/dist/store/express-cookie-handler.js +30 -0
- package/dist/store/express-cookie-handler.js.map +1 -0
- package/dist/store/express-oidc-hkdf.d.ts +2 -0
- package/dist/store/express-oidc-hkdf.d.ts.map +1 -0
- package/dist/store/express-oidc-hkdf.js +11 -0
- package/dist/store/express-oidc-hkdf.js.map +1 -0
- package/dist/store/legacy-compatible-stateful-state-store.d.ts +139 -0
- package/dist/store/legacy-compatible-stateful-state-store.d.ts.map +1 -0
- package/dist/store/legacy-compatible-stateful-state-store.js +234 -0
- package/dist/store/legacy-compatible-stateful-state-store.js.map +1 -0
- package/dist/store/legacy-compatible-stateless-state-store.d.ts +82 -0
- package/dist/store/legacy-compatible-stateless-state-store.d.ts.map +1 -0
- package/dist/store/legacy-compatible-stateless-state-store.js +135 -0
- package/dist/store/legacy-compatible-stateless-state-store.js.map +1 -0
- package/dist/store/legacy-session-transformer.d.ts +67 -0
- package/dist/store/legacy-session-transformer.d.ts.map +1 -0
- package/dist/store/legacy-session-transformer.js +118 -0
- package/dist/store/legacy-session-transformer.js.map +1 -0
- package/dist/store/request-context.d.ts +36 -0
- package/dist/store/request-context.d.ts.map +1 -0
- package/dist/store/request-context.js +49 -0
- package/dist/store/request-context.js.map +1 -0
- package/dist/types/express.d.ts +13 -0
- package/dist/types/express.d.ts.map +1 -0
- package/dist/types/express.js +2 -0
- package/dist/types/express.js.map +1 -0
- package/dist/types.d.ts +190 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +35 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +186 -0
- package/dist/utils.js.map +1 -0
- package/package.json +22 -14
- package/dist/index.cjs +0 -566
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -343
package/dist/utils.js
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { CookieTransactionStore, ServerClient, StatefulStateStore, StatelessStateStore } from '@auth0/auth0-server-js';
|
|
2
|
+
import { ExpressCookieHandler } from './store/express-cookie-handler.js';
|
|
3
|
+
import { MigrationStatelessStateStore } from './store/legacy-compatible-stateless-state-store.js';
|
|
4
|
+
import { MigrationStatefulStateStore } from './store/legacy-compatible-stateful-state-store.js';
|
|
5
|
+
import { getRequestContext } from './store/request-context.js';
|
|
6
|
+
/**
|
|
7
|
+
* Ensures the value has a trailing slash.
|
|
8
|
+
* If it does not, it will append one.
|
|
9
|
+
* @param value The value to ensure has a trailing slash.
|
|
10
|
+
* @returns The value with a trailing slash.
|
|
11
|
+
*/
|
|
12
|
+
function ensureTrailingSlash(value) {
|
|
13
|
+
return value && !value.endsWith('/') ? `${value}/` : value;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Ensures the value does not have any leading slashes or backslashes.
|
|
17
|
+
* If it does, it will trim all of them.
|
|
18
|
+
* @param value The value to ensure has no leading slashes or backslashes.
|
|
19
|
+
* @returns The value without leading slashes or backslashes.
|
|
20
|
+
*/
|
|
21
|
+
function ensureNoLeadingSlash(value) {
|
|
22
|
+
return value.replace(/^[/\\]+/, '');
|
|
23
|
+
}
|
|
24
|
+
// Matches only URLs with an authority component (e.g. https://, http://, file://).
|
|
25
|
+
// Bare-scheme inputs like `javascript:alert(1)` or `report:summary` do NOT match
|
|
26
|
+
// and are treated as relative paths — resolved safely against the base URL.
|
|
27
|
+
const AUTHORITY_URL_REGEX = /^[a-zA-Z][a-zA-Z0-9.+-]*:\/\//;
|
|
28
|
+
// Matches any scheme-like prefix (e.g. `javascript:`, `data:`, `report:`).
|
|
29
|
+
// Used to detect first-segment colons that would confuse the WHATWG URL parser
|
|
30
|
+
// when resolving relative paths, so we can prefix them with `./`.
|
|
31
|
+
const SCHEME_PREFIX_REGEX = /^[a-zA-Z][a-zA-Z0-9.+-]*:/;
|
|
32
|
+
// Schemes that must never be used as a redirect or route destination.
|
|
33
|
+
// These can execute code or render arbitrary content in a browser.
|
|
34
|
+
const UNSAFE_SCHEME_REGEX = /^(javascript|data|vbscript):/i;
|
|
35
|
+
/**
|
|
36
|
+
* Wraps a user-provided domain resolver so it always receives the Express
|
|
37
|
+
* request context. `@auth0/auth0-server-js` invokes the resolver with the
|
|
38
|
+
* `storeOptions` passed to client methods; this SDK relies on
|
|
39
|
+
* `AsyncLocalStorage` instead of passing them explicitly, so when
|
|
40
|
+
* `storeOptions` is absent we recover it via `getRequestContext()` — the same
|
|
41
|
+
* fallback used by `ExpressCookieHandler`.
|
|
42
|
+
*
|
|
43
|
+
* A static string domain is returned unchanged.
|
|
44
|
+
*/
|
|
45
|
+
export function wrapDomainResolver(domain) {
|
|
46
|
+
if (typeof domain === 'string') {
|
|
47
|
+
return domain;
|
|
48
|
+
}
|
|
49
|
+
return (storeOptions) => domain(storeOptions ?? getRequestContext());
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Utility function to ensure Route URLs are created correctly when using both the root and subpath as base URL.
|
|
53
|
+
* Accepts a relative path or an absolute same-origin URL, such as one forwarded by a reverse proxy.
|
|
54
|
+
* Validates that the constructed URL has the same origin as the base URL to prevent host override attacks.
|
|
55
|
+
* @param url Relative path (e.g. `/auth/callback`) or absolute same-origin URL.
|
|
56
|
+
* @param base The base URL to use, including any subpath.
|
|
57
|
+
* @returns A URL object, combining the base and url.
|
|
58
|
+
* @throws {Error} If the input contains multiple leading slashes/backslashes or the origin does not match the base URL.
|
|
59
|
+
*/
|
|
60
|
+
export function createRouteUrl(url, base) {
|
|
61
|
+
const baseUrl = new URL(ensureTrailingSlash(base));
|
|
62
|
+
if (AUTHORITY_URL_REGEX.test(url)) {
|
|
63
|
+
// Absolute URL with authority (https://, http://, file://, etc.).
|
|
64
|
+
// Resolve against the base so the subpath is validated, then check origin.
|
|
65
|
+
let absolute;
|
|
66
|
+
try {
|
|
67
|
+
absolute = new URL(url);
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
throw new Error(`URL is not allowed: '${url}' is not a valid URL`);
|
|
71
|
+
}
|
|
72
|
+
if (absolute.origin !== baseUrl.origin) {
|
|
73
|
+
throw new Error('URL is not allowed: origin does not match base URL');
|
|
74
|
+
}
|
|
75
|
+
return absolute;
|
|
76
|
+
}
|
|
77
|
+
const normalized = ensureNoLeadingSlash(url);
|
|
78
|
+
if (normalized !== url.replace(/^[/\\]/, '')) {
|
|
79
|
+
throw new Error(`Invalid route configuration: '${url}' contains multiple leading slashes or backslashes`);
|
|
80
|
+
}
|
|
81
|
+
if (UNSAFE_SCHEME_REGEX.test(normalized)) {
|
|
82
|
+
throw new Error(`URL is not allowed: '${url}' uses an unsafe scheme`);
|
|
83
|
+
}
|
|
84
|
+
// Prepend `./` when the normalized path starts with a scheme-like prefix
|
|
85
|
+
// (e.g. `report:summary`) so the WHATWG URL parser treats it as a relative
|
|
86
|
+
// path rather than a scheme.
|
|
87
|
+
const resolvable = SCHEME_PREFIX_REGEX.test(normalized) ? `./${normalized}` : normalized;
|
|
88
|
+
const result = new URL(resolvable, baseUrl);
|
|
89
|
+
if (result.origin !== baseUrl.origin) {
|
|
90
|
+
throw new Error('URL is not allowed: origin does not match base URL');
|
|
91
|
+
}
|
|
92
|
+
return result;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Validates a user-supplied redirect URL (e.g. a `returnTo` query parameter) against the application base URL.
|
|
96
|
+
* Accepts relative paths and absolute same-origin URLs. Rejects different-origin URLs and injection attempts.
|
|
97
|
+
* Never throws — returns undefined for any invalid or unsafe input.
|
|
98
|
+
* @param dangerousRedirect Untrusted redirect URL from user input.
|
|
99
|
+
* @param safeBaseUrl The base URL to check against.
|
|
100
|
+
* @returns A safe redirect URL, or undefined if the input is not safe.
|
|
101
|
+
*/
|
|
102
|
+
export function toSafeRedirect(dangerousRedirect, safeBaseUrl) {
|
|
103
|
+
try {
|
|
104
|
+
// createRouteUrl validates origin for both absolute and relative inputs.
|
|
105
|
+
// Using it for both branches avoids duplicating AUTHORITY_URL_REGEX logic here
|
|
106
|
+
// and ensures subpath preservation for relative paths in subpath deployments.
|
|
107
|
+
return createRouteUrl(dangerousRedirect, safeBaseUrl).toString();
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
return undefined;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Factory function to create the appropriate state store based on the provided options.
|
|
115
|
+
* @param options The Auth0 options to determine which state store to create and configure.
|
|
116
|
+
* @returns An instance of a state store: stateful, stateless, or their legacy-compatible variants.
|
|
117
|
+
*/
|
|
118
|
+
function getStateStore(options) {
|
|
119
|
+
const isLegacy = options.legacyCompatibility !== undefined;
|
|
120
|
+
if (options.sessionStore) {
|
|
121
|
+
// Use stateful store with custom session store (Redis, MongoDB, etc.)
|
|
122
|
+
if (isLegacy) {
|
|
123
|
+
// Legacy-compatible stateful store for express-openid-connect migration
|
|
124
|
+
return new MigrationStatefulStateStore({
|
|
125
|
+
secret: options.sessionSecret,
|
|
126
|
+
store: options.sessionStore,
|
|
127
|
+
legacySecret: options.legacyCompatibility?.legacySecret,
|
|
128
|
+
legacyAudience: options.legacyCompatibility?.legacyAudience,
|
|
129
|
+
legacyScope: options.legacyCompatibility?.legacyScope,
|
|
130
|
+
requireSignedLegacyCookie: options.legacyCompatibility?.requireSignedLegacyCookie,
|
|
131
|
+
sessionConfiguration: options.sessionConfiguration,
|
|
132
|
+
}, new ExpressCookieHandler());
|
|
133
|
+
}
|
|
134
|
+
// Standard stateful store
|
|
135
|
+
return new StatefulStateStore({
|
|
136
|
+
...options.sessionConfiguration,
|
|
137
|
+
secret: options.sessionSecret,
|
|
138
|
+
store: options.sessionStore,
|
|
139
|
+
}, new ExpressCookieHandler());
|
|
140
|
+
}
|
|
141
|
+
if (isLegacy) {
|
|
142
|
+
// Legacy-compatible stateless store for express-openid-connect migration
|
|
143
|
+
return new MigrationStatelessStateStore({
|
|
144
|
+
secret: options.sessionSecret,
|
|
145
|
+
legacySecret: options.legacyCompatibility?.legacySecret,
|
|
146
|
+
legacyAudience: options.legacyCompatibility?.legacyAudience,
|
|
147
|
+
legacyScope: options.legacyCompatibility?.legacyScope,
|
|
148
|
+
sessionConfiguration: options.sessionConfiguration,
|
|
149
|
+
}, new ExpressCookieHandler());
|
|
150
|
+
}
|
|
151
|
+
// Standard stateless store
|
|
152
|
+
return new StatelessStateStore({
|
|
153
|
+
...options.sessionConfiguration,
|
|
154
|
+
secret: options.sessionSecret,
|
|
155
|
+
}, new ExpressCookieHandler());
|
|
156
|
+
}
|
|
157
|
+
export function createServerClientInstance(options) {
|
|
158
|
+
const callbackPath = options.routes?.callback ?? '/auth/callback';
|
|
159
|
+
// Only a static string base URL yields a startup redirect_uri. In dynamic
|
|
160
|
+
// (undefined) or allow-list (array) mode, the login handler sets redirect_uri
|
|
161
|
+
// per request from the resolved base URL.
|
|
162
|
+
const staticAppBaseUrl = typeof options.appBaseUrl === 'string' ? options.appBaseUrl : undefined;
|
|
163
|
+
const redirectUri = staticAppBaseUrl
|
|
164
|
+
? createRouteUrl(callbackPath, staticAppBaseUrl).toString()
|
|
165
|
+
: undefined;
|
|
166
|
+
const isEnterpriseConnect = !!options.enterpriseConnect;
|
|
167
|
+
return new ServerClient({
|
|
168
|
+
domain: wrapDomainResolver(options.domain),
|
|
169
|
+
clientId: options.clientId,
|
|
170
|
+
clientSecret: options.clientSecret,
|
|
171
|
+
clientAssertionSigningKey: options.clientAssertionSigningKey,
|
|
172
|
+
clientAssertionSigningAlg: options.clientAssertionSigningAlg,
|
|
173
|
+
enterpriseConnect: isEnterpriseConnect || undefined,
|
|
174
|
+
authorizationParams: {
|
|
175
|
+
audience: options.audience,
|
|
176
|
+
redirect_uri: redirectUri,
|
|
177
|
+
},
|
|
178
|
+
transactionStore: new CookieTransactionStore({ secret: options.sessionSecret }, new ExpressCookieHandler()),
|
|
179
|
+
// In EC mode, server-js uses NullStateStore automatically; do not pass stateStore.
|
|
180
|
+
stateStore: isEnterpriseConnect ? undefined : getStateStore(options),
|
|
181
|
+
stateIdentifier: options.sessionConfiguration?.cookie?.name,
|
|
182
|
+
customFetch: options.customFetch,
|
|
183
|
+
discoveryCache: options.discoveryCache,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAGvH,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAC;AAClG,OAAO,EAAE,2BAA2B,EAAE,MAA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mFAAmF;QACnF,UAAU,EAAE,mBAAmB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC;QACpE,eAAe,EAAE,OAAO,CAAC,oBAAoB,EAAE,MAAM,EAAE,IAAI;QAC3D,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,cAAc,EAAE,OAAO,CAAC,cAAc;KACvC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,46 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@auth0/auth0-express",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.3",
|
|
4
4
|
"description": "Auth0 Authentication SDK for Express Applications on JavaScript runtimes",
|
|
5
5
|
"author": "Auth0",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"type": "module",
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": "^22.12.0 || >=24"
|
|
10
|
+
},
|
|
8
11
|
"scripts": {
|
|
9
|
-
"build": "
|
|
10
|
-
"build:watch": "
|
|
12
|
+
"build": "tsc --project tsconfig.build.json",
|
|
13
|
+
"build:watch": "tsc --project tsconfig.build.json --watch",
|
|
11
14
|
"clean": "rm -rf ./dist",
|
|
12
15
|
"lint": "eslint \"./**/*.ts*\"",
|
|
13
16
|
"test": "vitest run",
|
|
14
17
|
"test:ci": "vitest --watch false --coverage"
|
|
15
18
|
},
|
|
16
19
|
"types": "./dist/index.d.ts",
|
|
17
|
-
"main": "./dist/index.
|
|
18
|
-
"module": "./dist/index.js",
|
|
20
|
+
"main": "./dist/index.js",
|
|
19
21
|
"exports": {
|
|
20
22
|
".": {
|
|
21
23
|
"types": "./dist/index.d.ts",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
+
"import": "./dist/index.js",
|
|
25
|
+
"default": "./dist/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./migration": {
|
|
28
|
+
"types": "./dist/migration/index.d.ts",
|
|
29
|
+
"import": "./dist/migration/index.js",
|
|
30
|
+
"default": "./dist/migration/index.js"
|
|
24
31
|
}
|
|
25
32
|
},
|
|
26
33
|
"devDependencies": {
|
|
27
|
-
"@eslint/js": "^
|
|
34
|
+
"@eslint/js": "^10.0.1",
|
|
28
35
|
"@types/cookie-parser": "^1.4.10",
|
|
29
36
|
"@types/express": "^5.0.6",
|
|
30
37
|
"@types/supertest": "^6.0.3",
|
|
31
|
-
"@vitest/coverage-v8": "^
|
|
32
|
-
"eslint": "^9.
|
|
38
|
+
"@vitest/coverage-v8": "^5.0.0",
|
|
39
|
+
"eslint": "^10.9.1",
|
|
33
40
|
"express": "^5.2.1",
|
|
41
|
+
"express-openid-connect": "^3.2.0",
|
|
34
42
|
"msw": "^2.12.14",
|
|
35
43
|
"supertest": "^7.2.2",
|
|
36
|
-
"tsup": "^8.5.1",
|
|
37
44
|
"typescript": "~5.9.3",
|
|
38
45
|
"typescript-eslint": "^8.58.0",
|
|
39
|
-
"vitest": "^
|
|
46
|
+
"vitest": "^5.0.0"
|
|
40
47
|
},
|
|
41
48
|
"dependencies": {
|
|
42
|
-
"@auth0/auth0-server-js": "^1.
|
|
43
|
-
"cookie-parser": "^1.4.7"
|
|
49
|
+
"@auth0/auth0-server-js": "^1.14.0",
|
|
50
|
+
"cookie-parser": "^1.4.7",
|
|
51
|
+
"jose": "^6.0.8"
|
|
44
52
|
},
|
|
45
53
|
"peerDependencies": {
|
|
46
54
|
"express": "^4.18.0 || ^5.0.0"
|