@extrimian/agent 0.12.0-2 → 0.12.0-4
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/agent.d.ts +77 -0
- package/dist/agent.js +174 -0
- package/dist/agent.js.map +1 -0
- package/dist/data-share-behaviours/data-share-behavior.d.ts +4 -0
- package/dist/data-share-behaviours/data-share-behavior.js +3 -0
- package/dist/data-share-behaviours/data-share-behavior.js.map +1 -0
- package/dist/data-share-behaviours/identity-data-share-behavior.d.ts +16 -0
- package/dist/data-share-behaviours/identity-data-share-behavior.js +3 -0
- package/dist/data-share-behaviours/identity-data-share-behavior.js.map +1 -0
- package/dist/data-share-behaviours/identity-plaintext-data-share-behavior.d.ts +5 -0
- package/dist/data-share-behaviours/identity-plaintext-data-share-behavior.js +16 -0
- package/dist/data-share-behaviours/identity-plaintext-data-share-behavior.js.map +1 -0
- package/dist/data-share-behaviours/vcs/vc-share-behavior.d.ts +12 -0
- package/dist/data-share-behaviours/vcs/vc-share-behavior.js +3 -0
- package/dist/data-share-behaviours/vcs/vc-share-behavior.js.map +1 -0
- package/dist/data-share-behaviours/vcs/vc-share-didcomm-behavior.d.ts +20 -0
- package/dist/data-share-behaviours/vcs/vc-share-didcomm-behavior.js +30 -0
- package/dist/data-share-behaviours/vcs/vc-share-didcomm-behavior.js.map +1 -0
- package/dist/did/did-services.d.ts +14 -0
- package/dist/did/did-services.js +15 -0
- package/dist/did/did-services.js.map +1 -0
- package/dist/exceptions/agent-plugin-not-found.d.ts +2 -0
- package/dist/exceptions/agent-plugin-not-found.js +7 -0
- package/dist/exceptions/agent-plugin-not-found.js.map +1 -0
- package/dist/exceptions/vc-protocol-not-found.d.ts +3 -0
- package/dist/exceptions/vc-protocol-not-found.js +12 -0
- package/dist/exceptions/vc-protocol-not-found.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +61 -0
- package/dist/index.js.map +1 -0
- package/dist/messaging/messaging.d.ts +41 -0
- package/dist/messaging/messaging.js +89 -0
- package/dist/messaging/messaging.js.map +1 -0
- package/dist/models/agent-identity.d.ts +86 -0
- package/dist/models/agent-identity.js +400 -0
- package/dist/models/agent-identity.js.map +1 -0
- package/dist/models/agent-kms.d.ts +42 -0
- package/dist/models/agent-kms.js +79 -0
- package/dist/models/agent-kms.js.map +1 -0
- package/dist/models/agent-pbk.d.ts +11 -0
- package/dist/models/agent-pbk.js +12 -0
- package/dist/models/agent-pbk.js.map +1 -0
- package/dist/models/agent-registry.d.ts +94 -0
- package/dist/models/agent-registry.js +130 -0
- package/dist/models/agent-registry.js.map +1 -0
- package/dist/models/agent-resolver-cache.d.ts +21 -0
- package/dist/models/agent-resolver-cache.js +48 -0
- package/dist/models/agent-resolver-cache.js.map +1 -0
- package/dist/models/agent-resolver.d.ts +19 -0
- package/dist/models/agent-resolver.js +34 -0
- package/dist/models/agent-resolver.js.map +1 -0
- package/dist/models/agent-secure-storage.d.ts +3 -0
- package/dist/models/agent-secure-storage.js +3 -0
- package/dist/models/agent-secure-storage.js.map +1 -0
- package/dist/models/agent-secure-storages/filesystem-agent-secure-storage.d.ts +14 -0
- package/dist/models/agent-secure-storages/filesystem-agent-secure-storage.js +49 -0
- package/dist/models/agent-secure-storages/filesystem-agent-secure-storage.js.map +1 -0
- package/dist/models/agent-storage.d.ts +9 -0
- package/dist/models/agent-storage.js +3 -0
- package/dist/models/agent-storage.js.map +1 -0
- package/dist/models/did.d.ts +19 -0
- package/dist/models/did.js +64 -0
- package/dist/models/did.js.map +1 -0
- package/dist/models/transports/ami-transport.d.ts +30 -0
- package/dist/models/transports/ami-transport.js +184 -0
- package/dist/models/transports/ami-transport.js.map +1 -0
- package/dist/models/transports/connectable-transport.d.ts +25 -0
- package/dist/models/transports/connectable-transport.js +26 -0
- package/dist/models/transports/connectable-transport.js.map +1 -0
- package/dist/models/transports/dwn-transport.d.ts +32 -0
- package/dist/models/transports/dwn-transport.js +192 -0
- package/dist/models/transports/dwn-transport.js.map +1 -0
- package/dist/models/transports/messaging-transport.d.ts +3 -0
- package/dist/models/transports/messaging-transport.js +3 -0
- package/dist/models/transports/messaging-transport.js.map +1 -0
- package/dist/models/transports/transport.d.ts +30 -0
- package/dist/models/transports/transport.js +8 -0
- package/dist/models/transports/transport.js.map +1 -0
- package/dist/models/transports/websocket-client-transport.d.ts +5 -0
- package/dist/models/transports/websocket-client-transport.js +34 -0
- package/dist/models/transports/websocket-client-transport.js.map +1 -0
- package/dist/models/transports/websocket-server-transport.d.ts +7 -0
- package/dist/models/transports/websocket-server-transport.js +22 -0
- package/dist/models/transports/websocket-server-transport.js.map +1 -0
- package/dist/models/transports/websocket-transport.d.ts +30 -0
- package/dist/models/transports/websocket-transport.js +85 -0
- package/dist/models/transports/websocket-transport.js.map +1 -0
- package/dist/models/vc-storage.d.ts +8 -0
- package/dist/models/vc-storage.js +3 -0
- package/dist/models/vc-storage.js.map +1 -0
- package/dist/plugins/iplugin.d.ts +17 -0
- package/dist/plugins/iplugin.js +3 -0
- package/dist/plugins/iplugin.js.map +1 -0
- package/dist/plugins/istatus-list-plugin.d.ts +14 -0
- package/dist/plugins/istatus-list-plugin.js +3 -0
- package/dist/plugins/istatus-list-plugin.js.map +1 -0
- package/dist/plugins/ivc-interceptor-plugin.d.ts +9 -0
- package/dist/plugins/ivc-interceptor-plugin.js +3 -0
- package/dist/plugins/ivc-interceptor-plugin.js.map +1 -0
- package/dist/plugins/plugin-dispatcher.d.ts +6 -0
- package/dist/plugins/plugin-dispatcher.js +20 -0
- package/dist/plugins/plugin-dispatcher.js.map +1 -0
- package/dist/transport/transport.d.ts +43 -0
- package/dist/transport/transport.js +110 -0
- package/dist/transport/transport.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +15 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/lite-event.d.ts +25 -0
- package/dist/utils/lite-event.js +37 -0
- package/dist/utils/lite-event.js.map +1 -0
- package/dist/vc/models/credentia-flow.d.ts +4 -0
- package/dist/vc/models/credentia-flow.js +9 -0
- package/dist/vc/models/credentia-flow.js.map +1 -0
- package/dist/vc/models/credential-request.d.ts +3 -0
- package/dist/vc/models/credential-request.js +3 -0
- package/dist/vc/models/credential-request.js.map +1 -0
- package/dist/vc/models/vc-create-key-request.d.ts +4 -0
- package/dist/vc/models/vc-create-key-request.js +3 -0
- package/dist/vc/models/vc-create-key-request.js.map +1 -0
- package/dist/vc/models/waci-message.d.ts +3 -0
- package/dist/vc/models/waci-message.js +8 -0
- package/dist/vc/models/waci-message.js.map +1 -0
- package/dist/vc/protocols/openid-protocol.d.ts +161 -0
- package/dist/vc/protocols/openid-protocol.js +126 -0
- package/dist/vc/protocols/openid-protocol.js.map +1 -0
- package/dist/vc/protocols/vc-protocol.d.ts +106 -0
- package/dist/vc/protocols/vc-protocol.js +37 -0
- package/dist/vc/protocols/vc-protocol.js.map +1 -0
- package/dist/vc/protocols/waci-protocol.d.ts +183 -0
- package/dist/vc/protocols/waci-protocol.js +553 -0
- package/dist/vc/protocols/waci-protocol.js.map +1 -0
- package/dist/vc/vc-setup/vc-setup.d.ts +0 -0
- package/dist/vc/vc-setup/vc-setup.js +1 -0
- package/dist/vc/vc-setup/vc-setup.js.map +1 -0
- package/dist/vc/vc.d.ts +225 -0
- package/dist/vc/vc.js +329 -0
- package/dist/vc/vc.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WACIMessage = void 0;
|
|
4
|
+
const did_core_1 = require("@extrimian/did-core");
|
|
5
|
+
class WACIMessage extends did_core_1.DIDCommMessage {
|
|
6
|
+
}
|
|
7
|
+
exports.WACIMessage = WACIMessage;
|
|
8
|
+
//# sourceMappingURL=waci-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"waci-message.js","sourceRoot":"","sources":["../../../src/vc/models/waci-message.ts"],"names":[],"mappings":";;;AAAA,kDAAqD;AAErD,MAAa,WAAY,SAAQ,yBAAc;CAC9C;AADD,kCACC"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { IStorage } from '../../models/agent-storage';
|
|
2
|
+
import { DID } from '../../models/did';
|
|
3
|
+
import { CredentialFlow } from '../models/credentia-flow';
|
|
4
|
+
import { VCProtocol } from './vc-protocol';
|
|
5
|
+
export declare class OpenIDProtocol extends VCProtocol<any> {
|
|
6
|
+
private storage;
|
|
7
|
+
constructor(params?: {
|
|
8
|
+
issuer?: {};
|
|
9
|
+
hoder?: {};
|
|
10
|
+
verifier?: {};
|
|
11
|
+
storage: IStorage;
|
|
12
|
+
});
|
|
13
|
+
generateGUID(): string;
|
|
14
|
+
processMessage(message: any, context?: any, _did?: DID): Promise<any>;
|
|
15
|
+
isProtocolMessage(message: any): Promise<boolean>;
|
|
16
|
+
createInvitationMessage(flow: CredentialFlow, did: DID): Promise<any>;
|
|
17
|
+
}
|
|
18
|
+
export interface MicrosoftCredential {
|
|
19
|
+
jti: string;
|
|
20
|
+
iat: number;
|
|
21
|
+
response_type: string;
|
|
22
|
+
response_mode: string;
|
|
23
|
+
scope: string;
|
|
24
|
+
nonce: string;
|
|
25
|
+
client_id: string;
|
|
26
|
+
redirect_uri: string;
|
|
27
|
+
prompt: string;
|
|
28
|
+
state: string;
|
|
29
|
+
exp: number;
|
|
30
|
+
registration: Registration;
|
|
31
|
+
claims: Claims;
|
|
32
|
+
pin: Pin;
|
|
33
|
+
id_token_hint: string;
|
|
34
|
+
}
|
|
35
|
+
export interface Claims {
|
|
36
|
+
vp_token: VpToken;
|
|
37
|
+
}
|
|
38
|
+
export interface VpToken {
|
|
39
|
+
presentation_definition: PresentationDefinition;
|
|
40
|
+
}
|
|
41
|
+
export interface PresentationDefinition {
|
|
42
|
+
id: string;
|
|
43
|
+
input_descriptors: InputDescriptor[];
|
|
44
|
+
}
|
|
45
|
+
export interface InputDescriptor {
|
|
46
|
+
id: string;
|
|
47
|
+
schema: Schema[];
|
|
48
|
+
issuance: Issuance[];
|
|
49
|
+
}
|
|
50
|
+
export interface Issuance {
|
|
51
|
+
manifest: string;
|
|
52
|
+
}
|
|
53
|
+
export interface Schema {
|
|
54
|
+
uri: string;
|
|
55
|
+
}
|
|
56
|
+
export interface Pin {
|
|
57
|
+
length: number;
|
|
58
|
+
type: string;
|
|
59
|
+
alg: string;
|
|
60
|
+
iterations: number;
|
|
61
|
+
salt: string;
|
|
62
|
+
hash: string;
|
|
63
|
+
}
|
|
64
|
+
export interface Registration {
|
|
65
|
+
client_name: string;
|
|
66
|
+
subject_syntax_types_supported: string[];
|
|
67
|
+
vp_formats: VpFormats;
|
|
68
|
+
}
|
|
69
|
+
export interface VpFormats {
|
|
70
|
+
jwt_vp: JwtV;
|
|
71
|
+
jwt_vc: JwtV;
|
|
72
|
+
}
|
|
73
|
+
export interface JwtV {
|
|
74
|
+
alg: string[];
|
|
75
|
+
}
|
|
76
|
+
export interface MicrosoftCredentialInfo {
|
|
77
|
+
sub: string;
|
|
78
|
+
aud: string;
|
|
79
|
+
nonce: string;
|
|
80
|
+
sub_jwk: SubJwk;
|
|
81
|
+
did: string;
|
|
82
|
+
given_name: string;
|
|
83
|
+
family_name: string;
|
|
84
|
+
iss: string;
|
|
85
|
+
iat: number;
|
|
86
|
+
jti: string;
|
|
87
|
+
exp: number;
|
|
88
|
+
pin: Pin;
|
|
89
|
+
}
|
|
90
|
+
export interface Pin {
|
|
91
|
+
length: number;
|
|
92
|
+
type: string;
|
|
93
|
+
alg: string;
|
|
94
|
+
iterations: number;
|
|
95
|
+
salt: string;
|
|
96
|
+
hash: string;
|
|
97
|
+
}
|
|
98
|
+
export interface SubJwk {
|
|
99
|
+
crv: string;
|
|
100
|
+
kid: string;
|
|
101
|
+
kty: string;
|
|
102
|
+
x: string;
|
|
103
|
+
y: string;
|
|
104
|
+
}
|
|
105
|
+
export interface MicrosoftCredentialManifest {
|
|
106
|
+
id: string;
|
|
107
|
+
display: Display;
|
|
108
|
+
input: Input;
|
|
109
|
+
iss: string;
|
|
110
|
+
iat: number;
|
|
111
|
+
}
|
|
112
|
+
export interface Display {
|
|
113
|
+
locale: string;
|
|
114
|
+
contract: string;
|
|
115
|
+
card: Card;
|
|
116
|
+
consent: Consent;
|
|
117
|
+
claims: Claims;
|
|
118
|
+
id: string;
|
|
119
|
+
}
|
|
120
|
+
export interface Card {
|
|
121
|
+
title: string;
|
|
122
|
+
issuedBy: string;
|
|
123
|
+
backgroundColor: string;
|
|
124
|
+
textColor: string;
|
|
125
|
+
logo: Logo;
|
|
126
|
+
description: string;
|
|
127
|
+
}
|
|
128
|
+
export interface Logo {
|
|
129
|
+
uri: string;
|
|
130
|
+
description: string;
|
|
131
|
+
}
|
|
132
|
+
export interface Claims {
|
|
133
|
+
type: string;
|
|
134
|
+
label: string;
|
|
135
|
+
}
|
|
136
|
+
export interface VcCredentialSubject {
|
|
137
|
+
type: string;
|
|
138
|
+
label: string;
|
|
139
|
+
}
|
|
140
|
+
export interface Consent {
|
|
141
|
+
title: string;
|
|
142
|
+
instructions: string;
|
|
143
|
+
}
|
|
144
|
+
export interface Input {
|
|
145
|
+
credentialIssuer: string;
|
|
146
|
+
issuer: string;
|
|
147
|
+
attestations: Attestations;
|
|
148
|
+
id: string;
|
|
149
|
+
}
|
|
150
|
+
export interface Attestations {
|
|
151
|
+
accessTokens: AccessToken[];
|
|
152
|
+
}
|
|
153
|
+
export interface AccessToken {
|
|
154
|
+
id: string;
|
|
155
|
+
encrypted: boolean;
|
|
156
|
+
claims: any[];
|
|
157
|
+
required: boolean;
|
|
158
|
+
configuration: string;
|
|
159
|
+
resourceId: string;
|
|
160
|
+
oboScope: string;
|
|
161
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.OpenIDProtocol = void 0;
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
const jwt_decode_1 = __importDefault(require("jwt-decode"));
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
10
|
+
const vc_protocol_1 = require("./vc-protocol");
|
|
11
|
+
class OpenIDProtocol extends vc_protocol_1.VCProtocol {
|
|
12
|
+
constructor(params) {
|
|
13
|
+
super();
|
|
14
|
+
this.storage = params.storage;
|
|
15
|
+
}
|
|
16
|
+
generateGUID() {
|
|
17
|
+
function generateSegment() {
|
|
18
|
+
return Math.floor((1 + Math.random()) * 0x10000)
|
|
19
|
+
.toString(16)
|
|
20
|
+
.substring(1);
|
|
21
|
+
}
|
|
22
|
+
return (generateSegment() +
|
|
23
|
+
generateSegment() +
|
|
24
|
+
'-' +
|
|
25
|
+
generateSegment() +
|
|
26
|
+
'-4' +
|
|
27
|
+
generateSegment().substr(0, 3) +
|
|
28
|
+
'-' +
|
|
29
|
+
generateSegment() +
|
|
30
|
+
'-' +
|
|
31
|
+
generateSegment() +
|
|
32
|
+
generateSegment() +
|
|
33
|
+
generateSegment());
|
|
34
|
+
}
|
|
35
|
+
async processMessage(message, context, _did) {
|
|
36
|
+
var _a;
|
|
37
|
+
const request_uri = (0, utils_1.getSearchParam)('request_uri', message);
|
|
38
|
+
const encodedData = (await axios_1.default.get(request_uri)).data;
|
|
39
|
+
const decodedData = (0, jwt_decode_1.default)(encodedData);
|
|
40
|
+
const credentialData = (0, jwt_decode_1.default)(decodedData.id_token_hint);
|
|
41
|
+
const manifestEncoded = (_a = (await axios_1.default.get(decodedData.claims.vp_token.presentation_definition.input_descriptors[0]
|
|
42
|
+
.issuance[0].manifest)).data) === null || _a === void 0 ? void 0 : _a.token;
|
|
43
|
+
const credentialManifest = (0, jwt_decode_1.default)(manifestEncoded);
|
|
44
|
+
const { did, sub, aud, exp, iat, iss, jti, nonce, sub_jwk, pin, ...rest } = credentialData;
|
|
45
|
+
const data = {
|
|
46
|
+
credentialSubject: {
|
|
47
|
+
...rest,
|
|
48
|
+
},
|
|
49
|
+
id: this.generateGUID(),
|
|
50
|
+
type: [
|
|
51
|
+
decodedData.claims.vp_token.presentation_definition.input_descriptors[0]
|
|
52
|
+
.id,
|
|
53
|
+
],
|
|
54
|
+
issuer: {
|
|
55
|
+
id: credentialData.iss,
|
|
56
|
+
name: credentialManifest.display.card.issuedBy,
|
|
57
|
+
},
|
|
58
|
+
issuanceDate: new Date(),
|
|
59
|
+
};
|
|
60
|
+
const claims = [
|
|
61
|
+
{
|
|
62
|
+
path: '$.credentialSubject.given_name',
|
|
63
|
+
label: 'First Name',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
path: '$.credentialSubject.family_name',
|
|
67
|
+
label: 'Last Name',
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
const display = {
|
|
71
|
+
description: {
|
|
72
|
+
text: credentialManifest.display.card.description,
|
|
73
|
+
},
|
|
74
|
+
title: {
|
|
75
|
+
text: credentialManifest.display.card.title,
|
|
76
|
+
},
|
|
77
|
+
properties: claims.map((claim) => {
|
|
78
|
+
const value = {
|
|
79
|
+
label: claim.label,
|
|
80
|
+
path: [claim.path],
|
|
81
|
+
schema: {
|
|
82
|
+
type: 'string',
|
|
83
|
+
},
|
|
84
|
+
fallback: 'Unknown',
|
|
85
|
+
};
|
|
86
|
+
return value;
|
|
87
|
+
}),
|
|
88
|
+
};
|
|
89
|
+
const styles = {
|
|
90
|
+
thumbnail: {
|
|
91
|
+
alt: credentialManifest.display.card.logo.description,
|
|
92
|
+
uri: credentialManifest.display.card.logo.uri,
|
|
93
|
+
},
|
|
94
|
+
background: { color: credentialManifest.display.card.backgroundColor },
|
|
95
|
+
text: {
|
|
96
|
+
color: credentialManifest.display.card.textColor,
|
|
97
|
+
},
|
|
98
|
+
hero: {
|
|
99
|
+
uri: '',
|
|
100
|
+
alt: '',
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
const issuer = {
|
|
104
|
+
id: credentialData.iss,
|
|
105
|
+
name: credentialManifest.display.card.issuedBy,
|
|
106
|
+
};
|
|
107
|
+
this.onVcArrived.trigger({
|
|
108
|
+
credentials: [{ data, styles, display }],
|
|
109
|
+
messageId: "",
|
|
110
|
+
issuer,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
async isProtocolMessage(message) {
|
|
114
|
+
if (typeof message === 'string' &&
|
|
115
|
+
message.includes('openid-vc://') &&
|
|
116
|
+
(0, utils_1.getSearchParam)('request_uri', message)) {
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
async createInvitationMessage(flow, did) {
|
|
122
|
+
throw new Error('Method not implemented.');
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
exports.OpenIDProtocol = OpenIDProtocol;
|
|
126
|
+
//# sourceMappingURL=openid-protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openid-protocol.js","sourceRoot":"","sources":["../../../src/vc/protocols/openid-protocol.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { VerifiableCredential } from "@extrimian/vc-core";
|
|
2
|
+
import { Agent } from "../../agent";
|
|
3
|
+
import { DID } from "../../models/did";
|
|
4
|
+
import { LiteEvent } from "../../utils/lite-event";
|
|
5
|
+
import { CredentialFlow } from "../models/credentia-flow";
|
|
6
|
+
import { IssuerData, VerifiableCredentialWithInfo } from "./waci-protocol";
|
|
7
|
+
export declare enum ActorRole {
|
|
8
|
+
Issuer = 0,
|
|
9
|
+
Holder = 1,
|
|
10
|
+
Verifier = 2
|
|
11
|
+
}
|
|
12
|
+
export declare abstract class VCProtocol<TProtocolMessage = any> {
|
|
13
|
+
protected readonly onVcArrived: LiteEvent<{
|
|
14
|
+
credentials: VerifiableCredentialWithInfo[];
|
|
15
|
+
issuer: IssuerData;
|
|
16
|
+
messageId: string;
|
|
17
|
+
}>;
|
|
18
|
+
get vcArrived(): import("../../utils/lite-event").ILiteEvent<{
|
|
19
|
+
credentials: VerifiableCredentialWithInfo[];
|
|
20
|
+
issuer: IssuerData;
|
|
21
|
+
messageId: string;
|
|
22
|
+
}>;
|
|
23
|
+
protected readonly onCredentialIssued: LiteEvent<{
|
|
24
|
+
vc: VerifiableCredential;
|
|
25
|
+
toDID: DID;
|
|
26
|
+
invitationId?: string;
|
|
27
|
+
}>;
|
|
28
|
+
get credentialIssued(): import("../../utils/lite-event").ILiteEvent<{
|
|
29
|
+
vc: VerifiableCredential<any>;
|
|
30
|
+
toDID: DID;
|
|
31
|
+
invitationId?: string;
|
|
32
|
+
}>;
|
|
33
|
+
protected readonly onVcVerified: LiteEvent<{
|
|
34
|
+
verified: boolean;
|
|
35
|
+
presentationVerified: boolean;
|
|
36
|
+
vc: VerifiableCredential;
|
|
37
|
+
}>;
|
|
38
|
+
get vcVerified(): import("../../utils/lite-event").ILiteEvent<{
|
|
39
|
+
verified: boolean;
|
|
40
|
+
presentationVerified: boolean;
|
|
41
|
+
vc: VerifiableCredential<any>;
|
|
42
|
+
}>;
|
|
43
|
+
protected readonly onPresentationVerified: LiteEvent<{
|
|
44
|
+
verified: boolean;
|
|
45
|
+
vcs: VerifiableCredential[];
|
|
46
|
+
thid: string;
|
|
47
|
+
invitationId: string;
|
|
48
|
+
rejectMsg?: string;
|
|
49
|
+
messageId: string;
|
|
50
|
+
}>;
|
|
51
|
+
get presentationVerified(): import("../../utils/lite-event").ILiteEvent<{
|
|
52
|
+
verified: boolean;
|
|
53
|
+
vcs: VerifiableCredential<any>[];
|
|
54
|
+
thid: string;
|
|
55
|
+
invitationId: string;
|
|
56
|
+
rejectMsg?: string;
|
|
57
|
+
messageId: string;
|
|
58
|
+
}>;
|
|
59
|
+
protected readonly onAckCompleted: LiteEvent<{
|
|
60
|
+
role: ActorRole;
|
|
61
|
+
status: string;
|
|
62
|
+
messageId: string;
|
|
63
|
+
thid: string;
|
|
64
|
+
invitationId?: string;
|
|
65
|
+
}>;
|
|
66
|
+
get ackCompleted(): import("../../utils/lite-event").ILiteEvent<{
|
|
67
|
+
role: ActorRole;
|
|
68
|
+
status: string;
|
|
69
|
+
messageId: string;
|
|
70
|
+
thid: string;
|
|
71
|
+
invitationId?: string;
|
|
72
|
+
}>;
|
|
73
|
+
protected readonly onProblemReport: LiteEvent<{
|
|
74
|
+
did: DID;
|
|
75
|
+
code: string;
|
|
76
|
+
codeMessage: string;
|
|
77
|
+
invitationId: string;
|
|
78
|
+
messageId: string;
|
|
79
|
+
}>;
|
|
80
|
+
get problemReport(): import("../../utils/lite-event").ILiteEvent<{
|
|
81
|
+
did: DID;
|
|
82
|
+
code: string;
|
|
83
|
+
codeMessage: string;
|
|
84
|
+
invitationId: string;
|
|
85
|
+
messageId: string;
|
|
86
|
+
}>;
|
|
87
|
+
abstract processMessage(message: TProtocolMessage, context?: any, did?: DID): Promise<VCProtocolResponse | void>;
|
|
88
|
+
abstract isProtocolMessage(message: any): Promise<boolean>;
|
|
89
|
+
abstract createInvitationMessage(flow: CredentialFlow, did: DID): Promise<TProtocolMessage>;
|
|
90
|
+
protected agent: Agent;
|
|
91
|
+
constructor();
|
|
92
|
+
initialize(params: {
|
|
93
|
+
agent: Agent;
|
|
94
|
+
}): void;
|
|
95
|
+
}
|
|
96
|
+
export declare enum VCMessageType {
|
|
97
|
+
RequestCredential = 0
|
|
98
|
+
}
|
|
99
|
+
export interface CredentialRequestedEventArg<TProtocolMessage = any> {
|
|
100
|
+
did: string;
|
|
101
|
+
protocolMessage: TProtocolMessage;
|
|
102
|
+
}
|
|
103
|
+
export interface VCProtocolResponse {
|
|
104
|
+
to: DID;
|
|
105
|
+
message: any;
|
|
106
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VCMessageType = exports.VCProtocol = exports.ActorRole = void 0;
|
|
4
|
+
const lite_event_1 = require("../../utils/lite-event");
|
|
5
|
+
var ActorRole;
|
|
6
|
+
(function (ActorRole) {
|
|
7
|
+
ActorRole[ActorRole["Issuer"] = 0] = "Issuer";
|
|
8
|
+
ActorRole[ActorRole["Holder"] = 1] = "Holder";
|
|
9
|
+
ActorRole[ActorRole["Verifier"] = 2] = "Verifier";
|
|
10
|
+
})(ActorRole = exports.ActorRole || (exports.ActorRole = {}));
|
|
11
|
+
class VCProtocol {
|
|
12
|
+
get vcArrived() { return this.onVcArrived.expose(); }
|
|
13
|
+
get credentialIssued() { return this.onCredentialIssued.expose(); }
|
|
14
|
+
get vcVerified() { return this.onVcVerified.expose(); }
|
|
15
|
+
get presentationVerified() { return this.onPresentationVerified.expose(); }
|
|
16
|
+
get ackCompleted() { return this.onAckCompleted.expose(); }
|
|
17
|
+
get problemReport() { return this.onProblemReport.expose(); }
|
|
18
|
+
constructor() {
|
|
19
|
+
// protected readonly onCredentialRequested = new LiteEvent<CredentialRequestedEventArg>;
|
|
20
|
+
// public get credentialRequested() { return this.onCredentialRequested.expose(); }
|
|
21
|
+
this.onVcArrived = new lite_event_1.LiteEvent;
|
|
22
|
+
this.onCredentialIssued = new lite_event_1.LiteEvent;
|
|
23
|
+
this.onVcVerified = new lite_event_1.LiteEvent;
|
|
24
|
+
this.onPresentationVerified = new lite_event_1.LiteEvent;
|
|
25
|
+
this.onAckCompleted = new lite_event_1.LiteEvent;
|
|
26
|
+
this.onProblemReport = new lite_event_1.LiteEvent;
|
|
27
|
+
}
|
|
28
|
+
initialize(params) {
|
|
29
|
+
this.agent = params.agent;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.VCProtocol = VCProtocol;
|
|
33
|
+
var VCMessageType;
|
|
34
|
+
(function (VCMessageType) {
|
|
35
|
+
VCMessageType[VCMessageType["RequestCredential"] = 0] = "RequestCredential";
|
|
36
|
+
})(VCMessageType = exports.VCMessageType || (exports.VCMessageType = {}));
|
|
37
|
+
//# sourceMappingURL=vc-protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vc-protocol.js","sourceRoot":"","sources":["../../../src/vc/protocols/vc-protocol.ts"],"names":[],"mappings":";;;AAKA,uDAAmD;AAInD,IAAY,SAIX;AAJD,WAAY,SAAS;IACjB,6CAAM,CAAA;IACN,6CAAM,CAAA;IACN,iDAAQ,CAAA;AACZ,CAAC,EAJW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAIpB;AAED,MAAsB,UAAU;IAK5B,IAAW,SAAS,KAAK,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAG5D,IAAW,gBAAgB,KAAK,OAAO,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAG1E,IAAW,UAAU,KAAK,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAG9D,IAAW,oBAAoB,KAAK,OAAO,IAAI,CAAC,sBAAsB,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAGlF,IAAW,YAAY,KAAK,OAAO,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAGlE,IAAW,aAAa,KAAK,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IASpE;QA5BA,yFAAyF;QACzF,mFAAmF;QAEhE,gBAAW,GAAG,IAAI,sBAAiG,CAAC;QAGpH,uBAAkB,GAAG,IAAI,sBAA0E,CAAC;QAGpG,iBAAY,GAAG,IAAI,sBAAyF,CAAC;QAG7G,2BAAsB,GAAG,IAAI,sBAAwI,CAAC;QAGtK,mBAAc,GAAG,IAAI,sBAAsG,CAAC;QAG5H,oBAAe,GAAG,IAAI,sBAAmG,CAAC;IAY7I,CAAC;IAED,UAAU,CAAC,MAEV;QACG,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;IAC9B,CAAC;CACJ;AAtCD,gCAsCC;AAED,IAAY,aAEX;AAFD,WAAY,aAAa;IACrB,2EAAiB,CAAA;AACrB,CAAC,EAFW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAExB"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { Issuer, UnsignedCredential, VerifiableCredential } from "@extrimian/vc-core";
|
|
2
|
+
import { ClaimFormat, CredentialManifestStyles, DisplayMappingObject, GoalCode, InputDescriptor, OutputDescriptor, PresentationDefinition, PresentationDefinitionFrame, WACIMessage } from "@extrimian/waci";
|
|
3
|
+
import { Agent } from "../../agent";
|
|
4
|
+
import { IStorage } from "../../models/agent-storage";
|
|
5
|
+
import { DID } from "../../models/did";
|
|
6
|
+
import { CredentialFlow } from "../models/credentia-flow";
|
|
7
|
+
import { VCProtocol, VCProtocolResponse } from "./vc-protocol";
|
|
8
|
+
export declare class WACIProtocol extends VCProtocol<WACIMessage> {
|
|
9
|
+
private waciInterpreter;
|
|
10
|
+
private storage;
|
|
11
|
+
issueCredentials: (waciInvitationId: string, holderDID: string) => Promise<WACICredentialOfferResponse>;
|
|
12
|
+
issuerVerificationRules?: (waciInvitationId: string, holdedDID: string) => Promise<IssuerVerificationRuleResult>;
|
|
13
|
+
selectVcToPresent?: (vcs: VerifiableCredential[]) => Promise<VerifiableCredential[]>;
|
|
14
|
+
presentationDefinition?: (invitationId: string) => Promise<{
|
|
15
|
+
inputDescriptors: InputDescriptor[];
|
|
16
|
+
frame?: PresentationDefinitionFrame;
|
|
17
|
+
}>;
|
|
18
|
+
credentialApplication?: (inputs: {
|
|
19
|
+
descriptor: InputDescriptor;
|
|
20
|
+
credentials: VerifiableCredentialWithInfo[];
|
|
21
|
+
}[], selectiveDisclosure?: SelectiveDisclosure, message?: WACIMessage, issuer?: (Issuer | CredentialManifestStyles), credentialsToReceive?: VerifiableCredentialWithInfo[]) => Promise<VerifiableCredential[]>;
|
|
22
|
+
credentialApplicationAsync: (inputs: {
|
|
23
|
+
descriptor: InputDescriptor;
|
|
24
|
+
credentials: VerifiableCredentialWithInfo[];
|
|
25
|
+
}[], invitationId: string, selectiveDisclosure?: SelectiveDisclosure, message?: WACIMessage, issuer?: (Issuer | CredentialManifestStyles), credentialsToReceive?: VerifiableCredentialWithInfo[]) => Promise<void>;
|
|
26
|
+
businessVerificationRules?: (invitationId: string, holderDID: DID, vcs: VerifiableCredential[]) => Promise<BusinessRulesVerificationResult>;
|
|
27
|
+
constructor(params?: {
|
|
28
|
+
issuer?: {
|
|
29
|
+
issueCredentials?: (waciInvitationId: string, holderDID: string) => Promise<WACICredentialOfferResponse>;
|
|
30
|
+
issuerVerificationRules?: (waciInvitationId: string, holdedDID: string) => Promise<IssuerVerificationRuleResult>;
|
|
31
|
+
};
|
|
32
|
+
holder?: {
|
|
33
|
+
selectVcToPresent?: (vcs: VerifiableCredential[]) => Promise<VerifiableCredential[]>;
|
|
34
|
+
credentialApplication?: (inputs: {
|
|
35
|
+
descriptor: InputDescriptor;
|
|
36
|
+
credentials: VerifiableCredentialWithInfo[];
|
|
37
|
+
}[], selectiveDisclosure: SelectiveDisclosure, message?: WACIMessage, issuer?: (Issuer | CredentialManifestStyles), credentialsToReceive?: {
|
|
38
|
+
data: VerifiableCredential;
|
|
39
|
+
styles: CredentialManifestStyles;
|
|
40
|
+
display: CredentialDisplay;
|
|
41
|
+
}[]) => Promise<VerifiableCredential[]>;
|
|
42
|
+
credentialApplicationAsync?: (inputs: {
|
|
43
|
+
descriptor: InputDescriptor;
|
|
44
|
+
credentials: VerifiableCredentialWithInfo[];
|
|
45
|
+
}[], invitationId: string, selectiveDisclosure: SelectiveDisclosure, message?: WACIMessage, issuer?: (Issuer | CredentialManifestStyles), credentialsToReceive?: {
|
|
46
|
+
data: VerifiableCredential;
|
|
47
|
+
styles: CredentialManifestStyles;
|
|
48
|
+
display: CredentialDisplay;
|
|
49
|
+
}[]) => Promise<void>;
|
|
50
|
+
};
|
|
51
|
+
verifier?: {
|
|
52
|
+
presentationDefinition?: (invitationId: string) => Promise<{
|
|
53
|
+
inputDescriptors: InputDescriptor[];
|
|
54
|
+
frame?: PresentationDefinitionFrame;
|
|
55
|
+
}>;
|
|
56
|
+
businessVerificationRules?: (invitationId: string, holderDID: DID, vcs: VerifiableCredential[]) => Promise<BusinessRulesVerificationResult>;
|
|
57
|
+
};
|
|
58
|
+
storage: IStorage;
|
|
59
|
+
});
|
|
60
|
+
initialize(params: {
|
|
61
|
+
agent: Agent;
|
|
62
|
+
}): void;
|
|
63
|
+
presentationProceed(invitationId: string, credentialsToPresent: VerifiableCredential[]): Promise<{
|
|
64
|
+
to: DID;
|
|
65
|
+
from: DID;
|
|
66
|
+
message: import("@extrimian/kms-core").DIDCommPackedMessage;
|
|
67
|
+
}>;
|
|
68
|
+
processMessage(message: WACIMessage | string, context?: any, did?: DID): Promise<VCProtocolResponse | void>;
|
|
69
|
+
createOBBInvitation(goalCode: GoalCode, did: DID): Promise<WACIMessage>;
|
|
70
|
+
createInvitationMessage(flow: CredentialFlow, did: DID): Promise<WACIMessage>;
|
|
71
|
+
isProtocolMessage(message: any): Promise<boolean>;
|
|
72
|
+
private decodeMessage;
|
|
73
|
+
private validateSchema;
|
|
74
|
+
}
|
|
75
|
+
export declare enum WACIRequest {
|
|
76
|
+
CredentialManifestRequested = 0
|
|
77
|
+
}
|
|
78
|
+
export declare enum InternalStorageEnum {
|
|
79
|
+
CredentialManifests = "CredentialManifests"
|
|
80
|
+
}
|
|
81
|
+
export type VerifiableCredentialWithInfo = {
|
|
82
|
+
data: VerifiableCredential;
|
|
83
|
+
styles?: CredentialManifestStyles;
|
|
84
|
+
display?: CredentialDisplay;
|
|
85
|
+
};
|
|
86
|
+
export declare class SelectiveDisclosure {
|
|
87
|
+
allFieldsToReveal: string[];
|
|
88
|
+
credentialSubjectFieldsToReveal: string[];
|
|
89
|
+
constructor();
|
|
90
|
+
static from(frame: any, outputDescriptors: any[]): SelectiveDisclosure;
|
|
91
|
+
}
|
|
92
|
+
export type SelectiveDisclosureField = {
|
|
93
|
+
id: string;
|
|
94
|
+
};
|
|
95
|
+
export type CredentialManifestData = {
|
|
96
|
+
id: string;
|
|
97
|
+
version: string;
|
|
98
|
+
issuer: IssuerData;
|
|
99
|
+
format?: ClaimFormat;
|
|
100
|
+
output_descriptors: OutputDescriptor[];
|
|
101
|
+
presentation_definition?: PresentationDefinition;
|
|
102
|
+
};
|
|
103
|
+
export type IssuerData = {
|
|
104
|
+
id: string;
|
|
105
|
+
name: string;
|
|
106
|
+
styles?: CredentialManifestStyles;
|
|
107
|
+
};
|
|
108
|
+
export type CredentialDisplay = {
|
|
109
|
+
title?: DisplayMappingObject;
|
|
110
|
+
subtitle?: DisplayMappingObject;
|
|
111
|
+
description?: DisplayMappingObject;
|
|
112
|
+
properties?: (DisplayMappingObject & {
|
|
113
|
+
label?: string;
|
|
114
|
+
})[];
|
|
115
|
+
};
|
|
116
|
+
export declare class WACIEventArg {
|
|
117
|
+
request: WACIRequest;
|
|
118
|
+
}
|
|
119
|
+
export declare class CredentialRequestedEventArg extends WACIEventArg {
|
|
120
|
+
waciInvitationId: string;
|
|
121
|
+
fromDid: string;
|
|
122
|
+
}
|
|
123
|
+
export type IssuerVerificationRuleResult = {
|
|
124
|
+
verified: boolean;
|
|
125
|
+
rejectMsg: string;
|
|
126
|
+
};
|
|
127
|
+
export type BusinessRulesVerificationResult = {
|
|
128
|
+
result: true;
|
|
129
|
+
} | {
|
|
130
|
+
result: false;
|
|
131
|
+
rejectMessage: string;
|
|
132
|
+
};
|
|
133
|
+
export type WACICredentialOfferResponse = WACICredentialOfferWaitForResponse | WACICredentialOfferRejected | WACICredentialOfferSucceded;
|
|
134
|
+
export declare enum WACICredentialOfferResult {
|
|
135
|
+
Succeded = 0,
|
|
136
|
+
Failed = 1,
|
|
137
|
+
AsyncProcess = 2
|
|
138
|
+
}
|
|
139
|
+
export declare enum CredentialApplicationResponse {
|
|
140
|
+
AsyncProcess = 0
|
|
141
|
+
}
|
|
142
|
+
export interface WACICredentialOfferWaitForResponse {
|
|
143
|
+
result: WACICredentialOfferResult.AsyncProcess;
|
|
144
|
+
}
|
|
145
|
+
export declare class WACICredentialOfferRejected {
|
|
146
|
+
result: WACICredentialOfferResult.Failed;
|
|
147
|
+
rejectMsg: string;
|
|
148
|
+
}
|
|
149
|
+
export declare class WACICredentialOfferSucceded {
|
|
150
|
+
result: WACICredentialOfferResult.Succeded;
|
|
151
|
+
credentialManifest: {
|
|
152
|
+
options?: {
|
|
153
|
+
challenge: string;
|
|
154
|
+
domain: string;
|
|
155
|
+
};
|
|
156
|
+
issuer: {
|
|
157
|
+
name: string;
|
|
158
|
+
styles: CredentialManifestStyles;
|
|
159
|
+
};
|
|
160
|
+
credentials: {
|
|
161
|
+
credential: UnsignedCredential;
|
|
162
|
+
outputDescriptor: OutputDescriptor;
|
|
163
|
+
}[];
|
|
164
|
+
inputDescriptors?: InputDescriptor[];
|
|
165
|
+
frame?: PresentationDefinitionFrame;
|
|
166
|
+
};
|
|
167
|
+
constructor(credentialManifest: {
|
|
168
|
+
options?: {
|
|
169
|
+
challenge: string;
|
|
170
|
+
domain: string;
|
|
171
|
+
};
|
|
172
|
+
issuer: {
|
|
173
|
+
name: string;
|
|
174
|
+
styles: CredentialManifestStyles;
|
|
175
|
+
};
|
|
176
|
+
credentials: {
|
|
177
|
+
credential: UnsignedCredential;
|
|
178
|
+
outputDescriptor: OutputDescriptor;
|
|
179
|
+
}[];
|
|
180
|
+
inputDescriptors?: InputDescriptor[];
|
|
181
|
+
frame?: PresentationDefinitionFrame;
|
|
182
|
+
});
|
|
183
|
+
}
|