@interop/zcap 10.0.2 → 11.0.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/README.md +21 -3
- package/dist/CapabilityDelegation.d.ts +173 -0
- package/dist/CapabilityDelegation.d.ts.map +1 -0
- package/dist/CapabilityDelegation.js +372 -0
- package/dist/CapabilityDelegation.js.map +1 -0
- package/dist/CapabilityInvocation.d.ts +151 -0
- package/dist/CapabilityInvocation.d.ts.map +1 -0
- package/dist/CapabilityInvocation.js +365 -0
- package/dist/CapabilityInvocation.js.map +1 -0
- package/dist/CapabilityProofPurpose.d.ts +203 -0
- package/dist/CapabilityProofPurpose.d.ts.map +1 -0
- package/dist/CapabilityProofPurpose.js +531 -0
- package/dist/CapabilityProofPurpose.js.map +1 -0
- package/dist/constants.d.ts +11 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +23 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +224 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +250 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +591 -0
- package/dist/utils.js.map +1 -0
- package/package.json +47 -34
- package/lib/CapabilityDelegation.js +0 -312
- package/lib/CapabilityInvocation.js +0 -343
- package/lib/CapabilityProofPurpose.js +0 -538
- package/lib/constants.js +0 -32
- package/lib/index.js +0 -55
- package/lib/utils.js +0 -672
- package/types/lib/CapabilityDelegation.d.ts +0 -101
- package/types/lib/CapabilityDelegation.d.ts.map +0 -1
- package/types/lib/CapabilityInvocation.d.ts +0 -100
- package/types/lib/CapabilityInvocation.d.ts.map +0 -1
- package/types/lib/CapabilityProofPurpose.d.ts +0 -126
- package/types/lib/CapabilityProofPurpose.d.ts.map +0 -1
- package/types/lib/constants.d.ts +0 -15
- package/types/lib/constants.d.ts.map +0 -1
- package/types/lib/index.d.ts +0 -42
- package/types/lib/index.d.ts.map +0 -1
- package/types/lib/utils.d.ts +0 -304
- package/types/lib/utils.d.ts.map +0 -1
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('./utils.js').InspectCapabilityChain} InspectCapabilityChain
|
|
3
|
-
* @typedef {import('./utils.js').IZcap} IZcap
|
|
4
|
-
* @typedef {import('./utils.js').IDelegatedZcap} IDelegatedZcap
|
|
5
|
-
*/
|
|
6
|
-
export class CapabilityDelegation extends CapabilityProofPurpose {
|
|
7
|
-
/**
|
|
8
|
-
* @param {object} options - The options.
|
|
9
|
-
* @param {string|IZcap} [options.parentCapability] - An alternative to
|
|
10
|
-
* passing `capabilityChain` when creating a proof; passing
|
|
11
|
-
* `parentCapability` will enable the capability chain to be auto-computed.
|
|
12
|
-
* Pass a root zcap ID string, or a full root or delegated zcap object.
|
|
13
|
-
* @param {boolean} [options.allowTargetAttenuation=false] - Allow the
|
|
14
|
-
* invocationTarget of a delegation chain to be increasingly restrictive
|
|
15
|
-
* based on a hierarchical RESTful URL structure.
|
|
16
|
-
* @param {string|Date|number} [options.date] - Used during proof
|
|
17
|
-
* verification as the expected date for the creation of the proof
|
|
18
|
-
* (within a maximum timestamp delta) and for checking to see if a
|
|
19
|
-
* capability has expired; if not passed the current date will be used.
|
|
20
|
-
* @param {string|string[]} [options.expectedRootCapability] - The expected
|
|
21
|
-
* root capability for the delegation chain (a single root capability ID
|
|
22
|
-
* string, or an array of acceptable root capability ID strings).
|
|
23
|
-
* @param {object} [options.controller] - The description of the controller,
|
|
24
|
-
* if it is not to be dereferenced via a `documentLoader`.
|
|
25
|
-
* @param {InspectCapabilityChain} [options.inspectCapabilityChain] - An
|
|
26
|
-
* async function that can be used to check for revocations related to any
|
|
27
|
-
* of verified capabilities.
|
|
28
|
-
* @param {number} [options.maxChainLength=10] - The maximum length of the
|
|
29
|
-
* capability delegation chain.
|
|
30
|
-
* @param {number} [options.maxClockSkew=300] - A maximum number of seconds
|
|
31
|
-
* that clocks may be skewed when checking capability expiration date-times
|
|
32
|
-
* against `date`.
|
|
33
|
-
* @param {number} [options.maxDelegationTtl=Infinity] - The maximum
|
|
34
|
-
* milliseconds to live for a delegated zcap as measured by the time
|
|
35
|
-
* difference between `expires` and `created` on the delegation proof.
|
|
36
|
-
* @param {object|object[]} [options.suite] - The jsonld-signature suite(s) to
|
|
37
|
-
* use to verify the capability chain. Required only in verify-proof mode;
|
|
38
|
-
* unused (and omitted) when creating a delegation proof.
|
|
39
|
-
* @param {IZcap} [options._verifiedParentCapability] - Private.
|
|
40
|
-
* @param {Array<string|IDelegatedZcap>} [options._capabilityChain] - Private.
|
|
41
|
-
* @param {boolean} [options._skipLocalValidationForTesting] - Private.
|
|
42
|
-
*/
|
|
43
|
-
constructor({ parentCapability, allowTargetAttenuation, controller, date, expectedRootCapability, inspectCapabilityChain, maxChainLength, maxClockSkew, maxDelegationTtl, suite, _verifiedParentCapability, _capabilityChain, _skipLocalValidationForTesting }?: {
|
|
44
|
-
parentCapability?: string | IZcap;
|
|
45
|
-
allowTargetAttenuation?: boolean;
|
|
46
|
-
date?: string | Date | number;
|
|
47
|
-
expectedRootCapability?: string | string[];
|
|
48
|
-
controller?: object;
|
|
49
|
-
inspectCapabilityChain?: InspectCapabilityChain;
|
|
50
|
-
maxChainLength?: number;
|
|
51
|
-
maxClockSkew?: number;
|
|
52
|
-
maxDelegationTtl?: number;
|
|
53
|
-
suite?: object | object[];
|
|
54
|
-
_verifiedParentCapability?: IZcap;
|
|
55
|
-
_capabilityChain?: Array<string | IDelegatedZcap>;
|
|
56
|
-
_skipLocalValidationForTesting?: boolean;
|
|
57
|
-
});
|
|
58
|
-
parentCapability: string | import("@digitalcredentials/ssi/zcap").IZcap;
|
|
59
|
-
_capabilityChain: (string | import("@digitalcredentials/ssi/zcap").IDelegatedZcap)[];
|
|
60
|
-
_skipLocalValidationForTesting: boolean;
|
|
61
|
-
_verifiedParentCapability: import("@digitalcredentials/ssi/zcap").IZcap;
|
|
62
|
-
update(proof: any, { document }: {
|
|
63
|
-
document: any;
|
|
64
|
-
}): Promise<any>;
|
|
65
|
-
match(proof: any, { document, documentLoader }: {
|
|
66
|
-
document: any;
|
|
67
|
-
documentLoader: any;
|
|
68
|
-
}): Promise<boolean>;
|
|
69
|
-
_getCapabilityDelegationClass(): typeof CapabilityDelegation;
|
|
70
|
-
_getTailCapability({ document, proof }: {
|
|
71
|
-
document: any;
|
|
72
|
-
proof: any;
|
|
73
|
-
}): {
|
|
74
|
-
capability: any;
|
|
75
|
-
};
|
|
76
|
-
_runChecksBeforeChainVerification(): Promise<{
|
|
77
|
-
capabilityChainMeta: {
|
|
78
|
-
verifyResult: {};
|
|
79
|
-
}[];
|
|
80
|
-
}>;
|
|
81
|
-
_runChecksAfterChainVerification({ capabilityChainMeta, dereferencedChain, proof, validateOptions }: {
|
|
82
|
-
capabilityChainMeta: any;
|
|
83
|
-
dereferencedChain: any;
|
|
84
|
-
proof: any;
|
|
85
|
-
validateOptions: any;
|
|
86
|
-
}): Promise<import("@interop/jsonld-signatures").ProofValidateResult>;
|
|
87
|
-
_shortCircuitValidate({ proof, validateOptions }: {
|
|
88
|
-
proof: any;
|
|
89
|
-
validateOptions: any;
|
|
90
|
-
}): Promise<import("@interop/jsonld-signatures").ProofValidateResult>;
|
|
91
|
-
_validateAgainstParent({ proof, verifiedParentCapability, validateOptions }: {
|
|
92
|
-
proof: any;
|
|
93
|
-
verifiedParentCapability: any;
|
|
94
|
-
validateOptions: any;
|
|
95
|
-
}): Promise<import("@interop/jsonld-signatures").ProofValidateResult>;
|
|
96
|
-
}
|
|
97
|
-
export type InspectCapabilityChain = import("./utils.js").InspectCapabilityChain;
|
|
98
|
-
export type IZcap = import("./utils.js").IZcap;
|
|
99
|
-
export type IDelegatedZcap = import("./utils.js").IDelegatedZcap;
|
|
100
|
-
import { CapabilityProofPurpose } from './CapabilityProofPurpose.js';
|
|
101
|
-
//# sourceMappingURL=CapabilityDelegation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CapabilityDelegation.d.ts","sourceRoot":"","sources":["../../lib/CapabilityDelegation.js"],"names":[],"mappings":"AAMA;;;;GAIG;AAEH;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,iQAlCG;QAA+B,gBAAgB,GAAvC,MAAM,GAAC,KAAK;QAIM,sBAAsB,GAAxC,OAAO;QAGsB,IAAI,GAAjC,MAAM,GAAC,IAAI,GAAC,MAAM;QAIQ,sBAAsB,GAAhD,MAAM,GAAC,MAAM,EAAE;QAGE,UAAU,GAA3B,MAAM;QAE2B,sBAAsB,GAAvD,sBAAsB;QAGL,cAAc,GAA/B,MAAM;QAEW,YAAY,GAA7B,MAAM;QAGW,gBAAgB,GAAjC,MAAM;QAGoB,KAAK,GAA/B,MAAM,GAAC,MAAM,EAAE;QAGC,yBAAyB,GAAzC,KAAK;QACkC,gBAAgB,GAAvD,KAAK,CAAC,MAAM,GAAC,cAAc,CAAC;QACV,8BAA8B,GAAhD,OAAO;KACjB,EA0EA;IAbG,wEAAwC;IAKtC,qFAAwC;IAGxC,wCAAoE;IAGtE,wEAA0D;IAI9D;;qBAiFC;IAED;;;yBAUC;IAED,6DAEC;IAED;;;;;MAIC;IAED;;;;OAOC;IAED;;;;;0EAsBC;IAED;;;0EAgBC;IAED;;;;0EA8BC;CACF;qCAhTY,OAAO,YAAY,EAAE,sBAAsB;oBAC3C,OAAO,YAAY,EAAE,KAAK;6BAC1B,OAAO,YAAY,EAAE,cAAc;uCALX,6BAA6B"}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('./utils.js').InspectCapabilityChain} InspectCapabilityChain
|
|
3
|
-
* @typedef {import('./utils.js').IDelegatedZcap} IDelegatedZcap
|
|
4
|
-
*/
|
|
5
|
-
export class CapabilityInvocation extends CapabilityProofPurpose {
|
|
6
|
-
/**
|
|
7
|
-
* @param {object} options - The options.
|
|
8
|
-
* @param {string|IDelegatedZcap} [options.capability] - The capability to
|
|
9
|
-
* add/reference in a created proof. A root zcap MUST be passed as its ID
|
|
10
|
-
* string; a delegated zcap must be passed as the full object.
|
|
11
|
-
* @param {string} [options.capabilityAction] - The capability action that is
|
|
12
|
-
* to be added to a proof.
|
|
13
|
-
* @param {string} [options.invocationTarget] - The invocation target to
|
|
14
|
-
* use; this is required and can be used to attenuate the capability's
|
|
15
|
-
* invocation target if the verifier supports target attenuation.
|
|
16
|
-
* @param {boolean} [options.allowTargetAttenuation=false] - Allow the
|
|
17
|
-
* invocationTarget of a delegation chain to be increasingly restrictive
|
|
18
|
-
* based on a hierarchical RESTful URL structure.
|
|
19
|
-
* @param {object} [options.controller] - The description of the controller,
|
|
20
|
-
* if it is not to be dereferenced via a `documentLoader`.
|
|
21
|
-
* @param {string|Date|number} [options.date] - Used during proof
|
|
22
|
-
* verification as the expected date for the creation of the proof
|
|
23
|
-
* (within a maximum timestamp delta) and for checking to see if a
|
|
24
|
-
* capability has expired; if not passed the current date will be used.
|
|
25
|
-
* @param {string} [options.expectedAction] - The capability action that is
|
|
26
|
-
* expected when validating a proof.
|
|
27
|
-
* @param {string|string[]} [options.expectedRootCapability] - The expected
|
|
28
|
-
* root capability for the delegation chain (a single root capability ID
|
|
29
|
-
* string, or an array of acceptable root capability ID strings).
|
|
30
|
-
* @param {string|string[]} [options.expectedTarget] - The target(s) we
|
|
31
|
-
* expect a capability to apply to (absolute URI, or array of URIs).
|
|
32
|
-
* @param {InspectCapabilityChain} [options.inspectCapabilityChain] - An
|
|
33
|
-
* async function that can be used to check for revocations related to any
|
|
34
|
-
* of verified capabilities.
|
|
35
|
-
* @param {number} [options.maxChainLength=10] - The maximum length of the
|
|
36
|
-
* capability delegation chain.
|
|
37
|
-
* @param {number} [options.maxClockSkew=300] - A maximum number of seconds
|
|
38
|
-
* that clocks may be skewed when checking capability expiration date-times
|
|
39
|
-
* against `date` and when comparing invocation proof creation time against
|
|
40
|
-
* delegation proof creation time.
|
|
41
|
-
* @param {number} [options.maxDelegationTtl=Infinity] - The maximum
|
|
42
|
-
* milliseconds to live for a delegated zcap as measured by the time
|
|
43
|
-
* difference between `expires` and `created` on the delegation proof.
|
|
44
|
-
* @param {number} [options.maxTimestampDelta=Infinity] - A maximum number
|
|
45
|
-
* of seconds that "created" date on the capability invocation proof can
|
|
46
|
-
* deviate from `date`, defaults to `Infinity`.
|
|
47
|
-
* @param {object|object[]} [options.suite] - The jsonld-signature suite(s) to
|
|
48
|
-
* use to verify the capability chain. Required only in verify-proof mode;
|
|
49
|
-
* unused (and omitted) when creating an invocation proof.
|
|
50
|
-
*/
|
|
51
|
-
constructor({ capability, capabilityAction, invocationTarget, allowTargetAttenuation, controller, date, expectedAction, expectedRootCapability, expectedTarget, inspectCapabilityChain, maxChainLength, maxClockSkew, maxDelegationTtl, maxTimestampDelta, suite }?: {
|
|
52
|
-
capability?: string | IDelegatedZcap;
|
|
53
|
-
capabilityAction?: string;
|
|
54
|
-
invocationTarget?: string;
|
|
55
|
-
allowTargetAttenuation?: boolean;
|
|
56
|
-
controller?: object;
|
|
57
|
-
date?: string | Date | number;
|
|
58
|
-
expectedAction?: string;
|
|
59
|
-
expectedRootCapability?: string | string[];
|
|
60
|
-
expectedTarget?: string | string[];
|
|
61
|
-
inspectCapabilityChain?: InspectCapabilityChain;
|
|
62
|
-
maxChainLength?: number;
|
|
63
|
-
maxClockSkew?: number;
|
|
64
|
-
maxDelegationTtl?: number;
|
|
65
|
-
maxTimestampDelta?: number;
|
|
66
|
-
suite?: object | object[];
|
|
67
|
-
});
|
|
68
|
-
capability: string | import("@digitalcredentials/ssi/zcap").IDelegatedZcap;
|
|
69
|
-
capabilityAction: string;
|
|
70
|
-
invocationTarget: string;
|
|
71
|
-
expectedTarget: string | string[];
|
|
72
|
-
expectedAction: string;
|
|
73
|
-
update(proof: any): Promise<any>;
|
|
74
|
-
match(proof: any, { document, documentLoader }: {
|
|
75
|
-
document: any;
|
|
76
|
-
documentLoader: any;
|
|
77
|
-
}): Promise<boolean>;
|
|
78
|
-
_getCapabilityDelegationClass(): typeof CapabilityDelegation;
|
|
79
|
-
_getTailCapability({ proof }: {
|
|
80
|
-
proof: any;
|
|
81
|
-
}): {
|
|
82
|
-
capability: any;
|
|
83
|
-
};
|
|
84
|
-
_runChecksBeforeChainVerification({ dereferencedChain, proof }: {
|
|
85
|
-
dereferencedChain: any;
|
|
86
|
-
proof: any;
|
|
87
|
-
}): Promise<{
|
|
88
|
-
capabilityChainMeta: any[];
|
|
89
|
-
}>;
|
|
90
|
-
_runChecksAfterChainVerification({ dereferencedChain, proof, validateOptions }: {
|
|
91
|
-
dereferencedChain: any;
|
|
92
|
-
proof: any;
|
|
93
|
-
validateOptions: any;
|
|
94
|
-
}): Promise<import("@interop/jsonld-signatures").ProofValidateResult>;
|
|
95
|
-
}
|
|
96
|
-
export type InspectCapabilityChain = import("./utils.js").InspectCapabilityChain;
|
|
97
|
-
export type IDelegatedZcap = import("./utils.js").IDelegatedZcap;
|
|
98
|
-
import { CapabilityProofPurpose } from './CapabilityProofPurpose.js';
|
|
99
|
-
import { CapabilityDelegation } from './CapabilityDelegation.js';
|
|
100
|
-
//# sourceMappingURL=CapabilityInvocation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CapabilityInvocation.d.ts","sourceRoot":"","sources":["../../lib/CapabilityInvocation.js"],"names":[],"mappings":"AAOA;;;GAGG;AAEH;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4CG;IACH,qQA3CG;QAAwC,UAAU,GAA1C,MAAM,GAAC,cAAc;QAGJ,gBAAgB,GAAjC,MAAM;QAEW,gBAAgB,GAAjC,MAAM;QAGY,sBAAsB,GAAxC,OAAO;QAGU,UAAU,GAA3B,MAAM;QAEuB,IAAI,GAAjC,MAAM,GAAC,IAAI,GAAC,MAAM;QAID,cAAc,GAA/B,MAAM;QAEoB,sBAAsB,GAAhD,MAAM,GAAC,MAAM,EAAE;QAGW,cAAc,GAAxC,MAAM,GAAC,MAAM,EAAE;QAEkB,sBAAsB,GAAvD,sBAAsB;QAGL,cAAc,GAA/B,MAAM;QAEW,YAAY,GAA7B,MAAM;QAIW,gBAAgB,GAAjC,MAAM;QAGW,iBAAiB,GAAlC,MAAM;QAGoB,KAAK,GAA/B,MAAM,GAAC,MAAM,EAAE;KAGzB,EA8FA;IAxBG,2EAA4B;IAC5B,yBAAwC;IACxC,yBAAwC;IAmBxC,kCAAoC;IACpC,uBAAoC;IAIxC,iCAOC;IAED;;;yBA2BC;IAED,6DAEC;IAED;;;;MAEC;IAED;;;;;OA4FC;IAED;;;;0EAgDC;CACF;qCA9UY,OAAO,YAAY,EAAE,sBAAsB;6BAC3C,OAAO,YAAY,EAAE,cAAc;uCAJX,6BAA6B;qCAD/B,2BAA2B"}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('./utils.js').InspectCapabilityChain} InspectCapabilityChain
|
|
3
|
-
* @typedef {import('./utils.js').CapabilityMeta} CapabilityMeta
|
|
4
|
-
*/
|
|
5
|
-
export class CapabilityProofPurpose extends jsigs.ControllerProofPurpose {
|
|
6
|
-
/**
|
|
7
|
-
* @param {object} options - The options.
|
|
8
|
-
* @param {boolean} [options.allowTargetAttenuation=false] - Allow the
|
|
9
|
-
* invocationTarget of a delegation chain to be increasingly restrictive
|
|
10
|
-
* based on a hierarchical RESTful URL structure.
|
|
11
|
-
* @param {object} [options.controller] - The description of the controller,
|
|
12
|
-
* if it is not to be dereferenced via a `documentLoader`.
|
|
13
|
-
* @param {string|Date|number} [options.date] - Used during proof
|
|
14
|
-
* verification as the expected date for the creation of the proof
|
|
15
|
-
* (within a maximum timestamp delta) and for checking to see if a
|
|
16
|
-
* capability has expired; if not passed the current date will be used.
|
|
17
|
-
* @param {string|string[]} [options.expectedRootCapability] - The expected
|
|
18
|
-
* root capability for the delegation chain (a single root capability ID
|
|
19
|
-
* string, or an array of acceptable root capability ID strings).
|
|
20
|
-
* @param {InspectCapabilityChain} [options.inspectCapabilityChain] - An
|
|
21
|
-
* async function that can be used to check for revocations related to any
|
|
22
|
-
* of verified capabilities.
|
|
23
|
-
* @param {number} [options.maxChainLength=10] - The maximum length of the
|
|
24
|
-
* capability delegation chain.
|
|
25
|
-
* @param {number} [options.maxClockSkew=300] - A maximum number of seconds
|
|
26
|
-
* that clocks may be skewed checking capability expiration date-times
|
|
27
|
-
* against `date` and when comparing invocation proof creation time against
|
|
28
|
-
* delegation proof creation time.
|
|
29
|
-
* @param {number} [options.maxDelegationTtl=Infinity] - The maximum
|
|
30
|
-
* milliseconds to live for a delegated zcap as measured by the time
|
|
31
|
-
* difference between `expires` and `created` on the delegation proof.
|
|
32
|
-
* @param {number} [options.maxTimestampDelta=Infinity] - A maximum number
|
|
33
|
-
* of seconds that a capability invocation proof (only used by this proof
|
|
34
|
-
* type) "created" date can deviate from `date`, defaults to `Infinity`.
|
|
35
|
-
* @param {object|object[]} [options.suite] - The jsonld-signature suite(s) to
|
|
36
|
-
* use to verify the capability chain. Required only when verifying a proof;
|
|
37
|
-
* unused (and omitted) when creating a delegation proof.
|
|
38
|
-
* @param {string} options.term - The term `capabilityInvocation` or
|
|
39
|
-
* `capabilityDelegation` to look for in an LD proof.
|
|
40
|
-
*/
|
|
41
|
-
constructor({ allowTargetAttenuation, controller, date, expectedRootCapability, inspectCapabilityChain, maxChainLength, maxDelegationTtl, maxTimestampDelta, maxClockSkew, suite, term }?: {
|
|
42
|
-
allowTargetAttenuation?: boolean;
|
|
43
|
-
controller?: object;
|
|
44
|
-
date?: string | Date | number;
|
|
45
|
-
expectedRootCapability?: string | string[];
|
|
46
|
-
inspectCapabilityChain?: InspectCapabilityChain;
|
|
47
|
-
maxChainLength?: number;
|
|
48
|
-
maxClockSkew?: number;
|
|
49
|
-
maxDelegationTtl?: number;
|
|
50
|
-
maxTimestampDelta?: number;
|
|
51
|
-
suite?: object | object[];
|
|
52
|
-
term: string;
|
|
53
|
-
});
|
|
54
|
-
allowTargetAttenuation: boolean;
|
|
55
|
-
expectedRootCapability: string | string[];
|
|
56
|
-
inspectCapabilityChain: Function;
|
|
57
|
-
maxChainLength: number;
|
|
58
|
-
maxClockSkew: number;
|
|
59
|
-
maxDelegationTtl: number;
|
|
60
|
-
suite: any;
|
|
61
|
-
/**
|
|
62
|
-
* Validates a capability proof by verifying its capability delegation chain
|
|
63
|
-
* from the root outward. Overrides
|
|
64
|
-
* {@link jsigs.ControllerProofPurpose#validate} and is structurally
|
|
65
|
-
* compatible with it.
|
|
66
|
-
*
|
|
67
|
-
* @param {object} proof - The proof to validate.
|
|
68
|
-
* @param {object} validateOptions - The validation options (passed through
|
|
69
|
-
* from `jsigs`), including `document` and `documentLoader`.
|
|
70
|
-
*
|
|
71
|
-
* @returns {Promise<import('@interop/jsonld-signatures').
|
|
72
|
-
* ProofValidateResult>} Resolves to `{valid, error?}` (plus an internal
|
|
73
|
-
* `dereferencedChain` on success).
|
|
74
|
-
*/
|
|
75
|
-
validate(proof: object, validateOptions: object): Promise<import("@interop/jsonld-signatures").ProofValidateResult>;
|
|
76
|
-
_dereferenceChain({ document, documentLoader, proof }: {
|
|
77
|
-
document: any;
|
|
78
|
-
documentLoader: any;
|
|
79
|
-
proof: any;
|
|
80
|
-
}): Promise<{
|
|
81
|
-
dereferencedChain: import("@digitalcredentials/ssi/zcap").IZcap[];
|
|
82
|
-
}>;
|
|
83
|
-
_getCapabilityDelegationClass(): void;
|
|
84
|
-
_getTailCapability(): Promise<void>;
|
|
85
|
-
_runChecksBeforeChainVerification(): Promise<void>;
|
|
86
|
-
_runChecksAfterChainVerification(): Promise<void>;
|
|
87
|
-
_runBaseProofValidation({ proof, validateOptions }: {
|
|
88
|
-
proof: any;
|
|
89
|
-
validateOptions: any;
|
|
90
|
-
}): Promise<jsigs.ProofValidateResult>;
|
|
91
|
-
_shortCircuitValidate(): Promise<void>;
|
|
92
|
-
/**
|
|
93
|
-
* Verifies the given dereferenced capability chain. This involves ensuring
|
|
94
|
-
* that the root zcap in the chain is as expected (for the endpoint where an
|
|
95
|
-
* invocation or a simple chain chain is occurring) and that every other zcap
|
|
96
|
-
* in the chain (including any invoked one), has been properly delegated.
|
|
97
|
-
*
|
|
98
|
-
* @param {object} options - The options.
|
|
99
|
-
* @param {Function} options.CapabilityDelegation - The CapabilityDelegation
|
|
100
|
-
* class; this must be passed to avoid circular references in this module.
|
|
101
|
-
* @param {CapabilityMeta[]} options.capabilityChainMeta - The array of
|
|
102
|
-
* results for inspecting the capability chain; if this has a value when
|
|
103
|
-
* passed, then it is presumed to be the verify result for the tail
|
|
104
|
-
* capability and that tail capability will not be verified internally by
|
|
105
|
-
* this function to avoid duplicating work; all verification results
|
|
106
|
-
* (including the tail's -- either computed locally or reused from what
|
|
107
|
-
* was passed) will be added to this array in order from root => tail.
|
|
108
|
-
* @param {Array} options.dereferencedChain - The dereferenced capability
|
|
109
|
-
* chain for `capability`, starting at the root capability and ending at
|
|
110
|
-
* `capability`.
|
|
111
|
-
* @param {Function} options.documentLoader - A configured jsonld
|
|
112
|
-
* documentLoader.
|
|
113
|
-
*
|
|
114
|
-
* @returns {object} An object with `{verified, error}`.
|
|
115
|
-
*/
|
|
116
|
-
_verifyCapabilityChain({ CapabilityDelegation, capabilityChainMeta, dereferencedChain, documentLoader }: {
|
|
117
|
-
CapabilityDelegation: Function;
|
|
118
|
-
capabilityChainMeta: CapabilityMeta[];
|
|
119
|
-
dereferencedChain: any[];
|
|
120
|
-
documentLoader: Function;
|
|
121
|
-
}): object;
|
|
122
|
-
}
|
|
123
|
-
export type InspectCapabilityChain = import("./utils.js").InspectCapabilityChain;
|
|
124
|
-
export type CapabilityMeta = import("./utils.js").CapabilityMeta;
|
|
125
|
-
import jsigs from '@interop/jsonld-signatures';
|
|
126
|
-
//# sourceMappingURL=CapabilityProofPurpose.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CapabilityProofPurpose.d.ts","sourceRoot":"","sources":["../../lib/CapabilityProofPurpose.js"],"names":[],"mappings":"AAUA;;;GAGG;AAEH;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,2LAjCG;QAA0B,sBAAsB,GAAxC,OAAO;QAGU,UAAU,GAA3B,MAAM;QAEuB,IAAI,GAAjC,MAAM,GAAC,IAAI,GAAC,MAAM;QAIQ,sBAAsB,GAAhD,MAAM,GAAC,MAAM,EAAE;QAGkB,sBAAsB,GAAvD,sBAAsB;QAGL,cAAc,GAA/B,MAAM;QAEW,YAAY,GAA7B,MAAM;QAIW,gBAAgB,GAAjC,MAAM;QAGW,iBAAiB,GAAlC,MAAM;QAGoB,KAAK,GAA/B,MAAM,GAAC,MAAM,EAAE;QAGC,IAAI,EAApB,MAAM;KAEhB,EAiDA;IARG,gCAAoD;IACpD,0CAAoD;IACpD,iCAAoD;IACpD,uBAAoC;IACpC,qBAAgC;IAChC,yBAAwC;IACxC,WAAkB;IAItB;;;;;;;;;;;;;OAaG;IACH,gBARW,MAAM,mBACN,MAAM,GAGJ,OAAO,CAAC,OAAO,4BAA4B,EACnD,mBAAmB,CAAC,CAmIxB;IAED;;;;;;OA+BC;IAED,sCAEC;IAED,oCAEC;IAGD,mDAA4C;IAG5C,kDAA2C;IAE3C;;;2CAOC;IAGD,uCAAgC;IAEhC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,yGAjBG;QAA0B,oBAAoB;QAEZ,mBAAmB,EAA7C,cAAc,EAAE;QAOD,iBAAiB;QAGd,cAAc;KAGxC,GAAU,MAAM,CAkNlB;CACF;qCA9gBY,OAAO,YAAY,EAAE,sBAAsB;6BAC3C,OAAO,YAAY,EAAE,cAAc;kBAR9B,4BAA4B"}
|
package/types/lib/constants.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/** @type {object} The zcap JSON-LD context document. */
|
|
2
|
-
export const ZCAP_CONTEXT: object;
|
|
3
|
-
/** @type {string} The zcap JSON-LD context URL (`https://w3id.org/zcap/v1`). */
|
|
4
|
-
export const ZCAP_CONTEXT_URL: string;
|
|
5
|
-
/** @type {string} The base URL for the zcap security vocabulary. */
|
|
6
|
-
export const CAPABILITY_VOCAB_URL: string;
|
|
7
|
-
/** @type {string} URI prefix for root capability IDs (`urn:zcap:root:`). */
|
|
8
|
-
export const ZCAP_ROOT_PREFIX: string;
|
|
9
|
-
/**
|
|
10
|
-
* Default maximum capability delegation chain length (inclusive of the tail).
|
|
11
|
-
*
|
|
12
|
-
* @type {number}
|
|
13
|
-
*/
|
|
14
|
-
export const MAX_CHAIN_LENGTH: number;
|
|
15
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../lib/constants.js"],"names":[],"mappings":"AAYA,wDAAwD;AACxD,2BADW,MAAM,CACmB;AAEpC,gFAAgF;AAChF,+BADW,MAAM,CAC2B;AAE5C,oEAAoE;AACpE,mCADW,MAAM,CACgD;AAEjE,4EAA4E;AAC5E,+BADW,MAAM,CACgC;AAEjD;;;;GAIG;AAGH,+BAJU,MAAM,CAImB"}
|
package/types/lib/index.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('./utils.js').InspectCapabilityChain} InspectCapabilityChain
|
|
3
|
-
* @typedef {import('./utils.js').InspectResult} InspectResult
|
|
4
|
-
* @typedef {import('./utils.js').CapabilityChainDetails} CapabilityChainDetails
|
|
5
|
-
* @typedef {import('./utils.js').CapabilityMeta} CapabilityMeta
|
|
6
|
-
* @typedef {import('./utils.js').VerifyResult} VerifyResult
|
|
7
|
-
* @typedef {import('./utils.js').VerifyProofResult} VerifyProofResult
|
|
8
|
-
* @typedef {import('./utils.js').VerifyProofPurposeResult} VerifyProofPurposeResult
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Wraps an existing document loader so that it also serves the zcap JSON-LD
|
|
12
|
-
* context. The wrapped loader is called for all other URLs.
|
|
13
|
-
*
|
|
14
|
-
* @param {Function} documentLoader - An existing JSON-LD document loader to
|
|
15
|
-
* extend.
|
|
16
|
-
*
|
|
17
|
-
* @returns {Function} A new document loader that handles the zcap context URL
|
|
18
|
-
* and delegates all other URLs to the wrapped loader.
|
|
19
|
-
*/
|
|
20
|
-
export function extendDocumentLoader(documentLoader: Function): Function;
|
|
21
|
-
export { CapabilityInvocation } from "./CapabilityInvocation.js";
|
|
22
|
-
export { CapabilityDelegation } from "./CapabilityDelegation.js";
|
|
23
|
-
export { createRootCapability } from "./utils.js";
|
|
24
|
-
export { constants };
|
|
25
|
-
/**
|
|
26
|
-
* A default JSON-LD document loader that serves only the zcap and
|
|
27
|
-
* jsonld-signatures contexts. Suitable for use when no other contexts are
|
|
28
|
-
* needed. Extend it with {@link extendDocumentLoader} if additional contexts
|
|
29
|
-
* are required.
|
|
30
|
-
*
|
|
31
|
-
* @type {Function}
|
|
32
|
-
*/
|
|
33
|
-
export const documentLoader: Function;
|
|
34
|
-
export type InspectCapabilityChain = import("./utils.js").InspectCapabilityChain;
|
|
35
|
-
export type InspectResult = import("./utils.js").InspectResult;
|
|
36
|
-
export type CapabilityChainDetails = import("./utils.js").CapabilityChainDetails;
|
|
37
|
-
export type CapabilityMeta = import("./utils.js").CapabilityMeta;
|
|
38
|
-
export type VerifyResult = import("./utils.js").VerifyResult;
|
|
39
|
-
export type VerifyProofResult = import("./utils.js").VerifyProofResult;
|
|
40
|
-
export type VerifyProofPurposeResult = import("./utils.js").VerifyProofPurposeResult;
|
|
41
|
-
import * as constants from './constants.js';
|
|
42
|
-
//# sourceMappingURL=index.d.ts.map
|
package/types/lib/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":"AAYA;;;;;;;;GAQG;AAEH;;;;;;;;;GASG;AACH,yEAYC;;;;;AAED;;;;;;;GAOG;AACH,sCAA+E;qCAzClE,OAAO,YAAY,EAAE,sBAAsB;4BAC3C,OAAO,YAAY,EAAE,aAAa;qCAClC,OAAO,YAAY,EAAE,sBAAsB;6BAC3C,OAAO,YAAY,EAAE,cAAc;2BACnC,OAAO,YAAY,EAAE,YAAY;gCACjC,OAAO,YAAY,EAAE,iBAAiB;uCACtC,OAAO,YAAY,EAAE,wBAAwB;2BAV/B,gBAAgB"}
|