@bardioc/app-sdk 0.4.6 → 0.4.7
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/dev-proxy.d.ts +0 -2
- package/dist/dev-proxy.js +4 -6
- package/dist/vite.js +0 -1
- package/package.json +1 -1
package/dist/dev-proxy.d.ts
CHANGED
|
@@ -4,8 +4,6 @@ export interface DevAuthProxyOptions {
|
|
|
4
4
|
apiBaseUrl: string;
|
|
5
5
|
/** Dev secret copied from the backend. */
|
|
6
6
|
devSecret: string;
|
|
7
|
-
/** App slug stamped as `X-App-ID`, mirroring how the host identifies iframe apps. */
|
|
8
|
-
appId?: string;
|
|
9
7
|
/** Optional CORS origin (e.g. `*`). */
|
|
10
8
|
allowOrigin?: string;
|
|
11
9
|
}
|
package/dist/dev-proxy.js
CHANGED
|
@@ -33,7 +33,7 @@ function addDevSecretHeader(req, headers, devSecret) {
|
|
|
33
33
|
}
|
|
34
34
|
export function createDevAuthProxyHandler(options) {
|
|
35
35
|
const apiBaseUrl = normalizeApiBaseUrl(options.apiBaseUrl);
|
|
36
|
-
const { devSecret, allowOrigin
|
|
36
|
+
const { devSecret, allowOrigin } = options;
|
|
37
37
|
return async (req, res) => {
|
|
38
38
|
const url = new URL(req.url ?? '/', `http://${req.headers.host ?? 'localhost'}`);
|
|
39
39
|
if (req.method === 'OPTIONS') {
|
|
@@ -74,11 +74,9 @@ export function createDevAuthProxyHandler(options) {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
addDevSecretHeader(req, headers, devSecret);
|
|
77
|
-
//
|
|
78
|
-
//
|
|
79
|
-
|
|
80
|
-
headers.set('X-App-ID', appId);
|
|
81
|
-
}
|
|
77
|
+
// Dev auth is dev-secret only: never forward X-App-Id, so the BFF app-token
|
|
78
|
+
// exchange (which would also demand X-Scope-ID) can never be triggered here.
|
|
79
|
+
headers.delete('X-App-Id');
|
|
82
80
|
// BFF rejects /bardioc/ calls without this CSRF marker header; stamp it like the host does.
|
|
83
81
|
headers.set('X-Requested-With', 'XMLHttpRequest');
|
|
84
82
|
let body;
|
package/dist/vite.js
CHANGED