@faable/auth-sdk 2.1.5 → 2.2.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/dist/FaableAuthApi.js +14 -4
- package/package.json +2 -2
package/dist/FaableAuthApi.js
CHANGED
|
@@ -54,13 +54,23 @@ export class FaableAuthApi extends FaableApi {
|
|
|
54
54
|
baseURL,
|
|
55
55
|
...params,
|
|
56
56
|
auth,
|
|
57
|
+
// Identify ourselves as a first-party client (`x-faable-client:
|
|
58
|
+
// auth-sdk/<version>`, surfaced as the `client`/`client_version` tags),
|
|
59
|
+
// and forward any consumer-supplied `name`/`instance` for per-replica
|
|
60
|
+
// attribution. Routing this through `clientInfo` makes it ride on the
|
|
61
|
+
// `/oauth/token` call too (sdk-base stamps both fetchers from the same
|
|
62
|
+
// identity). A caller-set `clientInfo.client` still wins.
|
|
63
|
+
clientInfo: {
|
|
64
|
+
client: `auth-sdk/${version}`,
|
|
65
|
+
...params?.clientInfo,
|
|
66
|
+
},
|
|
57
67
|
fetcher: {
|
|
58
68
|
...params?.fetcher,
|
|
59
69
|
headers: {
|
|
60
|
-
//
|
|
61
|
-
//
|
|
62
|
-
//
|
|
63
|
-
//
|
|
70
|
+
// Also set `x-faable-client` as a static fetcher header for
|
|
71
|
+
// backward-compat: if this runs against an older @faable/sdk-base
|
|
72
|
+
// that ignores `clientInfo`, data requests still carry it (only the
|
|
73
|
+
// new `/oauth/token` attribution needs the newer sdk-base).
|
|
64
74
|
"x-faable-client": `auth-sdk/${version}`,
|
|
65
75
|
...params?.fetcher?.headers,
|
|
66
76
|
...(params?.headers?.team_id && {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faable/auth-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"author": "Marc Pomar <marc@faable.com>",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"type": "module",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@faable/sdk-base": "^1.5.
|
|
13
|
+
"@faable/sdk-base": "^1.5.2"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@ava/typescript": "^5.0.0",
|