@mdbase-dev/connect 0.1.0-beta.105 → 0.1.0-beta.108
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
sha384-
|
|
1
|
+
sha384-wpc0R7K2M2u/v8bIQcBgnveqMOK02ergpDhAolUQ2yEXNgyXH7U7pLkhlzyvmKZs
|
package/dist/connect.js
CHANGED
|
@@ -75,9 +75,7 @@ export class MdbaseConnectInternals {
|
|
|
75
75
|
: this.application?.distribution ?? "web";
|
|
76
76
|
return {
|
|
77
77
|
distribution,
|
|
78
|
-
applicationOrigin:
|
|
79
|
-
? "null"
|
|
80
|
-
: this.defaultApplicationOrigin(),
|
|
78
|
+
applicationOrigin: this.defaultApplicationOrigin(),
|
|
81
79
|
credentialStorage: this.credentialStorage
|
|
82
80
|
};
|
|
83
81
|
}
|
|
@@ -448,8 +446,8 @@ export class MdbaseConnectInternals {
|
|
|
448
446
|
&& tokenBody.encryption.suite === RELAY_ENCRYPTION_SUITE
|
|
449
447
|
&& tokenBody.encryption.application_agreement_public_key
|
|
450
448
|
=== grantKey.agreementPublicKey;
|
|
451
|
-
if (tokenBody.application_origin !==
|
|
452
|
-
throw connectError("invalid_token_response", "Authorization did not bind the portable grant to its
|
|
449
|
+
if (tokenBody.application_origin !== this.defaultApplicationOrigin()) {
|
|
450
|
+
throw connectError("invalid_token_response", "Authorization did not bind the portable grant to its exact application origin.");
|
|
453
451
|
}
|
|
454
452
|
if (tokenBody.authority
|
|
455
453
|
&& (!authority
|
package/dist/runtime-utils.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export declare function isCanonicalGrantScope(scope: GrantScope): boolean;
|
|
|
34
34
|
export declare function stripTrailingSlash(value: string): string;
|
|
35
35
|
export declare function defaultManifestSource(): string;
|
|
36
36
|
export declare function defaultRedirectUri(): string;
|
|
37
|
+
export declare function portableApplicationOrigin(): string;
|
|
37
38
|
export declare function applicationStorageOrigin(manifest: MdbaseAppManifest | string, manifestSource: string, redirectUri: string, registeredPortable: boolean): string;
|
|
38
39
|
export declare function collectionIdFromTokenKey(key: string): string;
|
|
39
40
|
export declare function defaultCallbackUrl(): string;
|
package/dist/runtime-utils.js
CHANGED
|
@@ -282,10 +282,22 @@ export function defaultRedirectUri() {
|
|
|
282
282
|
}
|
|
283
283
|
return location.href.split(/[?#]/)[0];
|
|
284
284
|
}
|
|
285
|
+
export function portableApplicationOrigin() {
|
|
286
|
+
if (typeof location === "undefined")
|
|
287
|
+
return "null";
|
|
288
|
+
const url = new URL(location.href);
|
|
289
|
+
if (["chrome-extension:", "moz-extension:"].includes(url.protocol)) {
|
|
290
|
+
// Generic URL parsers can serialize extension origins as null. Browsers
|
|
291
|
+
// send their exact scheme/host as the request Origin.
|
|
292
|
+
return `${url.protocol}//${url.host}`;
|
|
293
|
+
}
|
|
294
|
+
// Chromium can serialize file URL origins as file://; their wire origin is null.
|
|
295
|
+
return ["http:", "https:"].includes(url.protocol) ? url.origin : "null";
|
|
296
|
+
}
|
|
285
297
|
export function applicationStorageOrigin(manifest, manifestSource, redirectUri, registeredPortable) {
|
|
286
298
|
if ((typeof manifest !== "string" && manifest.distribution === "portable")
|
|
287
299
|
|| registeredPortable)
|
|
288
|
-
return
|
|
300
|
+
return portableApplicationOrigin();
|
|
289
301
|
const redirect = new URL(redirectUri);
|
|
290
302
|
if (["http:", "https:"].includes(redirect.protocol))
|
|
291
303
|
return redirect.origin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mdbase-dev/connect",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.108",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"README.md"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@mdbase-dev/connect-protocol": "0.1.0-beta.
|
|
36
|
+
"@mdbase-dev/connect-protocol": "0.1.0-beta.108"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"esbuild": "^0.28.1",
|