@sphereon/oid4vci-common 0.4.1-next.285
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/LICENSE +201 -0
- package/dist/functions/CredentialOfferUtil.d.ts +25 -0
- package/dist/functions/CredentialOfferUtil.d.ts.map +1 -0
- package/dist/functions/CredentialOfferUtil.js +303 -0
- package/dist/functions/CredentialOfferUtil.js.map +1 -0
- package/dist/functions/CredentialRequestUtil.d.ts +3 -0
- package/dist/functions/CredentialRequestUtil.d.ts.map +1 -0
- package/dist/functions/CredentialRequestUtil.js +8 -0
- package/dist/functions/CredentialRequestUtil.js.map +1 -0
- package/dist/functions/Encoding.d.ts +20 -0
- package/dist/functions/Encoding.d.ts.map +1 -0
- package/dist/functions/Encoding.js +164 -0
- package/dist/functions/Encoding.js.map +1 -0
- package/dist/functions/HttpUtils.d.ts +33 -0
- package/dist/functions/HttpUtils.d.ts.map +1 -0
- package/dist/functions/HttpUtils.js +146 -0
- package/dist/functions/HttpUtils.js.map +1 -0
- package/dist/functions/IssuerMetadataUtils.d.ts +10 -0
- package/dist/functions/IssuerMetadataUtils.d.ts.map +1 -0
- package/dist/functions/IssuerMetadataUtils.js +89 -0
- package/dist/functions/IssuerMetadataUtils.js.map +1 -0
- package/dist/functions/TypeConversionUtils.d.ts +2 -0
- package/dist/functions/TypeConversionUtils.d.ts.map +1 -0
- package/dist/functions/TypeConversionUtils.js +8 -0
- package/dist/functions/TypeConversionUtils.js.map +1 -0
- package/dist/functions/index.d.ts +4 -0
- package/dist/functions/index.d.ts.map +1 -0
- package/dist/functions/index.js +20 -0
- package/dist/functions/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/types/Authorization.types.d.ts +198 -0
- package/dist/types/Authorization.types.d.ts.map +1 -0
- package/dist/types/Authorization.types.js +40 -0
- package/dist/types/Authorization.types.js.map +1 -0
- package/dist/types/CredentialIssuance.types.d.ts +139 -0
- package/dist/types/CredentialIssuance.types.d.ts.map +1 -0
- package/dist/types/CredentialIssuance.types.js +10 -0
- package/dist/types/CredentialIssuance.types.js.map +1 -0
- package/dist/types/Generic.types.d.ts +156 -0
- package/dist/types/Generic.types.d.ts.map +1 -0
- package/dist/types/Generic.types.js +11 -0
- package/dist/types/Generic.types.js.map +1 -0
- package/dist/types/OAuth2ASMetadata.d.ts +41 -0
- package/dist/types/OAuth2ASMetadata.d.ts.map +1 -0
- package/dist/types/OAuth2ASMetadata.js +3 -0
- package/dist/types/OAuth2ASMetadata.js.map +1 -0
- package/dist/types/OpenID4VCIErrors.d.ts +34 -0
- package/dist/types/OpenID4VCIErrors.d.ts.map +1 -0
- package/dist/types/OpenID4VCIErrors.js +38 -0
- package/dist/types/OpenID4VCIErrors.js.map +1 -0
- package/dist/types/OpenID4VCIServerMetadata.d.ts +4 -0
- package/dist/types/OpenID4VCIServerMetadata.d.ts.map +1 -0
- package/dist/types/OpenID4VCIServerMetadata.js +17 -0
- package/dist/types/OpenID4VCIServerMetadata.js.map +1 -0
- package/dist/types/OpenID4VCIVersions.types.d.ts +11 -0
- package/dist/types/OpenID4VCIVersions.types.d.ts.map +1 -0
- package/dist/types/OpenID4VCIVersions.types.js +16 -0
- package/dist/types/OpenID4VCIVersions.types.js.map +1 -0
- package/dist/types/StateManager.types.d.ts +33 -0
- package/dist/types/StateManager.types.d.ts.map +1 -0
- package/dist/types/StateManager.types.js +3 -0
- package/dist/types/StateManager.types.js.map +1 -0
- package/dist/types/Token.types.d.ts +15 -0
- package/dist/types/Token.types.d.ts.map +1 -0
- package/dist/types/Token.types.js +30 -0
- package/dist/types/Token.types.js.map +1 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +29 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/v1_0_08.types.d.ts +38 -0
- package/dist/types/v1_0_08.types.d.ts.map +1 -0
- package/dist/types/v1_0_08.types.js +3 -0
- package/dist/types/v1_0_08.types.js.map +1 -0
- package/dist/types/v1_0_09.types.d.ts +29 -0
- package/dist/types/v1_0_09.types.d.ts.map +1 -0
- package/dist/types/v1_0_09.types.js +9 -0
- package/dist/types/v1_0_09.types.js.map +1 -0
- package/dist/types/v1_0_11.types.d.ts +49 -0
- package/dist/types/v1_0_11.types.d.ts.map +1 -0
- package/dist/types/v1_0_11.types.js +9 -0
- package/dist/types/v1_0_11.types.js.map +1 -0
- package/lib/__tests__/CredentialOfferUtil.spec.ts +55 -0
- package/lib/functions/CredentialOfferUtil.ts +338 -0
- package/lib/functions/CredentialRequestUtil.ts +5 -0
- package/lib/functions/Encoding.ts +166 -0
- package/lib/functions/HttpUtils.ts +168 -0
- package/lib/functions/IssuerMetadataUtils.ts +101 -0
- package/lib/functions/TypeConversionUtils.ts +3 -0
- package/lib/functions/index.ts +3 -0
- package/lib/index.ts +2 -0
- package/lib/types/Authorization.types.ts +234 -0
- package/lib/types/CredentialIssuance.types.ts +167 -0
- package/lib/types/Generic.types.ts +234 -0
- package/lib/types/OAuth2ASMetadata.ts +49 -0
- package/lib/types/OpenID4VCIErrors.ts +35 -0
- package/lib/types/OpenID4VCIServerMetadata.ts +20 -0
- package/lib/types/OpenID4VCIVersions.types.ts +11 -0
- package/lib/types/StateManager.types.ts +45 -0
- package/lib/types/Token.types.ts +29 -0
- package/lib/types/index.ts +12 -0
- package/lib/types/v1_0_08.types.ts +44 -0
- package/lib/types/v1_0_09.types.ts +36 -0
- package/lib/types/v1_0_11.types.ts +68 -0
- package/package.json +49 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const BAD_PARAMS = "Wrong parameters provided";
|
|
2
|
+
export declare const URL_NOT_VALID = "Request url is not valid";
|
|
3
|
+
export declare const JWS_NOT_VALID = "JWS is not valid";
|
|
4
|
+
export declare const PROOF_CANT_BE_CONSTRUCTED = "Proof can't be constructed.";
|
|
5
|
+
export declare const NO_JWT_PROVIDED = "No JWT provided";
|
|
6
|
+
export declare const TYP_ERROR = "Typ must be \"openid4vci-proof+jwt\"";
|
|
7
|
+
export declare const ALG_ERROR: string;
|
|
8
|
+
export declare const KID_JWK_X5C_ERROR = "Only one must be present: kid, jwk or x5c";
|
|
9
|
+
export declare const AUD_ERROR = "aud must be the URL of the credential issuer";
|
|
10
|
+
export declare const IAT_ERROR = "iat must be the time at which the proof was issued";
|
|
11
|
+
export declare const NONCE_ERROR = "nonce must be c_nonce provided by the credential issuer";
|
|
12
|
+
export declare const JWT_VERIFY_CONFIG_ERROR = "JWT verify callback not configured correctly.";
|
|
13
|
+
export declare const ISSUER_CONFIG_ERROR = "Issuer not configured correctly.";
|
|
14
|
+
export declare const UNKNOWN_CLIENT_ERROR = "The client is not known by the issuer";
|
|
15
|
+
export declare const NO_ISS_IN_AUTHORIZATION_CODE_CONTEXT = "iss missing in authorization-code context";
|
|
16
|
+
export declare const ISS_PRESENT_IN_PRE_AUTHORIZED_CODE_CONTEXT = "iss should be omitted in pre-authorized-code context";
|
|
17
|
+
export declare const ISS_MUST_BE_CLIENT_ID = "iss must be the client id";
|
|
18
|
+
export declare const GRANTS_MUST_NOT_BE_UNDEFINED = "Grants must not be undefined";
|
|
19
|
+
export declare const STATE_MISSING_ERROR = "issuer state or pre-authorized key not found";
|
|
20
|
+
export declare const CREDENTIAL_MISSING_ERROR = "Credential must be present in response";
|
|
21
|
+
export declare const UNSUPPORTED_GRANT_TYPE_ERROR = "unsupported grant_type";
|
|
22
|
+
export declare const PRE_AUTHORIZED_CODE_REQUIRED_ERROR = "pre-authorized_code is required";
|
|
23
|
+
export declare const USER_PIN_REQUIRED_ERROR = "User pin is required";
|
|
24
|
+
export declare const USER_PIN_NOT_REQUIRED_ERROR = "User pin is not required";
|
|
25
|
+
export declare const PIN_VALIDATION_ERROR = "PIN must consist of maximum 8 numeric characters";
|
|
26
|
+
export declare const PIN_NOT_MATCH_ERROR = "PIN is invalid";
|
|
27
|
+
export declare const INVALID_PRE_AUTHORIZED_CODE = "pre-authorized_code is invalid";
|
|
28
|
+
export declare const EXPIRED_PRE_AUTHORIZED_CODE = "pre-authorized_code is expired";
|
|
29
|
+
export declare const JWT_SIGNER_CALLBACK_REQUIRED_ERROR = "JWT signer callback function is required";
|
|
30
|
+
export declare const STATE_MANAGER_REQUIRED_ERROR = "StateManager instance is required";
|
|
31
|
+
export declare const NONCE_STATE_MANAGER_REQUIRED_ERROR = "NonceStateManager instance is required";
|
|
32
|
+
export declare const PIN_NOT_MATCHING_ERROR = "PIN does not match";
|
|
33
|
+
export declare const ACCESS_TOKEN_ISSUER_REQUIRED_ERROR = "access token issuer is required";
|
|
34
|
+
//# sourceMappingURL=OpenID4VCIErrors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenID4VCIErrors.d.ts","sourceRoot":"","sources":["../../lib/types/OpenID4VCIErrors.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,8BAA8B,CAAC;AACtD,eAAO,MAAM,aAAa,6BAA6B,CAAC;AACxD,eAAO,MAAM,aAAa,qBAAqB,CAAC;AAChD,eAAO,MAAM,yBAAyB,gCAAgC,CAAC;AACvE,eAAO,MAAM,eAAe,oBAAoB,CAAC;AACjD,eAAO,MAAM,SAAS,yCAAuC,CAAC;AAC9D,eAAO,MAAM,SAAS,QAAqF,CAAC;AAC5G,eAAO,MAAM,iBAAiB,8CAA8C,CAAC;AAC7E,eAAO,MAAM,SAAS,iDAAiD,CAAC;AACxE,eAAO,MAAM,SAAS,uDAAuD,CAAC;AAC9E,eAAO,MAAM,WAAW,4DAA4D,CAAC;AACrF,eAAO,MAAM,uBAAuB,kDAAkD,CAAC;AACvF,eAAO,MAAM,mBAAmB,qCAAqC,CAAC;AACtE,eAAO,MAAM,oBAAoB,0CAA0C,CAAC;AAC5E,eAAO,MAAM,oCAAoC,8CAA8C,CAAC;AAChG,eAAO,MAAM,0CAA0C,yDAAyD,CAAC;AACjH,eAAO,MAAM,qBAAqB,8BAA8B,CAAC;AACjE,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAC3E,eAAO,MAAM,mBAAmB,iDAAiD,CAAC;AAClF,eAAO,MAAM,wBAAwB,2CAA2C,CAAC;AACjF,eAAO,MAAM,4BAA4B,2BAA2B,CAAC;AACrE,eAAO,MAAM,kCAAkC,oCAAoC,CAAC;AACpF,eAAO,MAAM,uBAAuB,yBAAyB,CAAC;AAC9D,eAAO,MAAM,2BAA2B,6BAA6B,CAAC;AACtE,eAAO,MAAM,oBAAoB,qDAAqD,CAAC;AACvF,eAAO,MAAM,mBAAmB,mBAAmB,CAAC;AACpD,eAAO,MAAM,2BAA2B,mCAAmC,CAAC;AAC5E,eAAO,MAAM,2BAA2B,mCAAmC,CAAC;AAC5E,eAAO,MAAM,kCAAkC,6CAA6C,CAAC;AAC7F,eAAO,MAAM,4BAA4B,sCAAsC,CAAC;AAChF,eAAO,MAAM,kCAAkC,2CAA2C,CAAC;AAC3F,eAAO,MAAM,sBAAsB,uBAAuB,CAAC;AAC3D,eAAO,MAAM,kCAAkC,oCAAoC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ACCESS_TOKEN_ISSUER_REQUIRED_ERROR = exports.PIN_NOT_MATCHING_ERROR = exports.NONCE_STATE_MANAGER_REQUIRED_ERROR = exports.STATE_MANAGER_REQUIRED_ERROR = exports.JWT_SIGNER_CALLBACK_REQUIRED_ERROR = exports.EXPIRED_PRE_AUTHORIZED_CODE = exports.INVALID_PRE_AUTHORIZED_CODE = exports.PIN_NOT_MATCH_ERROR = exports.PIN_VALIDATION_ERROR = exports.USER_PIN_NOT_REQUIRED_ERROR = exports.USER_PIN_REQUIRED_ERROR = exports.PRE_AUTHORIZED_CODE_REQUIRED_ERROR = exports.UNSUPPORTED_GRANT_TYPE_ERROR = exports.CREDENTIAL_MISSING_ERROR = exports.STATE_MISSING_ERROR = exports.GRANTS_MUST_NOT_BE_UNDEFINED = exports.ISS_MUST_BE_CLIENT_ID = exports.ISS_PRESENT_IN_PRE_AUTHORIZED_CODE_CONTEXT = exports.NO_ISS_IN_AUTHORIZATION_CODE_CONTEXT = exports.UNKNOWN_CLIENT_ERROR = exports.ISSUER_CONFIG_ERROR = exports.JWT_VERIFY_CONFIG_ERROR = exports.NONCE_ERROR = exports.IAT_ERROR = exports.AUD_ERROR = exports.KID_JWK_X5C_ERROR = exports.ALG_ERROR = exports.TYP_ERROR = exports.NO_JWT_PROVIDED = exports.PROOF_CANT_BE_CONSTRUCTED = exports.JWS_NOT_VALID = exports.URL_NOT_VALID = exports.BAD_PARAMS = void 0;
|
|
4
|
+
const CredentialIssuance_types_1 = require("./CredentialIssuance.types");
|
|
5
|
+
exports.BAD_PARAMS = 'Wrong parameters provided';
|
|
6
|
+
exports.URL_NOT_VALID = 'Request url is not valid';
|
|
7
|
+
exports.JWS_NOT_VALID = 'JWS is not valid';
|
|
8
|
+
exports.PROOF_CANT_BE_CONSTRUCTED = "Proof can't be constructed.";
|
|
9
|
+
exports.NO_JWT_PROVIDED = 'No JWT provided';
|
|
10
|
+
exports.TYP_ERROR = 'Typ must be "openid4vci-proof+jwt"';
|
|
11
|
+
exports.ALG_ERROR = `Algorithm is a required field and must be one of: ${Object.keys(CredentialIssuance_types_1.Alg).join(', ')}`;
|
|
12
|
+
exports.KID_JWK_X5C_ERROR = 'Only one must be present: kid, jwk or x5c';
|
|
13
|
+
exports.AUD_ERROR = 'aud must be the URL of the credential issuer';
|
|
14
|
+
exports.IAT_ERROR = 'iat must be the time at which the proof was issued';
|
|
15
|
+
exports.NONCE_ERROR = 'nonce must be c_nonce provided by the credential issuer';
|
|
16
|
+
exports.JWT_VERIFY_CONFIG_ERROR = 'JWT verify callback not configured correctly.';
|
|
17
|
+
exports.ISSUER_CONFIG_ERROR = 'Issuer not configured correctly.';
|
|
18
|
+
exports.UNKNOWN_CLIENT_ERROR = 'The client is not known by the issuer';
|
|
19
|
+
exports.NO_ISS_IN_AUTHORIZATION_CODE_CONTEXT = 'iss missing in authorization-code context';
|
|
20
|
+
exports.ISS_PRESENT_IN_PRE_AUTHORIZED_CODE_CONTEXT = 'iss should be omitted in pre-authorized-code context';
|
|
21
|
+
exports.ISS_MUST_BE_CLIENT_ID = 'iss must be the client id';
|
|
22
|
+
exports.GRANTS_MUST_NOT_BE_UNDEFINED = 'Grants must not be undefined';
|
|
23
|
+
exports.STATE_MISSING_ERROR = 'issuer state or pre-authorized key not found';
|
|
24
|
+
exports.CREDENTIAL_MISSING_ERROR = 'Credential must be present in response';
|
|
25
|
+
exports.UNSUPPORTED_GRANT_TYPE_ERROR = 'unsupported grant_type';
|
|
26
|
+
exports.PRE_AUTHORIZED_CODE_REQUIRED_ERROR = 'pre-authorized_code is required';
|
|
27
|
+
exports.USER_PIN_REQUIRED_ERROR = 'User pin is required';
|
|
28
|
+
exports.USER_PIN_NOT_REQUIRED_ERROR = 'User pin is not required';
|
|
29
|
+
exports.PIN_VALIDATION_ERROR = 'PIN must consist of maximum 8 numeric characters';
|
|
30
|
+
exports.PIN_NOT_MATCH_ERROR = 'PIN is invalid';
|
|
31
|
+
exports.INVALID_PRE_AUTHORIZED_CODE = 'pre-authorized_code is invalid';
|
|
32
|
+
exports.EXPIRED_PRE_AUTHORIZED_CODE = 'pre-authorized_code is expired';
|
|
33
|
+
exports.JWT_SIGNER_CALLBACK_REQUIRED_ERROR = 'JWT signer callback function is required';
|
|
34
|
+
exports.STATE_MANAGER_REQUIRED_ERROR = 'StateManager instance is required';
|
|
35
|
+
exports.NONCE_STATE_MANAGER_REQUIRED_ERROR = 'NonceStateManager instance is required';
|
|
36
|
+
exports.PIN_NOT_MATCHING_ERROR = 'PIN does not match';
|
|
37
|
+
exports.ACCESS_TOKEN_ISSUER_REQUIRED_ERROR = 'access token issuer is required';
|
|
38
|
+
//# sourceMappingURL=OpenID4VCIErrors.js.map
|
|
@@ -0,0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AAG,gBAAgB,CAAC;AACvC,QAAA,2BAA2B,GAAG,gCAAgC,CAAC;AAC/D,QAAA,2BAA2B,GAAG,gCAAgC,CAAC;AAC/D,QAAA,kCAAkC,GAAG,0CAA0C,CAAC;AAChF,QAAA,4BAA4B,GAAG,mCAAmC,CAAC;AACnE,QAAA,kCAAkC,GAAG,wCAAwC,CAAC;AAC9E,QAAA,sBAAsB,GAAG,oBAAoB,CAAC;AAC9C,QAAA,kCAAkC,GAAG,iCAAiC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenID4VCIServerMetadata.d.ts","sourceRoot":"","sources":["../../lib/types/OpenID4VCIServerMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,MAAM,2BAA2B,GAAG,gBAAgB,GAAG,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// export type OpenID4VCICredentialFormatTypes = CredentialFormat | 'mdl_iso' | 'ac_vc' | string;
|
|
4
|
+
/*export interface CredentialFormatSupport {
|
|
5
|
+
types: string[]; //REQUIRED. Array of strings representing a format specific type of a Credential. This value corresponds to type in W3C [VC_DATA] and a doctype in ISO/IEC 18013-5 (mobile Driving License).
|
|
6
|
+
cryptographic_binding_methods_supported?: string[]; //OPTIONAL. Array of case sensitive strings that identify how the Credential is bound to the identifier of the End-User who possesses the Credential as defined in Section 9.1. A non-exhaustive list of valid values defined by this specification are did, jwk, and mso.
|
|
7
|
+
cryptographic_suites_supported?: string[]; //OPTIONAL. Array of case sensitive strings that identify the cryptographic suites that are supported for the cryptographic_binding_methods_supported. Cryptosuites for Credentials in jwt_vc format should use algorithm names defined in IANA JOSE Algorithms Registry. Cryptosuites for Credentials in ldp_vc format should use signature suites names defined in Linked Data Cryptographic Suite Registry.
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
|
+
[x: string]: any; //We use any, so you can access properties if you know the structure
|
|
10
|
+
}*/
|
|
11
|
+
/*
|
|
12
|
+
|
|
13
|
+
export type Formats = {
|
|
14
|
+
[format in OpenID4VCICredentialFormatTypes]: CredentialFormatSupport;
|
|
15
|
+
};
|
|
16
|
+
*/
|
|
17
|
+
//# sourceMappingURL=OpenID4VCIServerMetadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenID4VCIServerMetadata.js","sourceRoot":"","sources":["../../lib/types/OpenID4VCIServerMetadata.ts"],"names":[],"mappings":";;AAKA,iGAAiG;AAEjG;;;;;;GAMG;AACH;;;;;EAKE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare enum OpenId4VCIVersion {
|
|
2
|
+
VER_1_0_08 = 1008,
|
|
3
|
+
VER_1_0_09 = 1009,
|
|
4
|
+
VER_1_0_11 = 1011,
|
|
5
|
+
VER_UNKNOWN
|
|
6
|
+
}
|
|
7
|
+
export declare enum DefaultURISchemes {
|
|
8
|
+
INITIATE_ISSUANCE = "openid-initiate-issuance",
|
|
9
|
+
CREDENTIAL_OFFER = "openid-credential-offer"
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=OpenID4VCIVersions.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenID4VCIVersions.types.d.ts","sourceRoot":"","sources":["../../lib/types/OpenID4VCIVersions.types.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IAC3B,UAAU,OAAO;IACjB,UAAU,OAAO;IACjB,UAAU,OAAO;IACjB,WAA8B;CAC/B;AAED,oBAAY,iBAAiB;IAC3B,iBAAiB,6BAA6B;IAC9C,gBAAgB,4BAA4B;CAC7C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DefaultURISchemes = exports.OpenId4VCIVersion = void 0;
|
|
4
|
+
var OpenId4VCIVersion;
|
|
5
|
+
(function (OpenId4VCIVersion) {
|
|
6
|
+
OpenId4VCIVersion[OpenId4VCIVersion["VER_1_0_08"] = 1008] = "VER_1_0_08";
|
|
7
|
+
OpenId4VCIVersion[OpenId4VCIVersion["VER_1_0_09"] = 1009] = "VER_1_0_09";
|
|
8
|
+
OpenId4VCIVersion[OpenId4VCIVersion["VER_1_0_11"] = 1011] = "VER_1_0_11";
|
|
9
|
+
OpenId4VCIVersion[OpenId4VCIVersion["VER_UNKNOWN"] = Number.MIN_VALUE] = "VER_UNKNOWN";
|
|
10
|
+
})(OpenId4VCIVersion = exports.OpenId4VCIVersion || (exports.OpenId4VCIVersion = {}));
|
|
11
|
+
var DefaultURISchemes;
|
|
12
|
+
(function (DefaultURISchemes) {
|
|
13
|
+
DefaultURISchemes["INITIATE_ISSUANCE"] = "openid-initiate-issuance";
|
|
14
|
+
DefaultURISchemes["CREDENTIAL_OFFER"] = "openid-credential-offer";
|
|
15
|
+
})(DefaultURISchemes = exports.DefaultURISchemes || (exports.DefaultURISchemes = {}));
|
|
16
|
+
//# sourceMappingURL=OpenID4VCIVersions.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpenID4VCIVersions.types.js","sourceRoot":"","sources":["../../lib/types/OpenID4VCIVersions.types.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,wEAAiB,CAAA;IACjB,wEAAiB,CAAA;IACjB,wEAAiB,CAAA;IACjB,qDAAc,MAAM,CAAC,SAAS,iBAAA,CAAA;AAChC,CAAC,EALW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAK5B;AAED,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,mEAA8C,CAAA;IAC9C,iEAA4C,CAAA;AAC9C,CAAC,EAHW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAG5B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AssertedUniformCredentialOffer } from './CredentialIssuance.types';
|
|
2
|
+
export interface StateType {
|
|
3
|
+
createdAt: number;
|
|
4
|
+
}
|
|
5
|
+
export interface CredentialOfferSession extends StateType {
|
|
6
|
+
clientId?: string;
|
|
7
|
+
credentialOffer: AssertedUniformCredentialOffer;
|
|
8
|
+
userPin?: string;
|
|
9
|
+
issuerState?: string;
|
|
10
|
+
preAuthorizedCode?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface CNonceState extends StateType {
|
|
13
|
+
cNonce: string;
|
|
14
|
+
issuerState?: string;
|
|
15
|
+
preAuthorizedCode?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface URIState extends StateType {
|
|
18
|
+
issuerState?: string;
|
|
19
|
+
preAuthorizedCode?: string;
|
|
20
|
+
uri: string;
|
|
21
|
+
}
|
|
22
|
+
export interface IStateManager<T extends StateType> {
|
|
23
|
+
set(id: string, stateValue: T): Promise<void>;
|
|
24
|
+
get(id: string): Promise<T | undefined>;
|
|
25
|
+
has(id: string): Promise<boolean>;
|
|
26
|
+
delete(id: string): Promise<boolean>;
|
|
27
|
+
clearExpired(timestamp?: number): Promise<void>;
|
|
28
|
+
clearAll(): Promise<void>;
|
|
29
|
+
getAsserted(id: string): Promise<T>;
|
|
30
|
+
startCleanupRoutine(timeout?: number): Promise<void>;
|
|
31
|
+
stopCleanupRoutine(): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=StateManager.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StateManager.types.d.ts","sourceRoot":"","sources":["../../lib/types/StateManager.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AAE5E,MAAM,WAAW,SAAS;IACxB,SAAS,EAA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AAI,CAAC,CAAC;CACrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StateManager.types.js","sourceRoot":"","sources":["../../lib/types/StateManager.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare enum TokenErrorResponse {
|
|
2
|
+
invalid_request = "invalid_request",
|
|
3
|
+
invalid_grant = "invalid_grant",
|
|
4
|
+
invalid_client = "invalid_client",
|
|
5
|
+
invalid_scope = "invalid_scope"
|
|
6
|
+
}
|
|
7
|
+
export declare class TokenError extends Error {
|
|
8
|
+
private readonly _statusCode;
|
|
9
|
+
private readonly _responseError;
|
|
10
|
+
constructor(statusCode: number, responseError: TokenErrorResponse, message: string);
|
|
11
|
+
get statusCode(): number;
|
|
12
|
+
get responseError(): TokenErrorResponse;
|
|
13
|
+
getDescription(): string;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=Token.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Token.types.d.ts","sourceRoot":"","sources":["../../lib/types/Token.types.ts"],"names":[],"mappings":"AAAA,oBAAY,kBAAkB;IAC5B,eAAe,oBAAoB;IACnC,aAAa,kBAAkB;IAC/B,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;CAChC;AAED,qBAAa,UAAW,SAAQ,KAAK;IACnC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAqB;gBACxC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM;IAQlF,IAAI,UAAU,IAAI,MAAM,CAEvB;IACD,IAAI,aAAa,IAAI,kBAAkB,CAEtC;IAED,cAAc;CAGf"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TokenError = exports.TokenErrorResponse = void 0;
|
|
4
|
+
var TokenErrorResponse;
|
|
5
|
+
(function (TokenErrorResponse) {
|
|
6
|
+
TokenErrorResponse["invalid_request"] = "invalid_request";
|
|
7
|
+
TokenErrorResponse["invalid_grant"] = "invalid_grant";
|
|
8
|
+
TokenErrorResponse["invalid_client"] = "invalid_client";
|
|
9
|
+
TokenErrorResponse["invalid_scope"] = "invalid_scope";
|
|
10
|
+
})(TokenErrorResponse = exports.TokenErrorResponse || (exports.TokenErrorResponse = {}));
|
|
11
|
+
class TokenError extends Error {
|
|
12
|
+
constructor(statusCode, responseError, message) {
|
|
13
|
+
super(message);
|
|
14
|
+
this._statusCode = statusCode;
|
|
15
|
+
this._responseError = responseError;
|
|
16
|
+
// 👇️ because we are extending a built-in class
|
|
17
|
+
Object.setPrototypeOf(this, TokenError.prototype);
|
|
18
|
+
}
|
|
19
|
+
get statusCode() {
|
|
20
|
+
return this._statusCode;
|
|
21
|
+
}
|
|
22
|
+
get responseError() {
|
|
23
|
+
return this._responseError;
|
|
24
|
+
}
|
|
25
|
+
getDescription() {
|
|
26
|
+
return this.message;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.TokenError = TokenError;
|
|
30
|
+
//# sourceMappingURL=Token.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Token.types.js","sourceRoot":"","sources":["../../lib/types/Token.types.ts"],"names":[],"mappings":";;;AAAA,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,yDAAmC,CAAA;IACnC,qDAA+B,CAAA;IAC/B,uDAAiC,CAAA;IACjC,qDAA+B,CAAA;AACjC,CAAC,EALW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAK7B;AAED,MAAa,UAAW,SAAQ,KAAK;IAGnC,YAAY,UAAkB,EAAE,aAAiC,EAAE,OAAe;QAChF,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;QAEpC,gDAAgD;QAChD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;IACD,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IACD,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF;AArBD,gCAqBC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './Authorization.types';
|
|
2
|
+
export * from './CredentialIssuance.types';
|
|
3
|
+
export * from './Generic.types';
|
|
4
|
+
export * from './v1_0_08.types';
|
|
5
|
+
export * from './v1_0_09.types';
|
|
6
|
+
export * from './v1_0_11.types';
|
|
7
|
+
export * from './OAuth2ASMetadata';
|
|
8
|
+
export * from './OpenID4VCIErrors';
|
|
9
|
+
export * from './OpenID4VCIServerMetadata';
|
|
10
|
+
export * from './OpenID4VCIVersions.types';
|
|
11
|
+
export * from './StateManager.types';
|
|
12
|
+
export * from './Token.types';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Authorization.types"), exports);
|
|
18
|
+
__exportStar(require("./CredentialIssuance.types"), exports);
|
|
19
|
+
__exportStar(require("./Generic.types"), exports);
|
|
20
|
+
__exportStar(require("./v1_0_08.types"), exports);
|
|
21
|
+
__exportStar(require("./v1_0_09.types"), exports);
|
|
22
|
+
__exportStar(require("./v1_0_11.types"), exports);
|
|
23
|
+
__exportStar(require("./OAuth2ASMetadata"), exports);
|
|
24
|
+
__exportStar(require("./OpenID4VCIErrors"), exports);
|
|
25
|
+
__exportStar(require("./OpenID4VCIServerMetadata"), exports);
|
|
26
|
+
__exportStar(require("./OpenID4VCIVersions.types"), exports);
|
|
27
|
+
__exportStar(require("./StateManager.types"), exports);
|
|
28
|
+
__exportStar(require("./Token.types"), exports);
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,6DAA2C;AAC3C,kDAAgC;AAChC,kDAAgC;AAChC,kDAAgC;AAChC,kDAAgC;AAChC,qDAAmC;AACnC,qDAAmC;AACnC,6DAA2C;AAC3C,6DAA2C;AAC3C,uDAAqC;AACrC,gDAA8B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CredentialFormat } from '@sphereon/ssi-types';
|
|
2
|
+
import { ProofOfPossession } from './CredentialIssuance.types';
|
|
3
|
+
import { CredentialsSupportedDisplay, CredentialSupportedBrief, IssuerCredentialSubject, MetadataDisplay, NameAndLocale } from './Generic.types';
|
|
4
|
+
export interface CredentialRequestV1_0_08 {
|
|
5
|
+
type: string;
|
|
6
|
+
format: CredentialFormat;
|
|
7
|
+
proof: ProofOfPossession;
|
|
8
|
+
}
|
|
9
|
+
export interface IssuerMetadataV1_0_08 {
|
|
10
|
+
issuer?: string;
|
|
11
|
+
credential_endpoint: string;
|
|
12
|
+
credentials_supported: CredentialSupportedTypeV1_0_08;
|
|
13
|
+
credential_issuer?: {
|
|
14
|
+
display: NameAndLocale | NameAndLocale[];
|
|
15
|
+
};
|
|
16
|
+
authorization_server?: string;
|
|
17
|
+
token_endpoint?: string;
|
|
18
|
+
display?: MetadataDisplay[];
|
|
19
|
+
[x: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
export interface CredentialOfferPayloadV1_0_08 {
|
|
22
|
+
issuer: string;
|
|
23
|
+
credential_type: string[] | string;
|
|
24
|
+
'pre-authorized_code'?: string;
|
|
25
|
+
user_pin_required?: boolean | string;
|
|
26
|
+
op_state?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface CredentialSupportedTypeV1_0_08 {
|
|
29
|
+
[credentialType: string]: CredentialSupportedV1_0_08;
|
|
30
|
+
}
|
|
31
|
+
export interface CredentialSupportedV1_0_08 {
|
|
32
|
+
display?: CredentialsSupportedDisplay[];
|
|
33
|
+
formats: {
|
|
34
|
+
[credentialFormat: string]: CredentialSupportedBrief;
|
|
35
|
+
};
|
|
36
|
+
claims?: IssuerCredentialSub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D;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,CAAC,EAAE,2BAA2B,EAAE,CAAC;IACxC,OAAO,EAAE;QAEP,CAAC,gBAAgB,EAAE,MAAM,GAAG,wBAAwB,CAAC;KACtD,CAAC;IACF,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1_0_08.types.js","sourceRoot":"","sources":["../../lib/types/v1_0_08.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CommonAuthorizationRequest } from './Authorization.types';
|
|
2
|
+
import { CredentialOfferFormat } from './Generic.types';
|
|
3
|
+
export interface CredentialOfferV1_0_09 {
|
|
4
|
+
credential_offer: CredentialOfferPayloadV1_0_09;
|
|
5
|
+
}
|
|
6
|
+
export interface CredentialOfferPayloadV1_0_09 {
|
|
7
|
+
/**
|
|
8
|
+
* REQUIRED. The URL of the Credential Issuer, the Wallet is requested to obtain one or more Credentials from.
|
|
9
|
+
*/
|
|
10
|
+
issuer: string;
|
|
11
|
+
/**
|
|
12
|
+
* REQUIRED. A JSON array, where every entry is a JSON object or a JSON string. If the entry is an object,
|
|
13
|
+
* the object contains the data related to a certain credential type the Wallet MAY request.
|
|
14
|
+
* Each object MUST contain a format Claim determining the format of the credential to be requested and
|
|
15
|
+
* further parameters characterising the type of the credential to be requested as defined in Appendix E.
|
|
16
|
+
* If the entry is a string, the string value MUST be one of the id values in one of the objects in the
|
|
17
|
+
* credentials_supported Credential Issuer metadata parameter.
|
|
18
|
+
* When processing, the Wallet MUST resolve this string value to the respective object.
|
|
19
|
+
*/
|
|
20
|
+
credentials: (CredentialOfferFormat | string)[];
|
|
21
|
+
'pre-authorized_code'?: string;
|
|
22
|
+
user_pin_required?: boolean | string;
|
|
23
|
+
op_state?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface AuthorizationRequestV1_0_09 extends CommonAuthorizationRequest {
|
|
26
|
+
op_state?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function isAuthorizationRequestV1_0_09(request: CommonAuthorizationRequest): boolean;
|
|
29
|
+
//# sourceMappingURL=v1_0_09.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1_0_09.types.d.ts","sourceRoot":"","sources":["../../lib/types/v1_0_09.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,EAAE,6BAA6B,CAAC;CACjD;AAGD,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;;;;;OAQG;IACH,WAAW,EAAE,CAAC,qBAAqB,GAAG,MAAM,CAAC,EAAE,CAAC;IAChD,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,iBAAiB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,2BAA4B,SAAQ,0BAA0B;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAGD,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAE1F"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isAuthorizationRequestV1_0_09 = void 0;
|
|
4
|
+
// todo https://sphereon.atlassian.net/browse/VDX-185
|
|
5
|
+
function isAuthorizationRequestV1_0_09(request) {
|
|
6
|
+
return request && 'op_state' in request;
|
|
7
|
+
}
|
|
8
|
+
exports.isAuthorizationRequestV1_0_09 = isAuthorizationRequestV1_0_09;
|
|
9
|
+
//# sourceMappingURL=v1_0_09.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1_0_09.types.js","sourceRoot":"","sources":["../../lib/types/v1_0_09.types.ts"],"names":[],"mappings":";;;AAgCA,qDAAqD;AACrD,SAAgB,6BAA6B,CAAC,OAAmC;IAC/E,OAAO,OAAO,IAAI,UAAU,IAAI,OAAO,CAAC;AAC1C,CAAC;AAFD,sEAEC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { AuthorizationDetailsJwtVcJson, CommonAuthorizationRequest } from './Authorization.types';
|
|
2
|
+
import { CommonCredentialRequest, CredentialOfferFormat, CredentialRequestJwtVcJson, CredentialRequestJwtVcJsonLdAndLdpVc, Grant, IssuerCredentialDefinition } from './Generic.types';
|
|
3
|
+
export interface CredentialOfferV1_0_11 {
|
|
4
|
+
credential_offer?: CredentialOfferPayloadV1_0_11;
|
|
5
|
+
credential_offer_uri?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CommonCredentialOfferPayloadV1_0_11 {
|
|
8
|
+
/**
|
|
9
|
+
* REQUIRED. The URL of the Credential Issuer, the Wallet is requested to obtain one or more Credentials from.
|
|
10
|
+
*/
|
|
11
|
+
credential_issuer: string;
|
|
12
|
+
/**
|
|
13
|
+
* REQUIRED. A JSON array, where every entry is a JSON object or a JSON string. If the entry is an object,
|
|
14
|
+
* the object contains the data related to a certain credential type the Wallet MAY request.
|
|
15
|
+
* Each object MUST contain a format Claim determining the format of the credential to be requested and
|
|
16
|
+
* further parameters characterising the type of the credential to be requested as defined in Appendix E.
|
|
17
|
+
* If the entry is a string, the string value MUST be one of the id values in one of the objects in the
|
|
18
|
+
* credentials_supported Credential Issuer metadata parameter.
|
|
19
|
+
* When processing, the Wallet MUST resolve this string value to the respective object.
|
|
20
|
+
*/
|
|
21
|
+
credentials: (CredentialOfferFormat | string)[];
|
|
22
|
+
/**
|
|
23
|
+
* OPTIONAL. A JSON object indicating to the Wallet the Grant Types the Credential Issuer's AS is prepared
|
|
24
|
+
* to process for this credential offer. Every grant is represented by a key and an object.
|
|
25
|
+
* The key value is the Grant Type identifier, the object MAY contain parameters either determining the way
|
|
26
|
+
* the Wallet MUST use the particular grant and/or parameters the Wallet MUST send with the respective request(s).
|
|
27
|
+
* If grants is not present or empty, the Wallet MUST determine the Grant Types the Credential Issuer's AS supports
|
|
28
|
+
* using the respective metadata. When multiple grants are present, it's at the Wallet's discretion which one to use.
|
|
29
|
+
*/
|
|
30
|
+
grants?: Grant;
|
|
31
|
+
}
|
|
32
|
+
export interface CredentialOfferJwtVcJsonLdAndLdpVcV1_0_11 extends CommonCredentialOfferPayloadV1_0_11 {
|
|
33
|
+
/**
|
|
34
|
+
* REQUIRED. JSON object containing (and isolating) the detailed description of the credential type.
|
|
35
|
+
* This object MUST be processed using full JSON-LD processing. It consists of the following sub-claims:
|
|
36
|
+
* - @context: REQUIRED. JSON array as defined in Appendix E.1.3.2
|
|
37
|
+
* - types: REQUIRED. JSON array as defined in Appendix E.1.3.2.
|
|
38
|
+
* This claim contains the type values the Wallet shall request in the subsequent Credential Request
|
|
39
|
+
*/
|
|
40
|
+
credential_definition: IssuerCredentialDefinition;
|
|
41
|
+
}
|
|
42
|
+
export type CredentialOfferJwtVcJsonV1_0_11 = CommonCredentialOfferPayloadV1_0_11;
|
|
43
|
+
export type CredentialOfferPayloadV1_0_11 = CommonCredentialOfferPayloadV1_0_11 & (CredentialOfferJwtVcJsonLdAndLdpVcV1_0_11 | CredentialOfferJwtVcJsonV1_0_11);
|
|
44
|
+
export type CredentialRequestV1_0_11 = CommonCredentialRequest & (CredentialRequestJwtVcJson | CredentialRequestJwtVcJsonLdAndLdpVc);
|
|
45
|
+
export interface AuthorizationRequestV1_0_11 extends AuthorizationDetailsJwtVcJson, AuthorizationDetailsJwtVcJson {
|
|
46
|
+
issuer_state?: string;
|
|
47
|
+
}
|
|
48
|
+
export declare function isAuthorizationRequestV1_0_11(request: CommonAuthorizationRequest): boolean;
|
|
49
|
+
//# sourceMappingURL=v1_0_11.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1_0_11.types.d.ts","sourceRoot":"","sources":["../../lib/types/v1_0_11.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAClG,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,oCAAoC,EACpC,KAAK,EACL,0BAA0B,EAC3B,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,CAAC,EAAE,6BAA6B,CAAC;IACjD,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,mCAAmC;IAClD;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;;;;;;;OAQG;IACH,WAAW,EAAE,CAAC,qBAAqB,GAAG,MAAM,CAAC,EAAE,CAAC;IAChD;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC;CAChB;AAED,MAAM,WAAW,yCAA0C,SAAQ,mCAAmC;IACpG;;;;;;OAMG;IACH,qBAAqB,EAAE,0BAA0B,CAAC;CACnD;AAED,MAAM,MAAM,+BAA+B,GAAG,mCAAmC,CAAC;AAElF,MAAM,MAAM,6BAA6B,GAAG,mCAAmC,GAC7E,CAAC,yCAAyC,GAAG,+BAA+B,CAAC,CAAC;AAEhF,MAAM,MAAM,wBAAwB,GAAG,uBAAuB,GAAG,CAAC,0BAA0B,GAAG,oCAAoC,CAAC,CAAC;AAErI,MAAM,WAAW,2BAA4B,SAAQ,6BAA6B,EAAE,6BAA6B;IAC/G,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAGD,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAE1F"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isAuthorizationRequestV1_0_11 = void 0;
|
|
4
|
+
// todo https://sphereon.atlassian.net/browse/VDX-185
|
|
5
|
+
function isAuthorizationRequestV1_0_11(request) {
|
|
6
|
+
return request && 'issuer_state' in request;
|
|
7
|
+
}
|
|
8
|
+
exports.isAuthorizationRequestV1_0_11 = isAuthorizationRequestV1_0_11;
|
|
9
|
+
//# sourceMappingURL=v1_0_11.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v1_0_11.types.js","sourceRoot":"","sources":["../../lib/types/v1_0_11.types.ts"],"names":[],"mappings":";;;AAgEA,qDAAqD;AACrD,SAAgB,6BAA6B,CAAC,OAAmC;IAC/E,OAAO,OAAO,IAAI,cAAc,IAAI,OAAO,CAAC;AAC9C,CAAC;AAFD,sEAEC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { determineSpecVersionFromURI } from '../functions';
|
|
2
|
+
import { OpenId4VCIVersion } from '../types';
|
|
3
|
+
|
|
4
|
+
export const UNIT_TEST_TIMEOUT = 30000;
|
|
5
|
+
|
|
6
|
+
describe('CredentialOfferUtil should', () => {
|
|
7
|
+
const INITIATE_QR_V8 =
|
|
8
|
+
'openid-initiate-issuance://?' +
|
|
9
|
+
'issuer=https%3A%2F%2Fissuer.research.identiproof.io&' +
|
|
10
|
+
'credential_type=OpenBadgeCredentialUrl&' +
|
|
11
|
+
'pre-authorized_code=4jLs9xZHEfqcoow0kHE7d1a8hUk6Sy-5bVSV2MqBUGUgiFFQi-ImL62T-FmLIo8hKA1UdMPH0lM1xAgcFkJfxIw9L-lI3mVs0hRT8YVwsEM1ma6N3wzuCdwtMU4bcwKp&' +
|
|
12
|
+
'user_pin_required=true';
|
|
13
|
+
|
|
14
|
+
const INITIATE_QR_DATA_MIXED_V9 =
|
|
15
|
+
'openid-initiate-issuance://?' +
|
|
16
|
+
'credential_offer=%7B%22credential_issuer%22:%22https://credential-issuer.example.com%22,%22credentials%22:%5B%7B%22format%22:%22jwt_vc_json%22,%22types%22:%5B%22VerifiableCredential%22,%22UniversityDegreeCredential%22%5D%7D%5D,%22issuer_state%22:%22eyJhbGciOiJSU0Et...FYUaBy%22%7D';
|
|
17
|
+
|
|
18
|
+
const CREDENTIAL_OFFER_QR_V11 =
|
|
19
|
+
'openid-credential-offer://?' +
|
|
20
|
+
'credential_offer=%7B%22credential_issuer%22:%22https://credential-issuer.example.com%22,%22credentials%22:%5B%7B%22format%22:%22jwt_vc_json%22,%22types%22:%5B%22VerifiableCredential%22,%22UniversityDegreeCredential%22%5D%7D%5D,%22issuer_state%22:%22eyJhbGciOiJSU0Et...FYUaBy%22%7D';
|
|
21
|
+
|
|
22
|
+
it(
|
|
23
|
+
'get version 8 with sample URL',
|
|
24
|
+
async () => {
|
|
25
|
+
expect(determineSpecVersionFromURI(INITIATE_QR_V8)).toEqual(OpenId4VCIVersion.VER_1_0_08);
|
|
26
|
+
},
|
|
27
|
+
UNIT_TEST_TIMEOUT
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
it(
|
|
31
|
+
'get version 11 with sample URL',
|
|
32
|
+
async () => {
|
|
33
|
+
expect(determineSpecVersionFromURI(CREDENTIAL_OFFER_QR_V11)).toEqual(OpenId4VCIVersion.VER_1_0_11);
|
|
34
|
+
},
|
|
35
|
+
UNIT_TEST_TIMEOUT
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
it(
|
|
39
|
+
'get exception for mixed attributes in URL',
|
|
40
|
+
async () => {
|
|
41
|
+
expect(() => determineSpecVersionFromURI(INITIATE_QR_DATA_MIXED_V9)).toThrow(
|
|
42
|
+
Error("Invalid param. Some keys have been used from version: 1008 version while 'credential_issuer' is used from version: 1011")
|
|
43
|
+
);
|
|
44
|
+
},
|
|
45
|
+
UNIT_TEST_TIMEOUT
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
it(
|
|
49
|
+
'get version 11 as default value',
|
|
50
|
+
async () => {
|
|
51
|
+
expect(determineSpecVersionFromURI('test://uri')).toEqual(OpenId4VCIVersion.VER_1_0_11);
|
|
52
|
+
},
|
|
53
|
+
UNIT_TEST_TIMEOUT
|
|
54
|
+
);
|
|
55
|
+
});
|