@drawbridge/drawbridge-utils 0.0.45 → 0.0.46
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/dist/oauth/index.cjs +13 -0
- package/dist/oauth/index.d.cts +21 -1
- package/dist/oauth/index.d.ts +21 -1
- package/dist/oauth/index.js +11 -0
- package/package.json +1 -1
package/dist/oauth/index.cjs
CHANGED
|
@@ -29,7 +29,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
// lib/oauth/index.js
|
|
30
30
|
var oauth_exports = {};
|
|
31
31
|
__export(oauth_exports, {
|
|
32
|
+
clients: () => clients,
|
|
32
33
|
compare: () => compare,
|
|
34
|
+
cookies: () => cookies,
|
|
33
35
|
createOAuthClient: () => createOAuthClient,
|
|
34
36
|
developer: () => developer,
|
|
35
37
|
developerOptions: () => developerOptions,
|
|
@@ -68,6 +70,15 @@ var compare = (a, b) => {
|
|
|
68
70
|
};
|
|
69
71
|
|
|
70
72
|
// lib/oauth/index.js
|
|
73
|
+
var cookies = {
|
|
74
|
+
csrf: "drawbridge.csrf",
|
|
75
|
+
refresh: "drawbridge.refresh",
|
|
76
|
+
session: "drawbridge.session"
|
|
77
|
+
};
|
|
78
|
+
var clients = {
|
|
79
|
+
dashboard: "drawbridge-dashboard",
|
|
80
|
+
share: "drawbridge-share"
|
|
81
|
+
};
|
|
71
82
|
var scopes = [
|
|
72
83
|
"profile:read",
|
|
73
84
|
"profile:write",
|
|
@@ -209,7 +220,9 @@ var createOAuthClient = ({
|
|
|
209
220
|
};
|
|
210
221
|
// Annotate the CommonJS export names for ESM import in node:
|
|
211
222
|
0 && (module.exports = {
|
|
223
|
+
clients,
|
|
212
224
|
compare,
|
|
225
|
+
cookies,
|
|
213
226
|
createOAuthClient,
|
|
214
227
|
developer,
|
|
215
228
|
developerOptions,
|
package/dist/oauth/index.d.cts
CHANGED
|
@@ -10,8 +10,28 @@ import 'crypto';
|
|
|
10
10
|
// - parse, validate, intersect, isDeveloperAllowed: scope set operations
|
|
11
11
|
// - hashToken, generateToken, compare: opaque-token primitives
|
|
12
12
|
// - createOAuthClient: cached client_credentials access token getter
|
|
13
|
+
// - cookies, clients: shared identifier constants so cookie + first-party
|
|
14
|
+
// client names stay in lockstep across repos (api/middleware, api/auth,
|
|
15
|
+
// app-web BFF, sync WS handshake, seed scripts)
|
|
13
16
|
|
|
14
17
|
|
|
18
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
19
|
+
// Shared identifier constants — every repo reads from here so the strings
|
|
20
|
+
// stay aligned. Adding a new cookie or first-party client means one edit
|
|
21
|
+
// in this file followed by a utils bump downstream.
|
|
22
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
23
|
+
|
|
24
|
+
const cookies = {
|
|
25
|
+
csrf : 'drawbridge.csrf',
|
|
26
|
+
refresh : 'drawbridge.refresh',
|
|
27
|
+
session : 'drawbridge.session'
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const clients = {
|
|
31
|
+
dashboard : 'drawbridge-dashboard',
|
|
32
|
+
share : 'drawbridge-share'
|
|
33
|
+
};
|
|
34
|
+
|
|
15
35
|
// ─────────────────────────────────────────────────────────────────────────
|
|
16
36
|
// Scope vocabulary (locked — 15 scopes, 10 in the developer-allowed subset)
|
|
17
37
|
// ─────────────────────────────────────────────────────────────────────────
|
|
@@ -260,4 +280,4 @@ const createOAuthClient = ({
|
|
|
260
280
|
|
|
261
281
|
};
|
|
262
282
|
|
|
263
|
-
export { createOAuthClient, developer, developerOptions, generateToken, hashToken, intersect, isDeveloperAllowed, parse, scopeLabels, scopeOptions, scopes, validate };
|
|
283
|
+
export { clients, cookies, createOAuthClient, developer, developerOptions, generateToken, hashToken, intersect, isDeveloperAllowed, parse, scopeLabels, scopeOptions, scopes, validate };
|
package/dist/oauth/index.d.ts
CHANGED
|
@@ -10,8 +10,28 @@ import 'crypto';
|
|
|
10
10
|
// - parse, validate, intersect, isDeveloperAllowed: scope set operations
|
|
11
11
|
// - hashToken, generateToken, compare: opaque-token primitives
|
|
12
12
|
// - createOAuthClient: cached client_credentials access token getter
|
|
13
|
+
// - cookies, clients: shared identifier constants so cookie + first-party
|
|
14
|
+
// client names stay in lockstep across repos (api/middleware, api/auth,
|
|
15
|
+
// app-web BFF, sync WS handshake, seed scripts)
|
|
13
16
|
|
|
14
17
|
|
|
18
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
19
|
+
// Shared identifier constants — every repo reads from here so the strings
|
|
20
|
+
// stay aligned. Adding a new cookie or first-party client means one edit
|
|
21
|
+
// in this file followed by a utils bump downstream.
|
|
22
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
23
|
+
|
|
24
|
+
const cookies = {
|
|
25
|
+
csrf : 'drawbridge.csrf',
|
|
26
|
+
refresh : 'drawbridge.refresh',
|
|
27
|
+
session : 'drawbridge.session'
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const clients = {
|
|
31
|
+
dashboard : 'drawbridge-dashboard',
|
|
32
|
+
share : 'drawbridge-share'
|
|
33
|
+
};
|
|
34
|
+
|
|
15
35
|
// ─────────────────────────────────────────────────────────────────────────
|
|
16
36
|
// Scope vocabulary (locked — 15 scopes, 10 in the developer-allowed subset)
|
|
17
37
|
// ─────────────────────────────────────────────────────────────────────────
|
|
@@ -260,4 +280,4 @@ const createOAuthClient = ({
|
|
|
260
280
|
|
|
261
281
|
};
|
|
262
282
|
|
|
263
|
-
export { createOAuthClient, developer, developerOptions, generateToken, hashToken, intersect, isDeveloperAllowed, parse, scopeLabels, scopeOptions, scopes, validate };
|
|
283
|
+
export { clients, cookies, createOAuthClient, developer, developerOptions, generateToken, hashToken, intersect, isDeveloperAllowed, parse, scopeLabels, scopeOptions, scopes, validate };
|
package/dist/oauth/index.js
CHANGED
|
@@ -21,6 +21,15 @@ var compare = (a, b) => {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
// lib/oauth/index.js
|
|
24
|
+
var cookies = {
|
|
25
|
+
csrf: "drawbridge.csrf",
|
|
26
|
+
refresh: "drawbridge.refresh",
|
|
27
|
+
session: "drawbridge.session"
|
|
28
|
+
};
|
|
29
|
+
var clients = {
|
|
30
|
+
dashboard: "drawbridge-dashboard",
|
|
31
|
+
share: "drawbridge-share"
|
|
32
|
+
};
|
|
24
33
|
var scopes = [
|
|
25
34
|
"profile:read",
|
|
26
35
|
"profile:write",
|
|
@@ -161,7 +170,9 @@ var createOAuthClient = ({
|
|
|
161
170
|
};
|
|
162
171
|
};
|
|
163
172
|
export {
|
|
173
|
+
clients,
|
|
164
174
|
compare,
|
|
175
|
+
cookies,
|
|
165
176
|
createOAuthClient,
|
|
166
177
|
developer,
|
|
167
178
|
developerOptions,
|
package/package.json
CHANGED