@mdbase-dev/connect-protocol 0.1.0-beta.27 → 0.1.0-beta.28
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/application-authorization.d.ts +2 -3
- package/dist/application-authorization.js +5 -10
- package/dist/capabilities.d.ts +51 -0
- package/dist/capabilities.js +49 -0
- package/dist/connect-problems.generated.d.ts +44 -22
- package/dist/connect-problems.generated.js +4 -2
- package/dist/index.d.ts +8 -14
- package/dist/index.js +3 -2
- package/package.json +1 -1
- package/schemas/connect-problem.v1.schema.json +127 -47
- package/schemas/connect-problems.v1.catalog.json +4 -2
- package/schemas/connect-protocol.v1.schema.json +3 -19
- package/schemas/mdbase-app.schema.json +60 -2
|
@@ -2,12 +2,11 @@ import type { ApplicationFileRequirement } from "./files.js";
|
|
|
2
2
|
import type { CollectionOperation } from "./operations.js";
|
|
3
3
|
export type ApplicationAuthorizationFlow = "authorization_code" | "device_code";
|
|
4
4
|
export interface ApplicationAuthorizationBinding {
|
|
5
|
-
protocol_version:
|
|
5
|
+
protocol_version: 2;
|
|
6
6
|
authorization_id: string;
|
|
7
7
|
application_id: string;
|
|
8
8
|
application_manifest_digest: string;
|
|
9
9
|
application_installation_id: string;
|
|
10
|
-
installation_agreement_public_key: string;
|
|
11
10
|
installation_signing_public_key: string;
|
|
12
11
|
grant_agreement_public_key: string;
|
|
13
12
|
grant_signing_public_key: string;
|
|
@@ -26,5 +25,5 @@ export interface ApplicationAuthorizationProof {
|
|
|
26
25
|
binding: ApplicationAuthorizationBinding;
|
|
27
26
|
signature: string;
|
|
28
27
|
}
|
|
29
|
-
export declare function
|
|
28
|
+
export declare function applicationInstallationIdFromPublicKey(signingPublicKey: string): Promise<string>;
|
|
30
29
|
export declare function authorizationSigningMessage(binding: ApplicationAuthorizationBinding): Uint8Array;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
const INSTALLATION_ID_DOMAIN = new TextEncoder().encode("mdbase-connect application installation id
|
|
2
|
-
const AUTHORIZATION_PROOF_DOMAIN = new TextEncoder().encode("mdbase-connect application authorization proof\0");
|
|
3
|
-
export async function
|
|
4
|
-
const agreement = publicKey(agreementPublicKey);
|
|
1
|
+
const INSTALLATION_ID_DOMAIN = new TextEncoder().encode("mdbase-connect application installation id v2\0");
|
|
2
|
+
const AUTHORIZATION_PROOF_DOMAIN = new TextEncoder().encode("mdbase-connect application authorization proof v2\0");
|
|
3
|
+
export async function applicationInstallationIdFromPublicKey(signingPublicKey) {
|
|
5
4
|
const signing = publicKey(signingPublicKey);
|
|
6
|
-
|
|
7
|
-
throw new Error("Application installation agreement and signing keys must be distinct.");
|
|
8
|
-
}
|
|
9
|
-
const digest = new Uint8Array(await crypto.subtle.digest("SHA-256", concat([INSTALLATION_ID_DOMAIN, field(agreement), field(signing)])));
|
|
5
|
+
const digest = new Uint8Array(await crypto.subtle.digest("SHA-256", concat([INSTALLATION_ID_DOMAIN, field(signing)])));
|
|
10
6
|
const id = digest.slice(0, 16);
|
|
11
7
|
id[6] = (id[6] & 0x0f) | 0x80;
|
|
12
8
|
id[8] = (id[8] & 0x3f) | 0x80;
|
|
@@ -20,7 +16,6 @@ export async function applicationInstallationIdFromPublicKeys(agreementPublicKey
|
|
|
20
16
|
}
|
|
21
17
|
export function authorizationSigningMessage(binding) {
|
|
22
18
|
const keys = [
|
|
23
|
-
publicKey(binding.installation_agreement_public_key),
|
|
24
19
|
publicKey(binding.installation_signing_public_key),
|
|
25
20
|
publicKey(binding.grant_agreement_public_key),
|
|
26
21
|
publicKey(binding.grant_signing_public_key)
|
|
@@ -30,7 +25,7 @@ export function authorizationSigningMessage(binding) {
|
|
|
30
25
|
}
|
|
31
26
|
const nonce = canonicalBase64(binding.authorization_nonce);
|
|
32
27
|
const challenge = canonicalBase64(binding.code_challenge);
|
|
33
|
-
if (binding.protocol_version !==
|
|
28
|
+
if (binding.protocol_version !== 2
|
|
34
29
|
|| nonce.byteLength !== 32
|
|
35
30
|
|| !/^[0-9a-f]{64}$/u.test(binding.application_manifest_digest)
|
|
36
31
|
|| !/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?Z$/u.test(binding.issued_at)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { CollectionOperation } from "./operations.js";
|
|
2
|
+
export declare const APPLICATION_CAPABILITY_CONTRACT_VERSION: 1;
|
|
3
|
+
/**
|
|
4
|
+
* Stable application-facing abilities. Applications declare intent in these
|
|
5
|
+
* terms; Connect alone translates them into wire-level collection operations.
|
|
6
|
+
*/
|
|
7
|
+
export declare const APPLICATION_CAPABILITY_DEFINITIONS: {
|
|
8
|
+
readonly "collection.inspect": readonly ["describe"];
|
|
9
|
+
readonly "records.watch": readonly ["changes"];
|
|
10
|
+
readonly "records.read": readonly ["read"];
|
|
11
|
+
readonly "records.query": readonly ["query"];
|
|
12
|
+
readonly "records.validate": readonly ["validate"];
|
|
13
|
+
readonly "records.create": readonly ["create"];
|
|
14
|
+
readonly "records.update": readonly ["update"];
|
|
15
|
+
readonly "records.delete": readonly ["delete"];
|
|
16
|
+
readonly "records.rename": readonly ["rename"];
|
|
17
|
+
readonly "views.list": readonly ["list_views"];
|
|
18
|
+
readonly "views.execute": readonly ["execute_view"];
|
|
19
|
+
readonly "views.source.read": readonly ["read_view_source"];
|
|
20
|
+
readonly "views.source.create": readonly ["create_view_source"];
|
|
21
|
+
readonly "views.source.update": readonly ["update_view_source"];
|
|
22
|
+
readonly "views.source.delete": readonly ["delete_view_source"];
|
|
23
|
+
readonly "definitions.contracts.current": readonly [];
|
|
24
|
+
readonly "definitions.read": readonly ["read_type"];
|
|
25
|
+
readonly "definitions.create": readonly ["create_type"];
|
|
26
|
+
readonly "definitions.update": readonly ["update_type"];
|
|
27
|
+
readonly "definitions.type-pack.inspect": readonly ["assess_type_pack"];
|
|
28
|
+
readonly "definitions.type-pack.apply": readonly ["assess_type_pack", "apply_type_pack"];
|
|
29
|
+
readonly "timers.list": readonly ["list_timers"];
|
|
30
|
+
readonly "timers.put": readonly ["put_timer"];
|
|
31
|
+
readonly "timers.cancel": readonly ["cancel_timer"];
|
|
32
|
+
readonly "timers.reconcile": readonly ["reconcile_timers"];
|
|
33
|
+
readonly "sync.offline-replica": readonly ["sync"];
|
|
34
|
+
readonly "notifications.background-delivery": readonly [];
|
|
35
|
+
readonly "files.list": readonly [];
|
|
36
|
+
readonly "files.read": readonly [];
|
|
37
|
+
readonly "files.add": readonly [];
|
|
38
|
+
readonly "files.replace": readonly [];
|
|
39
|
+
readonly "files.move": readonly [];
|
|
40
|
+
readonly "files.delete": readonly [];
|
|
41
|
+
};
|
|
42
|
+
export type ApplicationCapabilityId = keyof typeof APPLICATION_CAPABILITY_DEFINITIONS;
|
|
43
|
+
export interface ApplicationCapabilityRequirements {
|
|
44
|
+
contract_version: typeof APPLICATION_CAPABILITY_CONTRACT_VERSION;
|
|
45
|
+
required: ApplicationCapabilityId[];
|
|
46
|
+
optional?: ApplicationCapabilityId[];
|
|
47
|
+
}
|
|
48
|
+
export declare function operationsForApplicationCapabilities(requirements: ApplicationCapabilityRequirements, options?: {
|
|
49
|
+
includeOptional?: boolean;
|
|
50
|
+
}): CollectionOperation[];
|
|
51
|
+
export declare function capabilityOperations(capability: ApplicationCapabilityId): CollectionOperation[];
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export const APPLICATION_CAPABILITY_CONTRACT_VERSION = 1;
|
|
2
|
+
/**
|
|
3
|
+
* Stable application-facing abilities. Applications declare intent in these
|
|
4
|
+
* terms; Connect alone translates them into wire-level collection operations.
|
|
5
|
+
*/
|
|
6
|
+
export const APPLICATION_CAPABILITY_DEFINITIONS = {
|
|
7
|
+
"collection.inspect": ["describe"],
|
|
8
|
+
"records.watch": ["changes"],
|
|
9
|
+
"records.read": ["read"],
|
|
10
|
+
"records.query": ["query"],
|
|
11
|
+
"records.validate": ["validate"],
|
|
12
|
+
"records.create": ["create"],
|
|
13
|
+
"records.update": ["update"],
|
|
14
|
+
"records.delete": ["delete"],
|
|
15
|
+
"records.rename": ["rename"],
|
|
16
|
+
"views.list": ["list_views"],
|
|
17
|
+
"views.execute": ["execute_view"],
|
|
18
|
+
"views.source.read": ["read_view_source"],
|
|
19
|
+
"views.source.create": ["create_view_source"],
|
|
20
|
+
"views.source.update": ["update_view_source"],
|
|
21
|
+
"views.source.delete": ["delete_view_source"],
|
|
22
|
+
"definitions.contracts.current": [],
|
|
23
|
+
"definitions.read": ["read_type"],
|
|
24
|
+
"definitions.create": ["create_type"],
|
|
25
|
+
"definitions.update": ["update_type"],
|
|
26
|
+
"definitions.type-pack.inspect": ["assess_type_pack"],
|
|
27
|
+
"definitions.type-pack.apply": ["assess_type_pack", "apply_type_pack"],
|
|
28
|
+
"timers.list": ["list_timers"],
|
|
29
|
+
"timers.put": ["put_timer"],
|
|
30
|
+
"timers.cancel": ["cancel_timer"],
|
|
31
|
+
"timers.reconcile": ["reconcile_timers"],
|
|
32
|
+
"sync.offline-replica": ["sync"],
|
|
33
|
+
"notifications.background-delivery": [],
|
|
34
|
+
"files.list": [],
|
|
35
|
+
"files.read": [],
|
|
36
|
+
"files.add": [],
|
|
37
|
+
"files.replace": [],
|
|
38
|
+
"files.move": [],
|
|
39
|
+
"files.delete": []
|
|
40
|
+
};
|
|
41
|
+
export function operationsForApplicationCapabilities(requirements, options = {}) {
|
|
42
|
+
const capabilities = options.includeOptional === false
|
|
43
|
+
? requirements.required
|
|
44
|
+
: [...requirements.required, ...(requirements.optional ?? [])];
|
|
45
|
+
return [...new Set(capabilities.flatMap((capability) => APPLICATION_CAPABILITY_DEFINITIONS[capability]))];
|
|
46
|
+
}
|
|
47
|
+
export function capabilityOperations(capability) {
|
|
48
|
+
return [...APPLICATION_CAPABILITY_DEFINITIONS[capability]];
|
|
49
|
+
}
|
|
@@ -8,6 +8,10 @@ export declare const CONNECT_PROBLEM_CATALOG: {
|
|
|
8
8
|
readonly category: "availability";
|
|
9
9
|
readonly recovery: "resume_connector_access";
|
|
10
10
|
};
|
|
11
|
+
readonly application_identity_unavailable: {
|
|
12
|
+
readonly category: "compatibility";
|
|
13
|
+
readonly recovery: "upgrade_application";
|
|
14
|
+
};
|
|
11
15
|
readonly approval_window_blocked: {
|
|
12
16
|
readonly category: "authorization";
|
|
13
17
|
readonly recovery: "reauthorize";
|
|
@@ -24,6 +28,10 @@ export declare const CONNECT_PROBLEM_CATALOG: {
|
|
|
24
28
|
readonly category: "authorization";
|
|
25
29
|
readonly recovery: "reauthorize";
|
|
26
30
|
};
|
|
31
|
+
readonly authorization_replayed: {
|
|
32
|
+
readonly category: "integrity";
|
|
33
|
+
readonly recovery: "reauthorize";
|
|
34
|
+
};
|
|
27
35
|
readonly browser_required: {
|
|
28
36
|
readonly category: "compatibility";
|
|
29
37
|
readonly recovery: "none";
|
|
@@ -152,10 +160,6 @@ export declare const CONNECT_PROBLEM_CATALOG: {
|
|
|
152
160
|
readonly category: "conflict";
|
|
153
161
|
readonly recovery: "retry";
|
|
154
162
|
};
|
|
155
|
-
readonly first_contact_handler_required: {
|
|
156
|
-
readonly category: "compatibility";
|
|
157
|
-
readonly recovery: "upgrade_application";
|
|
158
|
-
};
|
|
159
163
|
readonly hosted_provider_unavailable: {
|
|
160
164
|
readonly category: "availability";
|
|
161
165
|
readonly recovery: "retry";
|
|
@@ -164,6 +168,10 @@ export declare const CONNECT_PROBLEM_CATALOG: {
|
|
|
164
168
|
readonly category: "authorization";
|
|
165
169
|
readonly recovery: "reauthorize";
|
|
166
170
|
};
|
|
171
|
+
readonly invalid_application_authorization: {
|
|
172
|
+
readonly category: "validation";
|
|
173
|
+
readonly recovery: "fix_request";
|
|
174
|
+
};
|
|
167
175
|
readonly invalid_application_manifest: {
|
|
168
176
|
readonly category: "validation";
|
|
169
177
|
readonly recovery: "fix_request";
|
|
@@ -180,10 +188,6 @@ export declare const CONNECT_PROBLEM_CATALOG: {
|
|
|
180
188
|
readonly category: "integrity";
|
|
181
189
|
readonly recovery: "contact_support";
|
|
182
190
|
};
|
|
183
|
-
readonly invalid_first_contact: {
|
|
184
|
-
readonly category: "integrity";
|
|
185
|
-
readonly recovery: "contact_support";
|
|
186
|
-
};
|
|
187
191
|
readonly invalid_loopback_url: {
|
|
188
192
|
readonly category: "validation";
|
|
189
193
|
readonly recovery: "fix_request";
|
|
@@ -304,6 +308,10 @@ export declare const CONNECT_PROBLEM_CATALOG: {
|
|
|
304
308
|
readonly category: "availability";
|
|
305
309
|
readonly recovery: "retry";
|
|
306
310
|
};
|
|
311
|
+
readonly reconnect_required: {
|
|
312
|
+
readonly category: "authorization";
|
|
313
|
+
readonly recovery: "reauthorize";
|
|
314
|
+
};
|
|
307
315
|
readonly redirect_uri_required: {
|
|
308
316
|
readonly category: "validation";
|
|
309
317
|
readonly recovery: "fix_request";
|
|
@@ -388,6 +396,7 @@ export interface ConnectProblemDetailsByCode {
|
|
|
388
396
|
"return_to"?: string;
|
|
389
397
|
};
|
|
390
398
|
"access_paused": undefined;
|
|
399
|
+
"application_identity_unavailable": undefined;
|
|
391
400
|
"approval_window_blocked": {
|
|
392
401
|
"user_code": string;
|
|
393
402
|
"verification_uri": string;
|
|
@@ -398,6 +407,7 @@ export interface ConnectProblemDetailsByCode {
|
|
|
398
407
|
"authority_authorization_changed": undefined;
|
|
399
408
|
"authorization_cancelled": undefined;
|
|
400
409
|
"authorization_expired": undefined;
|
|
410
|
+
"authorization_replayed": undefined;
|
|
401
411
|
"browser_required": undefined;
|
|
402
412
|
"callback_url_required": undefined;
|
|
403
413
|
"change_cursor_reset": undefined;
|
|
@@ -446,18 +456,17 @@ export interface ConnectProblemDetailsByCode {
|
|
|
446
456
|
"file_not_found": undefined;
|
|
447
457
|
"file_source_mismatch": undefined;
|
|
448
458
|
"file_upload_incomplete": undefined;
|
|
449
|
-
"first_contact_handler_required": undefined;
|
|
450
459
|
"hosted_provider_unavailable": undefined;
|
|
451
460
|
"insufficient_access": {
|
|
452
461
|
"required_operations": Array<string>;
|
|
453
462
|
"granted_operations": Array<string>;
|
|
454
463
|
"missing_operations": Array<string>;
|
|
455
464
|
};
|
|
465
|
+
"invalid_application_authorization": undefined;
|
|
456
466
|
"invalid_application_manifest": undefined;
|
|
457
467
|
"invalid_callback": undefined;
|
|
458
468
|
"invalid_device_authorization_response": undefined;
|
|
459
469
|
"invalid_encrypted_response": undefined;
|
|
460
|
-
"invalid_first_contact": undefined;
|
|
461
470
|
"invalid_loopback_url": undefined;
|
|
462
471
|
"invalid_mutation_id": undefined;
|
|
463
472
|
"invalid_operation_response": undefined;
|
|
@@ -493,6 +502,7 @@ export interface ConnectProblemDetailsByCode {
|
|
|
493
502
|
"rate_limited": {
|
|
494
503
|
"retry_after_ms"?: number;
|
|
495
504
|
};
|
|
505
|
+
"reconnect_required": undefined;
|
|
496
506
|
"redirect_uri_required": undefined;
|
|
497
507
|
"reference_updates_unsupported": undefined;
|
|
498
508
|
"relay_authorization_expired": undefined;
|
|
@@ -524,6 +534,12 @@ export interface ConnectProblemByCode {
|
|
|
524
534
|
recovery: "resume_connector_access";
|
|
525
535
|
details?: never;
|
|
526
536
|
};
|
|
537
|
+
"application_identity_unavailable": ConnectProblemBase & {
|
|
538
|
+
code: "application_identity_unavailable";
|
|
539
|
+
category: "compatibility";
|
|
540
|
+
recovery: "upgrade_application";
|
|
541
|
+
details?: never;
|
|
542
|
+
};
|
|
527
543
|
"approval_window_blocked": ConnectProblemBase & {
|
|
528
544
|
code: "approval_window_blocked";
|
|
529
545
|
category: "authorization";
|
|
@@ -548,6 +564,12 @@ export interface ConnectProblemByCode {
|
|
|
548
564
|
recovery: "reauthorize";
|
|
549
565
|
details?: never;
|
|
550
566
|
};
|
|
567
|
+
"authorization_replayed": ConnectProblemBase & {
|
|
568
|
+
code: "authorization_replayed";
|
|
569
|
+
category: "integrity";
|
|
570
|
+
recovery: "reauthorize";
|
|
571
|
+
details?: never;
|
|
572
|
+
};
|
|
551
573
|
"browser_required": ConnectProblemBase & {
|
|
552
574
|
code: "browser_required";
|
|
553
575
|
category: "compatibility";
|
|
@@ -740,12 +762,6 @@ export interface ConnectProblemByCode {
|
|
|
740
762
|
recovery: "retry";
|
|
741
763
|
details?: never;
|
|
742
764
|
};
|
|
743
|
-
"first_contact_handler_required": ConnectProblemBase & {
|
|
744
|
-
code: "first_contact_handler_required";
|
|
745
|
-
category: "compatibility";
|
|
746
|
-
recovery: "upgrade_application";
|
|
747
|
-
details?: never;
|
|
748
|
-
};
|
|
749
765
|
"hosted_provider_unavailable": ConnectProblemBase & {
|
|
750
766
|
code: "hosted_provider_unavailable";
|
|
751
767
|
category: "availability";
|
|
@@ -758,6 +774,12 @@ export interface ConnectProblemByCode {
|
|
|
758
774
|
recovery: "reauthorize";
|
|
759
775
|
details: ConnectProblemDetailsByCode["insufficient_access"];
|
|
760
776
|
};
|
|
777
|
+
"invalid_application_authorization": ConnectProblemBase & {
|
|
778
|
+
code: "invalid_application_authorization";
|
|
779
|
+
category: "validation";
|
|
780
|
+
recovery: "fix_request";
|
|
781
|
+
details?: never;
|
|
782
|
+
};
|
|
761
783
|
"invalid_application_manifest": ConnectProblemBase & {
|
|
762
784
|
code: "invalid_application_manifest";
|
|
763
785
|
category: "validation";
|
|
@@ -782,12 +804,6 @@ export interface ConnectProblemByCode {
|
|
|
782
804
|
recovery: "contact_support";
|
|
783
805
|
details?: never;
|
|
784
806
|
};
|
|
785
|
-
"invalid_first_contact": ConnectProblemBase & {
|
|
786
|
-
code: "invalid_first_contact";
|
|
787
|
-
category: "integrity";
|
|
788
|
-
recovery: "contact_support";
|
|
789
|
-
details?: never;
|
|
790
|
-
};
|
|
791
807
|
"invalid_loopback_url": ConnectProblemBase & {
|
|
792
808
|
code: "invalid_loopback_url";
|
|
793
809
|
category: "validation";
|
|
@@ -968,6 +984,12 @@ export interface ConnectProblemByCode {
|
|
|
968
984
|
recovery: "retry";
|
|
969
985
|
details?: ConnectProblemDetailsByCode["rate_limited"];
|
|
970
986
|
};
|
|
987
|
+
"reconnect_required": ConnectProblemBase & {
|
|
988
|
+
code: "reconnect_required";
|
|
989
|
+
category: "authorization";
|
|
990
|
+
recovery: "reauthorize";
|
|
991
|
+
details?: never;
|
|
992
|
+
};
|
|
971
993
|
"redirect_uri_required": ConnectProblemBase & {
|
|
972
994
|
code: "redirect_uri_required";
|
|
973
995
|
category: "validation";
|
|
@@ -3,10 +3,12 @@ export const CONNECT_PROBLEM_VERSION = 1;
|
|
|
3
3
|
export const CONNECT_PROBLEM_CATALOG = {
|
|
4
4
|
"access_denied": { category: "authorization", recovery: "reauthorize" },
|
|
5
5
|
"access_paused": { category: "availability", recovery: "resume_connector_access" },
|
|
6
|
+
"application_identity_unavailable": { category: "compatibility", recovery: "upgrade_application" },
|
|
6
7
|
"approval_window_blocked": { category: "authorization", recovery: "reauthorize" },
|
|
7
8
|
"authority_authorization_changed": { category: "authorization", recovery: "reauthorize" },
|
|
8
9
|
"authorization_cancelled": { category: "cancellation", recovery: "none" },
|
|
9
10
|
"authorization_expired": { category: "authorization", recovery: "reauthorize" },
|
|
11
|
+
"authorization_replayed": { category: "integrity", recovery: "reauthorize" },
|
|
10
12
|
"browser_required": { category: "compatibility", recovery: "none" },
|
|
11
13
|
"callback_url_required": { category: "validation", recovery: "fix_request" },
|
|
12
14
|
"change_cursor_reset": { category: "conflict", recovery: "refresh" },
|
|
@@ -39,14 +41,13 @@ export const CONNECT_PROBLEM_CATALOG = {
|
|
|
39
41
|
"file_not_found": { category: "conflict", recovery: "refresh" },
|
|
40
42
|
"file_source_mismatch": { category: "conflict", recovery: "refresh" },
|
|
41
43
|
"file_upload_incomplete": { category: "conflict", recovery: "retry" },
|
|
42
|
-
"first_contact_handler_required": { category: "compatibility", recovery: "upgrade_application" },
|
|
43
44
|
"hosted_provider_unavailable": { category: "availability", recovery: "retry" },
|
|
44
45
|
"insufficient_access": { category: "authorization", recovery: "reauthorize" },
|
|
46
|
+
"invalid_application_authorization": { category: "validation", recovery: "fix_request" },
|
|
45
47
|
"invalid_application_manifest": { category: "validation", recovery: "fix_request" },
|
|
46
48
|
"invalid_callback": { category: "validation", recovery: "fix_request" },
|
|
47
49
|
"invalid_device_authorization_response": { category: "integrity", recovery: "contact_support" },
|
|
48
50
|
"invalid_encrypted_response": { category: "integrity", recovery: "contact_support" },
|
|
49
|
-
"invalid_first_contact": { category: "integrity", recovery: "contact_support" },
|
|
50
51
|
"invalid_loopback_url": { category: "validation", recovery: "fix_request" },
|
|
51
52
|
"invalid_mutation_id": { category: "validation", recovery: "fix_request" },
|
|
52
53
|
"invalid_operation_response": { category: "integrity", recovery: "contact_support" },
|
|
@@ -77,6 +78,7 @@ export const CONNECT_PROBLEM_CATALOG = {
|
|
|
77
78
|
"pending_mutation_unresolved": { category: "conflict", recovery: "resolve_outcome" },
|
|
78
79
|
"query_snapshot_changed": { category: "conflict", recovery: "refresh" },
|
|
79
80
|
"rate_limited": { category: "availability", recovery: "retry" },
|
|
81
|
+
"reconnect_required": { category: "authorization", recovery: "reauthorize" },
|
|
80
82
|
"redirect_uri_required": { category: "validation", recovery: "fix_request" },
|
|
81
83
|
"reference_updates_unsupported": { category: "compatibility", recovery: "fix_request" },
|
|
82
84
|
"relay_authorization_expired": { category: "authorization", recovery: "reauthorize" },
|
package/dist/index.d.ts
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import type { ConnectProblem } from "./connect-problems.generated.js";
|
|
2
2
|
import type { ApplicationFileRequirement, CollectionFileDescriptor, FileCapability } from "./files.js";
|
|
3
3
|
import type { CollectionOperation } from "./operations.js";
|
|
4
|
+
import type { ApplicationCapabilityRequirements } from "./capabilities.js";
|
|
4
5
|
import type { ContractRequirement, ContractSetupChoice, TypePackProvision } from "./type-packs.js";
|
|
5
6
|
import type { ApplicationAuthorizationProof } from "./application-authorization.js";
|
|
6
7
|
export * from "./connect-problems.generated.js";
|
|
7
8
|
export * from "./files.js";
|
|
8
9
|
export * from "./operations.js";
|
|
10
|
+
export * from "./capabilities.js";
|
|
9
11
|
export * from "./application-authorization.js";
|
|
10
12
|
export * from "./type-packs.js";
|
|
11
13
|
export declare const CONTROL_PROTOCOL_VERSION: 1;
|
|
12
14
|
export declare const ENCRYPTED_RELAY_PROTOCOL_VERSION: 1;
|
|
13
|
-
export declare const
|
|
15
|
+
export declare const APPLICATION_AUTHORIZATION_PROTOCOL_VERSION: 2;
|
|
14
16
|
export declare const LOOPBACK_PROTOCOL_VERSION: 1;
|
|
15
17
|
export declare const DEFAULT_LOOPBACK_PORT: 28485;
|
|
16
18
|
export declare const RELAY_ENCRYPTION_SUITE: "P256-HKDF-SHA256-AES256GCM";
|
|
17
19
|
export declare const SYNC_PROTOCOL_VERSION: 1;
|
|
18
20
|
export declare const CONTRACT_SETUP_CAPABILITY: "contract-setup-v1";
|
|
19
21
|
export declare const FILE_RELAY_CAPABILITY: "file-relay-v1";
|
|
20
|
-
export declare const RELAY_REQUIRED_CAPABILITIES: readonly ["application-
|
|
21
|
-
export declare const RELAY_CAPABILITIES: readonly ["application-
|
|
22
|
+
export declare const RELAY_REQUIRED_CAPABILITIES: readonly ["application-authorization-v2", "authorization-activation", "encrypted-relay", "policy-ack"];
|
|
23
|
+
export declare const RELAY_CAPABILITIES: readonly ["application-authorization-v2", "authorization-activation", "encrypted-relay", "policy-ack", "contract-setup-v1", "file-relay-v1"];
|
|
22
24
|
export declare const AUTHORITY_PROOF_VERSION: 1;
|
|
23
25
|
export declare const AUTHORITY_PROOF_ALGORITHM: "P256-SHA256";
|
|
24
26
|
export declare const AUTHORITY_PROOF_DOMAIN: "mdbase-authority-request-proof-v1";
|
|
@@ -146,6 +148,8 @@ export interface NotificationWebhook {
|
|
|
146
148
|
}
|
|
147
149
|
export interface ApplicationRequirements {
|
|
148
150
|
contracts: ContractRequirement[];
|
|
151
|
+
/** Versioned semantic intent compiled by Connect into exact operations. */
|
|
152
|
+
capabilities?: ApplicationCapabilityRequirements;
|
|
149
153
|
/** Access boundary requested after compatibility and provisioning checks. */
|
|
150
154
|
access?: "contract" | "full_collection";
|
|
151
155
|
/** Restrict authorization to durable provider-backed collections. */
|
|
@@ -225,11 +229,10 @@ export interface GrantPolicy {
|
|
|
225
229
|
created_at: string;
|
|
226
230
|
encryption?: GrantEncryption;
|
|
227
231
|
file_capability?: FileCapability;
|
|
228
|
-
first_contact: FirstContactBinding;
|
|
229
232
|
application_authorization: ApplicationAuthorizationProof;
|
|
230
233
|
}
|
|
231
234
|
/** Presentation-only grant shape used outside a local authorization boundary. */
|
|
232
|
-
export type GrantSummary = Omit<GrantPolicy, "
|
|
235
|
+
export type GrantSummary = Omit<GrantPolicy, "application_authorization">;
|
|
233
236
|
export interface GrantEncryption {
|
|
234
237
|
protocol_version: 1;
|
|
235
238
|
suite: typeof RELAY_ENCRYPTION_SUITE;
|
|
@@ -240,15 +243,6 @@ export interface GrantEncryption {
|
|
|
240
243
|
application_agreement_public_key: string;
|
|
241
244
|
connector_agreement_public_key: string;
|
|
242
245
|
}
|
|
243
|
-
export interface FirstContactBinding {
|
|
244
|
-
protocol_version: typeof FIRST_CONTACT_PROTOCOL_VERSION;
|
|
245
|
-
application_id: string;
|
|
246
|
-
application_installation_id: string;
|
|
247
|
-
application_agreement_public_key: string;
|
|
248
|
-
application_signing_public_key: string;
|
|
249
|
-
connector_id: string;
|
|
250
|
-
connector_agreement_public_key: string;
|
|
251
|
-
}
|
|
252
246
|
export interface EncryptedRelayEnvelope {
|
|
253
247
|
protocol_version: 1;
|
|
254
248
|
suite: typeof RELAY_ENCRYPTION_SUITE;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export * from "./connect-problems.generated.js";
|
|
2
2
|
export * from "./files.js";
|
|
3
3
|
export * from "./operations.js";
|
|
4
|
+
export * from "./capabilities.js";
|
|
4
5
|
export * from "./application-authorization.js";
|
|
5
6
|
export * from "./type-packs.js";
|
|
6
7
|
export const CONTROL_PROTOCOL_VERSION = 1;
|
|
7
8
|
export const ENCRYPTED_RELAY_PROTOCOL_VERSION = 1;
|
|
8
|
-
export const
|
|
9
|
+
export const APPLICATION_AUTHORIZATION_PROTOCOL_VERSION = 2;
|
|
9
10
|
export const LOOPBACK_PROTOCOL_VERSION = 1;
|
|
10
11
|
export const DEFAULT_LOOPBACK_PORT = 28_485;
|
|
11
12
|
export const RELAY_ENCRYPTION_SUITE = "P256-HKDF-SHA256-AES256GCM";
|
|
@@ -13,7 +14,7 @@ export const SYNC_PROTOCOL_VERSION = 1;
|
|
|
13
14
|
export const CONTRACT_SETUP_CAPABILITY = "contract-setup-v1";
|
|
14
15
|
export const FILE_RELAY_CAPABILITY = "file-relay-v1";
|
|
15
16
|
export const RELAY_REQUIRED_CAPABILITIES = [
|
|
16
|
-
"application-
|
|
17
|
+
"application-authorization-v2",
|
|
17
18
|
"authorization-activation",
|
|
18
19
|
"encrypted-relay",
|
|
19
20
|
"policy-ack"
|
package/package.json
CHANGED
|
@@ -93,6 +93,46 @@
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
|
+
{
|
|
97
|
+
"type": "object",
|
|
98
|
+
"additionalProperties": false,
|
|
99
|
+
"required": [
|
|
100
|
+
"problem_version",
|
|
101
|
+
"code",
|
|
102
|
+
"category",
|
|
103
|
+
"recovery",
|
|
104
|
+
"message"
|
|
105
|
+
],
|
|
106
|
+
"properties": {
|
|
107
|
+
"problem_version": {
|
|
108
|
+
"const": 1
|
|
109
|
+
},
|
|
110
|
+
"code": {
|
|
111
|
+
"const": "application_identity_unavailable"
|
|
112
|
+
},
|
|
113
|
+
"category": {
|
|
114
|
+
"const": "compatibility"
|
|
115
|
+
},
|
|
116
|
+
"recovery": {
|
|
117
|
+
"const": "upgrade_application"
|
|
118
|
+
},
|
|
119
|
+
"message": {
|
|
120
|
+
"type": "string",
|
|
121
|
+
"minLength": 1
|
|
122
|
+
},
|
|
123
|
+
"operation_outcome": {
|
|
124
|
+
"enum": [
|
|
125
|
+
"not_sent",
|
|
126
|
+
"rejected",
|
|
127
|
+
"unknown"
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
"trace_id": {
|
|
131
|
+
"type": "string",
|
|
132
|
+
"minLength": 1
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
96
136
|
{
|
|
97
137
|
"type": "object",
|
|
98
138
|
"additionalProperties": false,
|
|
@@ -282,6 +322,46 @@
|
|
|
282
322
|
}
|
|
283
323
|
}
|
|
284
324
|
},
|
|
325
|
+
{
|
|
326
|
+
"type": "object",
|
|
327
|
+
"additionalProperties": false,
|
|
328
|
+
"required": [
|
|
329
|
+
"problem_version",
|
|
330
|
+
"code",
|
|
331
|
+
"category",
|
|
332
|
+
"recovery",
|
|
333
|
+
"message"
|
|
334
|
+
],
|
|
335
|
+
"properties": {
|
|
336
|
+
"problem_version": {
|
|
337
|
+
"const": 1
|
|
338
|
+
},
|
|
339
|
+
"code": {
|
|
340
|
+
"const": "authorization_replayed"
|
|
341
|
+
},
|
|
342
|
+
"category": {
|
|
343
|
+
"const": "integrity"
|
|
344
|
+
},
|
|
345
|
+
"recovery": {
|
|
346
|
+
"const": "reauthorize"
|
|
347
|
+
},
|
|
348
|
+
"message": {
|
|
349
|
+
"type": "string",
|
|
350
|
+
"minLength": 1
|
|
351
|
+
},
|
|
352
|
+
"operation_outcome": {
|
|
353
|
+
"enum": [
|
|
354
|
+
"not_sent",
|
|
355
|
+
"rejected",
|
|
356
|
+
"unknown"
|
|
357
|
+
]
|
|
358
|
+
},
|
|
359
|
+
"trace_id": {
|
|
360
|
+
"type": "string",
|
|
361
|
+
"minLength": 1
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
},
|
|
285
365
|
{
|
|
286
366
|
"type": "object",
|
|
287
367
|
"additionalProperties": false,
|
|
@@ -1666,46 +1746,6 @@
|
|
|
1666
1746
|
}
|
|
1667
1747
|
}
|
|
1668
1748
|
},
|
|
1669
|
-
{
|
|
1670
|
-
"type": "object",
|
|
1671
|
-
"additionalProperties": false,
|
|
1672
|
-
"required": [
|
|
1673
|
-
"problem_version",
|
|
1674
|
-
"code",
|
|
1675
|
-
"category",
|
|
1676
|
-
"recovery",
|
|
1677
|
-
"message"
|
|
1678
|
-
],
|
|
1679
|
-
"properties": {
|
|
1680
|
-
"problem_version": {
|
|
1681
|
-
"const": 1
|
|
1682
|
-
},
|
|
1683
|
-
"code": {
|
|
1684
|
-
"const": "first_contact_handler_required"
|
|
1685
|
-
},
|
|
1686
|
-
"category": {
|
|
1687
|
-
"const": "compatibility"
|
|
1688
|
-
},
|
|
1689
|
-
"recovery": {
|
|
1690
|
-
"const": "upgrade_application"
|
|
1691
|
-
},
|
|
1692
|
-
"message": {
|
|
1693
|
-
"type": "string",
|
|
1694
|
-
"minLength": 1
|
|
1695
|
-
},
|
|
1696
|
-
"operation_outcome": {
|
|
1697
|
-
"enum": [
|
|
1698
|
-
"not_sent",
|
|
1699
|
-
"rejected",
|
|
1700
|
-
"unknown"
|
|
1701
|
-
]
|
|
1702
|
-
},
|
|
1703
|
-
"trace_id": {
|
|
1704
|
-
"type": "string",
|
|
1705
|
-
"minLength": 1
|
|
1706
|
-
}
|
|
1707
|
-
}
|
|
1708
|
-
},
|
|
1709
1749
|
{
|
|
1710
1750
|
"type": "object",
|
|
1711
1751
|
"additionalProperties": false,
|
|
@@ -1831,7 +1871,7 @@
|
|
|
1831
1871
|
"const": 1
|
|
1832
1872
|
},
|
|
1833
1873
|
"code": {
|
|
1834
|
-
"const": "
|
|
1874
|
+
"const": "invalid_application_authorization"
|
|
1835
1875
|
},
|
|
1836
1876
|
"category": {
|
|
1837
1877
|
"const": "validation"
|
|
@@ -1871,7 +1911,7 @@
|
|
|
1871
1911
|
"const": 1
|
|
1872
1912
|
},
|
|
1873
1913
|
"code": {
|
|
1874
|
-
"const": "
|
|
1914
|
+
"const": "invalid_application_manifest"
|
|
1875
1915
|
},
|
|
1876
1916
|
"category": {
|
|
1877
1917
|
"const": "validation"
|
|
@@ -1911,13 +1951,13 @@
|
|
|
1911
1951
|
"const": 1
|
|
1912
1952
|
},
|
|
1913
1953
|
"code": {
|
|
1914
|
-
"const": "
|
|
1954
|
+
"const": "invalid_callback"
|
|
1915
1955
|
},
|
|
1916
1956
|
"category": {
|
|
1917
|
-
"const": "
|
|
1957
|
+
"const": "validation"
|
|
1918
1958
|
},
|
|
1919
1959
|
"recovery": {
|
|
1920
|
-
"const": "
|
|
1960
|
+
"const": "fix_request"
|
|
1921
1961
|
},
|
|
1922
1962
|
"message": {
|
|
1923
1963
|
"type": "string",
|
|
@@ -1951,7 +1991,7 @@
|
|
|
1951
1991
|
"const": 1
|
|
1952
1992
|
},
|
|
1953
1993
|
"code": {
|
|
1954
|
-
"const": "
|
|
1994
|
+
"const": "invalid_device_authorization_response"
|
|
1955
1995
|
},
|
|
1956
1996
|
"category": {
|
|
1957
1997
|
"const": "integrity"
|
|
@@ -1991,7 +2031,7 @@
|
|
|
1991
2031
|
"const": 1
|
|
1992
2032
|
},
|
|
1993
2033
|
"code": {
|
|
1994
|
-
"const": "
|
|
2034
|
+
"const": "invalid_encrypted_response"
|
|
1995
2035
|
},
|
|
1996
2036
|
"category": {
|
|
1997
2037
|
"const": "integrity"
|
|
@@ -3243,6 +3283,46 @@
|
|
|
3243
3283
|
}
|
|
3244
3284
|
}
|
|
3245
3285
|
},
|
|
3286
|
+
{
|
|
3287
|
+
"type": "object",
|
|
3288
|
+
"additionalProperties": false,
|
|
3289
|
+
"required": [
|
|
3290
|
+
"problem_version",
|
|
3291
|
+
"code",
|
|
3292
|
+
"category",
|
|
3293
|
+
"recovery",
|
|
3294
|
+
"message"
|
|
3295
|
+
],
|
|
3296
|
+
"properties": {
|
|
3297
|
+
"problem_version": {
|
|
3298
|
+
"const": 1
|
|
3299
|
+
},
|
|
3300
|
+
"code": {
|
|
3301
|
+
"const": "reconnect_required"
|
|
3302
|
+
},
|
|
3303
|
+
"category": {
|
|
3304
|
+
"const": "authorization"
|
|
3305
|
+
},
|
|
3306
|
+
"recovery": {
|
|
3307
|
+
"const": "reauthorize"
|
|
3308
|
+
},
|
|
3309
|
+
"message": {
|
|
3310
|
+
"type": "string",
|
|
3311
|
+
"minLength": 1
|
|
3312
|
+
},
|
|
3313
|
+
"operation_outcome": {
|
|
3314
|
+
"enum": [
|
|
3315
|
+
"not_sent",
|
|
3316
|
+
"rejected",
|
|
3317
|
+
"unknown"
|
|
3318
|
+
]
|
|
3319
|
+
},
|
|
3320
|
+
"trace_id": {
|
|
3321
|
+
"type": "string",
|
|
3322
|
+
"minLength": 1
|
|
3323
|
+
}
|
|
3324
|
+
}
|
|
3325
|
+
},
|
|
3246
3326
|
{
|
|
3247
3327
|
"type": "object",
|
|
3248
3328
|
"additionalProperties": false,
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"access_paused": { "category": "availability", "recovery": "resume_connector_access" },
|
|
40
|
+
"application_identity_unavailable": { "category": "compatibility", "recovery": "upgrade_application" },
|
|
40
41
|
"approval_window_blocked": {
|
|
41
42
|
"category": "authorization",
|
|
42
43
|
"recovery": "reauthorize",
|
|
@@ -54,6 +55,7 @@
|
|
|
54
55
|
"authority_authorization_changed": { "category": "authorization", "recovery": "reauthorize" },
|
|
55
56
|
"authorization_cancelled": { "category": "cancellation", "recovery": "none" },
|
|
56
57
|
"authorization_expired": { "category": "authorization", "recovery": "reauthorize" },
|
|
58
|
+
"authorization_replayed": { "category": "integrity", "recovery": "reauthorize" },
|
|
57
59
|
"browser_required": { "category": "compatibility", "recovery": "none" },
|
|
58
60
|
"callback_url_required": { "category": "validation", "recovery": "fix_request" },
|
|
59
61
|
"change_cursor_reset": { "category": "conflict", "recovery": "refresh" },
|
|
@@ -151,7 +153,6 @@
|
|
|
151
153
|
"file_not_found": { "category": "conflict", "recovery": "refresh" },
|
|
152
154
|
"file_source_mismatch": { "category": "conflict", "recovery": "refresh" },
|
|
153
155
|
"file_upload_incomplete": { "category": "conflict", "recovery": "retry" },
|
|
154
|
-
"first_contact_handler_required": { "category": "compatibility", "recovery": "upgrade_application" },
|
|
155
156
|
"hosted_provider_unavailable": { "category": "availability", "recovery": "retry" },
|
|
156
157
|
"insufficient_access": {
|
|
157
158
|
"category": "authorization",
|
|
@@ -165,11 +166,11 @@
|
|
|
165
166
|
}
|
|
166
167
|
}
|
|
167
168
|
},
|
|
169
|
+
"invalid_application_authorization": { "category": "validation", "recovery": "fix_request" },
|
|
168
170
|
"invalid_application_manifest": { "category": "validation", "recovery": "fix_request" },
|
|
169
171
|
"invalid_callback": { "category": "validation", "recovery": "fix_request" },
|
|
170
172
|
"invalid_device_authorization_response": { "category": "integrity", "recovery": "contact_support" },
|
|
171
173
|
"invalid_encrypted_response": { "category": "integrity", "recovery": "contact_support" },
|
|
172
|
-
"invalid_first_contact": { "category": "integrity", "recovery": "contact_support" },
|
|
173
174
|
"invalid_loopback_url": { "category": "validation", "recovery": "fix_request" },
|
|
174
175
|
"invalid_mutation_id": { "category": "validation", "recovery": "fix_request" },
|
|
175
176
|
"invalid_operation_response": { "category": "integrity", "recovery": "contact_support" },
|
|
@@ -219,6 +220,7 @@
|
|
|
219
220
|
}
|
|
220
221
|
}
|
|
221
222
|
},
|
|
223
|
+
"reconnect_required": { "category": "authorization", "recovery": "reauthorize" },
|
|
222
224
|
"redirect_uri_required": { "category": "validation", "recovery": "fix_request" },
|
|
223
225
|
"reference_updates_unsupported": { "category": "compatibility", "recovery": "fix_request" },
|
|
224
226
|
"relay_authorization_expired": { "category": "authorization", "recovery": "reauthorize" },
|
|
@@ -203,7 +203,7 @@
|
|
|
203
203
|
"grantPolicy": {
|
|
204
204
|
"type": "object",
|
|
205
205
|
"additionalProperties": false,
|
|
206
|
-
"required": ["id", "application_id", "collection_id", "operations", "scope", "application_name", "application_distribution", "application_homepage", "application_origin", "collection_name", "created_at", "encryption", "
|
|
206
|
+
"required": ["id", "application_id", "collection_id", "operations", "scope", "application_name", "application_distribution", "application_homepage", "application_origin", "collection_name", "created_at", "encryption", "application_authorization"],
|
|
207
207
|
"properties": {
|
|
208
208
|
"id": { "$ref": "#/$defs/uuid" },
|
|
209
209
|
"application_id": { "$ref": "#/$defs/uuid" },
|
|
@@ -232,24 +232,9 @@
|
|
|
232
232
|
"file_capability": {
|
|
233
233
|
"$ref": "https://mdbase.dev/connect/schemas/files.v1.json#/$defs/fileCapability"
|
|
234
234
|
},
|
|
235
|
-
"first_contact": { "$ref": "#/$defs/firstContactBinding" },
|
|
236
235
|
"application_authorization": { "$ref": "#/$defs/applicationAuthorizationProof" }
|
|
237
236
|
}
|
|
238
237
|
},
|
|
239
|
-
"firstContactBinding": {
|
|
240
|
-
"type": "object",
|
|
241
|
-
"additionalProperties": false,
|
|
242
|
-
"required": ["protocol_version", "application_id", "application_installation_id", "application_agreement_public_key", "application_signing_public_key", "connector_id", "connector_agreement_public_key"],
|
|
243
|
-
"properties": {
|
|
244
|
-
"protocol_version": { "const": 1 },
|
|
245
|
-
"application_id": { "$ref": "#/$defs/uuid" },
|
|
246
|
-
"application_installation_id": { "$ref": "#/$defs/uuid" },
|
|
247
|
-
"application_agreement_public_key": { "$ref": "#/$defs/p256PublicKey" },
|
|
248
|
-
"application_signing_public_key": { "$ref": "#/$defs/p256PublicKey" },
|
|
249
|
-
"connector_id": { "$ref": "#/$defs/uuid" },
|
|
250
|
-
"connector_agreement_public_key": { "$ref": "#/$defs/p256PublicKey" }
|
|
251
|
-
}
|
|
252
|
-
},
|
|
253
238
|
"applicationAuthorizationProof": {
|
|
254
239
|
"type": "object",
|
|
255
240
|
"additionalProperties": false,
|
|
@@ -262,14 +247,13 @@
|
|
|
262
247
|
"applicationAuthorizationBinding": {
|
|
263
248
|
"type": "object",
|
|
264
249
|
"additionalProperties": false,
|
|
265
|
-
"required": ["protocol_version", "authorization_id", "application_id", "application_manifest_digest", "application_installation_id", "
|
|
250
|
+
"required": ["protocol_version", "authorization_id", "application_id", "application_manifest_digest", "application_installation_id", "installation_signing_public_key", "grant_agreement_public_key", "grant_signing_public_key", "flow", "authorization_nonce", "issued_at", "expires_at", "code_challenge", "requested_operations"],
|
|
266
251
|
"properties": {
|
|
267
|
-
"protocol_version": { "const":
|
|
252
|
+
"protocol_version": { "const": 2 },
|
|
268
253
|
"authorization_id": { "$ref": "#/$defs/uuid" },
|
|
269
254
|
"application_id": { "$ref": "#/$defs/uuid" },
|
|
270
255
|
"application_manifest_digest": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
|
|
271
256
|
"application_installation_id": { "$ref": "#/$defs/uuid" },
|
|
272
|
-
"installation_agreement_public_key": { "$ref": "#/$defs/p256PublicKey" },
|
|
273
257
|
"installation_signing_public_key": { "$ref": "#/$defs/p256PublicKey" },
|
|
274
258
|
"grant_agreement_public_key": { "$ref": "#/$defs/p256PublicKey" },
|
|
275
259
|
"grant_signing_public_key": { "$ref": "#/$defs/p256PublicKey" },
|
|
@@ -107,8 +107,9 @@
|
|
|
107
107
|
"type": "object",
|
|
108
108
|
"additionalProperties": false,
|
|
109
109
|
"required": ["contracts"],
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
"properties": {
|
|
111
|
+
"capabilities": { "$ref": "#/$defs/capabilityRequirements" },
|
|
112
|
+
"access": {
|
|
112
113
|
"enum": ["contract", "full_collection"],
|
|
113
114
|
"description": "Access boundary requested after compatibility and provisioning checks."
|
|
114
115
|
},
|
|
@@ -125,6 +126,63 @@
|
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
128
|
},
|
|
129
|
+
"capabilityRequirements": {
|
|
130
|
+
"type": "object",
|
|
131
|
+
"additionalProperties": false,
|
|
132
|
+
"required": ["contract_version", "required"],
|
|
133
|
+
"properties": {
|
|
134
|
+
"contract_version": { "const": 1 },
|
|
135
|
+
"required": {
|
|
136
|
+
"type": "array",
|
|
137
|
+
"maxItems": 32,
|
|
138
|
+
"uniqueItems": true,
|
|
139
|
+
"items": { "$ref": "#/$defs/applicationCapability" }
|
|
140
|
+
},
|
|
141
|
+
"optional": {
|
|
142
|
+
"type": "array",
|
|
143
|
+
"maxItems": 32,
|
|
144
|
+
"uniqueItems": true,
|
|
145
|
+
"items": { "$ref": "#/$defs/applicationCapability" }
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"applicationCapability": {
|
|
150
|
+
"enum": [
|
|
151
|
+
"collection.inspect",
|
|
152
|
+
"records.watch",
|
|
153
|
+
"records.read",
|
|
154
|
+
"records.query",
|
|
155
|
+
"records.validate",
|
|
156
|
+
"records.create",
|
|
157
|
+
"records.update",
|
|
158
|
+
"records.delete",
|
|
159
|
+
"records.rename",
|
|
160
|
+
"views.list",
|
|
161
|
+
"views.execute",
|
|
162
|
+
"views.source.read",
|
|
163
|
+
"views.source.create",
|
|
164
|
+
"views.source.update",
|
|
165
|
+
"views.source.delete",
|
|
166
|
+
"definitions.contracts.current",
|
|
167
|
+
"definitions.read",
|
|
168
|
+
"definitions.create",
|
|
169
|
+
"definitions.update",
|
|
170
|
+
"definitions.type-pack.inspect",
|
|
171
|
+
"definitions.type-pack.apply",
|
|
172
|
+
"timers.list",
|
|
173
|
+
"timers.put",
|
|
174
|
+
"timers.cancel",
|
|
175
|
+
"timers.reconcile",
|
|
176
|
+
"sync.offline-replica",
|
|
177
|
+
"notifications.background-delivery",
|
|
178
|
+
"files.list",
|
|
179
|
+
"files.read",
|
|
180
|
+
"files.add",
|
|
181
|
+
"files.replace",
|
|
182
|
+
"files.move",
|
|
183
|
+
"files.delete"
|
|
184
|
+
]
|
|
185
|
+
},
|
|
128
186
|
"fileRequirement": {
|
|
129
187
|
"type": "object",
|
|
130
188
|
"additionalProperties": false,
|