@sphereon/oid4vci-common
Advanced tools
Comparing version 0.4.1-unstable.304 to 0.4.1-unstable.305
@@ -92,5 +92,5 @@ import { W3CVerifiableCredential } from '@sphereon/ssi-types'; | ||
} | ||
export interface ProofOfPossessionCallbacks { | ||
export interface ProofOfPossessionCallbacks<DIDDoc> { | ||
signCallback: JWTSignerCallback; | ||
verifyCallback?: JWTVerifyCallback; | ||
verifyCallback?: JWTVerifyCallback<DIDDoc>; | ||
} | ||
@@ -128,3 +128,3 @@ export declare enum Alg { | ||
iss?: string; | ||
aud?: string; | ||
aud?: string | string[]; | ||
iat?: number; | ||
@@ -137,6 +137,15 @@ nonce?: string; | ||
export type JWTSignerCallback = (jwt: Jwt, kid?: string) => Promise<string>; | ||
export type JWTVerifyCallback = (args: { | ||
export type JWTVerifyCallback<DIDDoc> = (args: { | ||
jwt: string; | ||
kid?: string; | ||
}) => Promise<Jwt>; | ||
}) => Promise<JwtVerifyResult<DIDDoc>>; | ||
export interface JwtVerifyResult<DIDDoc> { | ||
jwt: Jwt; | ||
kid?: string; | ||
alg: string; | ||
did?: string; | ||
didDocument?: DIDDoc; | ||
x5c?: string; | ||
jwk?: BaseJWK; | ||
} | ||
//# sourceMappingURL=CredentialIssuance.types.d.ts.map |
@@ -9,2 +9,4 @@ export declare const BAD_PARAMS = "Wrong parameters provided"; | ||
export declare const KID_JWK_X5C_ERROR = "Only one must be present: kid, jwk or x5c"; | ||
export declare const KID_DID_NO_DID_ERROR = "A DID value needs to be returned when kid is present"; | ||
export declare const DID_NO_DIDDOC_ERROR = "A DID Document needs to be resolved when a DID is encountered"; | ||
export declare const AUD_ERROR = "aud must be the URL of the credential issuer"; | ||
@@ -11,0 +13,0 @@ export declare const IAT_ERROR = "iat must be the time at which the proof was issued"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
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; | ||
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.DID_NO_DIDDOC_ERROR = exports.KID_DID_NO_DID_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; | ||
const CredentialIssuance_types_1 = require("./CredentialIssuance.types"); | ||
@@ -13,2 +13,4 @@ exports.BAD_PARAMS = 'Wrong parameters provided'; | ||
exports.KID_JWK_X5C_ERROR = 'Only one must be present: kid, jwk or x5c'; | ||
exports.KID_DID_NO_DID_ERROR = 'A DID value needs to be returned when kid is present'; | ||
exports.DID_NO_DIDDOC_ERROR = 'A DID Document needs to be resolved when a DID is encountered'; | ||
exports.AUD_ERROR = 'aud must be the URL of the credential issuer'; | ||
@@ -15,0 +17,0 @@ exports.IAT_ERROR = 'iat must be the time at which the proof was issued'; |
@@ -111,5 +111,5 @@ import { W3CVerifiableCredential } from '@sphereon/ssi-types'; | ||
export interface ProofOfPossessionCallbacks { | ||
export interface ProofOfPossessionCallbacks<DIDDoc> { | ||
signCallback: JWTSignerCallback; | ||
verifyCallback?: JWTVerifyCallback; | ||
verifyCallback?: JWTVerifyCallback<DIDDoc>; | ||
} | ||
@@ -159,3 +159,3 @@ | ||
iss?: string; // REQUIRED (string). The value of this claim MUST be the client_id of the client making the credential request. | ||
aud?: string; // REQUIRED (string). The value of this claim MUST be the issuer URL of credential issuer. | ||
aud?: string | string[]; // REQUIRED (string). The value of this claim MUST be the issuer URL of credential issuer. | ||
iat?: number; // REQUIRED (number). The value of this claim MUST be the time at which the proof was issued using the syntax defined in [RFC7519]. | ||
@@ -169,2 +169,11 @@ nonce?: string; // REQUIRED (string). The value type of this claim MUST be a string, where the value is a c_nonce provided by the credential issuer. //TODO: Marked as required not present in NGI flow | ||
export type JWTSignerCallback = (jwt: Jwt, kid?: string) => Promise<string>; | ||
export type JWTVerifyCallback = (args: { jwt: string; kid?: string }) => Promise<Jwt>; | ||
export type JWTVerifyCallback<DIDDoc> = (args: { jwt: string; kid?: string }) => Promise<JwtVerifyResult<DIDDoc>>; | ||
export interface JwtVerifyResult<DIDDoc> { | ||
jwt: Jwt; | ||
kid?: string; | ||
alg: string; | ||
did?: string; | ||
didDocument?: DIDDoc; | ||
x5c?: string; | ||
jwk?: BaseJWK; | ||
} |
@@ -11,2 +11,4 @@ import { Alg } from './CredentialIssuance.types'; | ||
export const KID_JWK_X5C_ERROR = 'Only one must be present: kid, jwk or x5c'; | ||
export const KID_DID_NO_DID_ERROR = 'A DID value needs to be returned when kid is present'; | ||
export const DID_NO_DIDDOC_ERROR = 'A DID Document needs to be resolved when a DID is encountered'; | ||
export const AUD_ERROR = 'aud must be the URL of the credential issuer'; | ||
@@ -13,0 +15,0 @@ export const IAT_ERROR = 'iat must be the time at which the proof was issued'; |
{ | ||
"name": "@sphereon/oid4vci-common", | ||
"version": "0.4.1-unstable.304+224567c", | ||
"version": "0.4.1-unstable.305+62dd947", | ||
"description": "OpenID 4 Verifiable Credential Issuance Common Types", | ||
@@ -48,3 +48,3 @@ "source": "lib/index.ts", | ||
}, | ||
"gitHead": "224567cce28babdd0a0f28f01d6894365f924ef1" | ||
"gitHead": "62dd947d0e09360719e6f704db33d766dff2363a" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
238207
3536