@sphereon/ssi-sdk.siopv2-oid4vp-op-auth 0.33.1-feature.vcdm2.4 → 0.33.1-feature.vcdm2.tsup.19
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/index.cjs +101201 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +559 -0
- package/dist/index.d.ts +555 -8
- package/dist/index.js +101182 -11
- package/dist/index.js.map +1 -1
- package/package.json +40 -30
- package/src/agent/DidAuthSiopOpAuthenticator.ts +13 -14
- package/src/session/OpSession.ts +2 -2
- package/dist/agent/DidAuthSiopOpAuthenticator.d.ts +0 -36
- package/dist/agent/DidAuthSiopOpAuthenticator.d.ts.map +0 -1
- package/dist/agent/DidAuthSiopOpAuthenticator.js +0 -371
- package/dist/agent/DidAuthSiopOpAuthenticator.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/link-handler/index.d.ts +0 -22
- package/dist/link-handler/index.d.ts.map +0 -1
- package/dist/link-handler/index.js +0 -45
- package/dist/link-handler/index.js.map +0 -1
- package/dist/localization/Localization.d.ts +0 -9
- package/dist/localization/Localization.d.ts.map +0 -1
- package/dist/localization/Localization.js +0 -41
- package/dist/localization/Localization.js.map +0 -1
- package/dist/localization/translations/en.json +0 -9
- package/dist/localization/translations/nl.json +0 -8
- package/dist/machine/CallbackStateListener.d.ts +0 -3
- package/dist/machine/CallbackStateListener.d.ts.map +0 -1
- package/dist/machine/CallbackStateListener.js +0 -35
- package/dist/machine/CallbackStateListener.js.map +0 -1
- package/dist/machine/Siopv2Machine.d.ts +0 -8
- package/dist/machine/Siopv2Machine.d.ts.map +0 -1
- package/dist/machine/Siopv2Machine.js +0 -362
- package/dist/machine/Siopv2Machine.js.map +0 -1
- package/dist/services/IdentifierService.d.ts +0 -3
- package/dist/services/IdentifierService.d.ts.map +0 -1
- package/dist/services/IdentifierService.js +0 -15
- package/dist/services/IdentifierService.js.map +0 -1
- package/dist/services/Siopv2MachineService.d.ts +0 -18
- package/dist/services/Siopv2MachineService.d.ts.map +0 -1
- package/dist/services/Siopv2MachineService.js +0 -296
- package/dist/services/Siopv2MachineService.js.map +0 -1
- package/dist/session/OID4VP.d.ts +0 -72
- package/dist/session/OID4VP.d.ts.map +0 -1
- package/dist/session/OID4VP.js +0 -213
- package/dist/session/OID4VP.js.map +0 -1
- package/dist/session/OpSession.d.ts +0 -39
- package/dist/session/OpSession.d.ts.map +0 -1
- package/dist/session/OpSession.js +0 -329
- package/dist/session/OpSession.js.map +0 -1
- package/dist/session/functions.d.ts +0 -37
- package/dist/session/functions.d.ts.map +0 -1
- package/dist/session/functions.js +0 -147
- package/dist/session/functions.js.map +0 -1
- package/dist/session/index.d.ts +0 -4
- package/dist/session/index.d.ts.map +0 -1
- package/dist/session/index.js +0 -4
- package/dist/session/index.js.map +0 -1
- package/dist/types/IDidAuthSiopOpAuthenticator.d.ts +0 -120
- package/dist/types/IDidAuthSiopOpAuthenticator.d.ts.map +0 -1
- package/dist/types/IDidAuthSiopOpAuthenticator.js +0 -7
- package/dist/types/IDidAuthSiopOpAuthenticator.js.map +0 -1
- package/dist/types/error/index.d.ts +0 -8
- package/dist/types/error/index.d.ts.map +0 -1
- package/dist/types/error/index.js +0 -2
- package/dist/types/error/index.js.map +0 -1
- package/dist/types/identifier/index.d.ts +0 -53
- package/dist/types/identifier/index.d.ts.map +0 -1
- package/dist/types/identifier/index.js +0 -2
- package/dist/types/identifier/index.js.map +0 -1
- package/dist/types/index.d.ts +0 -6
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -6
- package/dist/types/index.js.map +0 -1
- package/dist/types/machine/index.d.ts +0 -124
- package/dist/types/machine/index.d.ts.map +0 -1
- package/dist/types/machine/index.js +0 -54
- package/dist/types/machine/index.js.map +0 -1
- package/dist/types/siop-service/index.d.ts +0 -80
- package/dist/types/siop-service/index.d.ts.map +0 -1
- package/dist/types/siop-service/index.js +0 -11
- package/dist/types/siop-service/index.js.map +0 -1
- package/dist/utils/CredentialUtils.d.ts +0 -23
- package/dist/utils/CredentialUtils.d.ts.map +0 -1
- package/dist/utils/CredentialUtils.js +0 -55
- package/dist/utils/CredentialUtils.js.map +0 -1
- package/dist/utils/dcql.d.ts +0 -5
- package/dist/utils/dcql.d.ts.map +0 -1
- package/dist/utils/dcql.js +0 -34
- package/dist/utils/dcql.js.map +0 -1
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { CredentialMapper } from '@sphereon/ssi-types';
|
|
2
|
-
/**
|
|
3
|
-
* Return the type(s) of a VC minus the VerifiableCredential type which should always be present
|
|
4
|
-
* @param credential The input credential
|
|
5
|
-
*/
|
|
6
|
-
export const getCredentialTypeAsString = (credential) => {
|
|
7
|
-
if (!credential.type) {
|
|
8
|
-
return 'Verifiable Credential';
|
|
9
|
-
}
|
|
10
|
-
else if (typeof credential.type === 'string') {
|
|
11
|
-
return credential.type;
|
|
12
|
-
}
|
|
13
|
-
return credential.type.filter((type) => type !== 'VerifiableCredential').join(', ');
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Returns a Unique Verifiable Credential (with hash) as stored in Veramo, based upon matching the id of the input VC or the proof value of the input VC
|
|
17
|
-
* @param uniqueVCs The Unique VCs to search in
|
|
18
|
-
* @param searchVC The VC to search for in the unique VCs array
|
|
19
|
-
*/
|
|
20
|
-
export const getMatchingUniqueDigitalCredential = (uniqueVCs, searchVC) => {
|
|
21
|
-
// Since an ID is optional in a VC according to VCDM, and we really need the matches, we have a fallback match on something which is guaranteed to be unique for any VC (the proof(s))
|
|
22
|
-
return uniqueVCs.find((uniqueVC) => (typeof searchVC !== 'string' &&
|
|
23
|
-
(uniqueVC.id === searchVC.id ||
|
|
24
|
-
uniqueVC.originalVerifiableCredential.proof === searchVC.proof)) ||
|
|
25
|
-
(typeof searchVC === 'string' && uniqueVC.uniformVerifiableCredential?.proof?.jwt === searchVC) ||
|
|
26
|
-
// We are ignoring the signature of the sd-jwt as PEX signs the vc again and it will not match anymore with the jwt in the proof of the stored jsonld vc
|
|
27
|
-
(typeof searchVC === 'string' &&
|
|
28
|
-
CredentialMapper.isSdJwtEncoded(searchVC) &&
|
|
29
|
-
uniqueVC.uniformVerifiableCredential?.proof &&
|
|
30
|
-
'jwt' in uniqueVC.uniformVerifiableCredential.proof &&
|
|
31
|
-
uniqueVC.uniformVerifiableCredential.proof.jwt?.split('.')?.slice(0, 2)?.join('.') === searchVC.split('.')?.slice(0, 2)?.join('.')));
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Get an original verifiable credential. Maps to wrapped Verifiable Credential first, to get an original JWT as Veramo stores these with a special proof value
|
|
35
|
-
* @param credential The input VC
|
|
36
|
-
*/
|
|
37
|
-
export const getOriginalVerifiableCredential = (credential) => {
|
|
38
|
-
if (isUniqueDigitalCredential(credential)) {
|
|
39
|
-
if (!credential.originalVerifiableCredential) {
|
|
40
|
-
throw new Error('originalVerifiableCredential is not defined in UniqueDigitalCredential');
|
|
41
|
-
}
|
|
42
|
-
return getCredentialFromProofOrWrapped(credential.originalVerifiableCredential);
|
|
43
|
-
}
|
|
44
|
-
return getCredentialFromProofOrWrapped(credential);
|
|
45
|
-
};
|
|
46
|
-
const getCredentialFromProofOrWrapped = (cred, hasher) => {
|
|
47
|
-
if (typeof cred === 'object' && 'proof' in cred && 'jwt' in cred.proof && CredentialMapper.isSdJwtEncoded(cred.proof.jwt)) {
|
|
48
|
-
return cred.proof.jwt;
|
|
49
|
-
}
|
|
50
|
-
return CredentialMapper.toWrappedVerifiableCredential(cred, { hasher }).original;
|
|
51
|
-
};
|
|
52
|
-
export const isUniqueDigitalCredential = (credential) => {
|
|
53
|
-
return credential.digitalCredential !== undefined;
|
|
54
|
-
};
|
|
55
|
-
//# sourceMappingURL=CredentialUtils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CredentialUtils.js","sourceRoot":"","sources":["../../src/utils/CredentialUtils.ts"],"names":[],"mappings":"AAAA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credential-store';
|
|
2
|
-
import { DcqlCredential } from 'dcql';
|
|
3
|
-
import { HasherSync, OriginalVerifiableCredential } from '@sphereon/ssi-types';
|
|
4
|
-
export declare function convertToDcqlCredentials(credential: UniqueDigitalCredential | OriginalVerifiableCredential, hasher?: HasherSync): DcqlCredential;
|
|
5
|
-
//# sourceMappingURL=dcql.d.ts.map
|
package/dist/utils/dcql.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dcql.d.ts","sourceRoot":"","sources":["../../src/utils/dcql.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAC5E,OAAO,EAAE,cAAc,EAA8C,MAAM,MAAM,CAAA;AACjF,OAAO,EAAoB,UAAU,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAA;AAGhG,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,uBAAuB,GAAG,4BAA4B,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,cAAc,CA8BhJ"}
|
package/dist/utils/dcql.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { CredentialMapper } from '@sphereon/ssi-types';
|
|
2
|
-
import { isUniqueDigitalCredential } from './CredentialUtils';
|
|
3
|
-
export function convertToDcqlCredentials(credential, hasher) {
|
|
4
|
-
let payload;
|
|
5
|
-
if (isUniqueDigitalCredential(credential)) {
|
|
6
|
-
if (!credential.originalVerifiableCredential) {
|
|
7
|
-
throw new Error('originalVerifiableCredential is not defined in UniqueDigitalCredential');
|
|
8
|
-
}
|
|
9
|
-
payload = CredentialMapper.decodeVerifiableCredential(credential.originalVerifiableCredential, hasher);
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
payload = CredentialMapper.decodeVerifiableCredential(credential, hasher);
|
|
13
|
-
}
|
|
14
|
-
if (!payload) {
|
|
15
|
-
throw new Error('No payload found');
|
|
16
|
-
}
|
|
17
|
-
if ('decodedPayload' in payload && payload.decodedPayload) {
|
|
18
|
-
payload = payload.decodedPayload;
|
|
19
|
-
}
|
|
20
|
-
if ('vct' in payload) {
|
|
21
|
-
return { vct: payload.vct, claims: payload, credential_format: 'vc+sd-jwt' }; // TODO dc+sd-jwt support?
|
|
22
|
-
}
|
|
23
|
-
else if ('docType' in payload && 'namespaces' in payload) {
|
|
24
|
-
// mdoc
|
|
25
|
-
return { docType: payload.docType, namespaces: payload.namespaces, claims: payload };
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
return {
|
|
29
|
-
claims: payload,
|
|
30
|
-
credential_format: 'jwt_vc_json', // TODO jwt_vc_json-ld support
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=dcql.js.map
|
package/dist/utils/dcql.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dcql.js","sourceRoot":"","sources":["../../src/utils/dcql.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAA4C,MAAM,qBAAqB,CAAA;AAChG,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA;AAE7D,MAAM,UAAU,wBAAwB,CAAC,UAAkE,EAAE,MAAmB;IAC9H,IAAI,OAAO,CAAA;IACX,IAAI,yBAAyB,CAAC,UAAU,CAAC,EAAE,CAAC;QAC1C,IAAI,CAAC,UAAU,CAAC,4BAA4B,EAAE,CAAC;YAC7C,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAA;QAC3F,CAAC;QACD,OAAO,GAAG,gBAAgB,CAAC,0BAA0B,CAAC,UAAU,CAAC,4BAA4B,EAAE,MAAM,CAAC,CAAA;IACxG,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,gBAAgB,CAAC,0BAA0B,CAAC,UAA0C,EAAE,MAAM,CAAC,CAAA;IAC3G,CAAC;IAED,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,kBAAkB,C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