@domino-sdk/relay 0.9.1 → 0.10.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/browser.d.ts +56 -56
- package/dist/browser.js +1 -1
- package/dist/{chunk-Y6H4HDQT.js → chunk-ATLYA27Y.js} +12 -0
- package/dist/index.d.ts +132 -120
- package/dist/index.js +1 -1
- package/dist/portal-proxy.d.ts +8 -4
- package/dist/portal-proxy.js +2 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
package/dist/portal-proxy.d.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Server-only proxy: browser cookies stay on the participant origin.
|
|
3
|
-
*
|
|
4
|
-
* Browser Authorization and organization/project/environment
|
|
5
|
-
*
|
|
6
|
-
* This does not provide backend identity exchange.
|
|
3
|
+
* The shared API resolves the app's origin to its registered preview or staging
|
|
4
|
+
* project. Browser Authorization and organization/project/environment
|
|
5
|
+
* selectors are discarded. This does not provide backend identity exchange.
|
|
7
6
|
*/
|
|
8
7
|
declare function proxyParticipant(request: Request, upstream: {
|
|
9
8
|
baseUrl: string;
|
|
10
9
|
fetch: typeof fetch;
|
|
10
|
+
/**
|
|
11
|
+
* Send the app origin for the API to resolve. Defaults to true; the API
|
|
12
|
+
* refuses participant requests that no registered app addresses. Only an
|
|
13
|
+
* upstream that already applies a project scope passes false.
|
|
14
|
+
*/
|
|
11
15
|
hosted?: boolean;
|
|
12
16
|
}): Promise<Response>;
|
|
13
17
|
/** Use only in an app server route. authenticate must verify the app's own session. */
|
package/dist/portal-proxy.js
CHANGED
|
@@ -35,7 +35,8 @@ async function proxyParticipant(request, upstream) {
|
|
|
35
35
|
const value = request.headers.get(name);
|
|
36
36
|
if (value) headers.set(name, value);
|
|
37
37
|
}
|
|
38
|
-
if (upstream.hosted
|
|
38
|
+
if (upstream.hosted ?? true)
|
|
39
|
+
headers.set("X-Relay-App-Origin", incoming.origin);
|
|
39
40
|
const send = upstream.fetch;
|
|
40
41
|
const response = await send(target, {
|
|
41
42
|
method: request.method,
|