@unumid/server-sdk
Advanced tools
Comparing version 3.21.1 to 3.21.2
@@ -58,2 +58,3 @@ "use strict"; | ||
exports.validateNoPresentationParams = function (noPresentation) { | ||
logger_1.default.debug('Validating a NoPresentation input'); | ||
var type = noPresentation.type, proof = noPresentation.proof, presentationRequestId = noPresentation.presentationRequestId, verifiableCredential = noPresentation.verifiableCredential, verifierDid = noPresentation.verifierDid; | ||
@@ -82,2 +83,3 @@ if (!type) { | ||
validateProof_1.validateProof(proof); | ||
logger_1.default.debug('NoPresentation input is validated'); | ||
return noPresentation; | ||
@@ -144,2 +146,3 @@ }; | ||
}; | ||
logger_1.default.debug("NoPresentation is verified: " + isVerified + ". " + message); | ||
return [2 /*return*/, result]; | ||
@@ -146,0 +149,0 @@ case 5: |
@@ -169,2 +169,3 @@ "use strict"; | ||
case 0: | ||
logger_1.default.debug("Verifying the presentation request " + presentationRequest.uuid); | ||
if (!presentationRequest.proof) { | ||
@@ -191,2 +192,3 @@ throw new error_1.CustError(400, 'Invalid PresentationRequest: proof is required.'); | ||
if (!isVerified) { | ||
logger_1.default.warn("Presentation request " + presentationRequest.uuid + " signature can not be verified."); | ||
result_1 = { | ||
@@ -207,2 +209,3 @@ authToken: authToken, | ||
}; | ||
logger_1.default.debug("Presentation request " + presentationRequest.uuid + " signature verified."); | ||
return [2 /*return*/, result]; | ||
@@ -209,0 +212,0 @@ } |
@@ -167,2 +167,3 @@ "use strict"; | ||
var validatePresentation = function (presentation) { | ||
logger_1.default.debug('Validating a Presentation input'); | ||
var type = presentation.type, verifiableCredential = presentation.verifiableCredential, proof = presentation.proof, presentationRequestId = presentation.presentationRequestId, verifierDid = presentation.verifierDid, context = presentation.context; | ||
@@ -208,2 +209,3 @@ var retObj = {}; | ||
presentation.proof = validateProof_1.validateProof(proof); | ||
logger_1.default.debug('Presentation input is validated'); | ||
return presentation; | ||
@@ -284,2 +286,3 @@ }; | ||
authToken_1 = _c.sent(); | ||
logger_1.default.warn("Presentation verifier not matching input verifier. " + message); | ||
result_1 = { | ||
@@ -352,2 +355,3 @@ authToken: authToken_1, | ||
}; | ||
logger_1.default.warn("Presentation signature can not be verified. " + message); | ||
return [2 /*return*/, result_3]; | ||
@@ -407,2 +411,3 @@ case 9: | ||
}; | ||
logger_1.default.warn("Presentation credentials are not valid. " + credentialInvalidMessage); | ||
return [2 /*return*/, result_4]; | ||
@@ -420,2 +425,3 @@ case 16: | ||
}; | ||
logger_1.default.debug("Presentation is verify: " + isVerified); | ||
return [2 /*return*/, result]; | ||
@@ -422,0 +428,0 @@ case 18: |
{ | ||
"name": "@unumid/server-sdk", | ||
"version": "3.21.1", | ||
"version": "3.21.2", | ||
"main": "build/index.js", | ||
@@ -5,0 +5,0 @@ "repository": "git@github.com:UnumID/Server-SDK-TypeScript.git", |
@@ -20,2 +20,4 @@ | ||
export const validateNoPresentationParams = (noPresentation: PresentationPb): PresentationPb => { | ||
logger.debug('Validating a NoPresentation input'); | ||
const { | ||
@@ -59,2 +61,3 @@ type, | ||
logger.debug('NoPresentation input is validated'); | ||
return noPresentation; | ||
@@ -130,2 +133,4 @@ }; | ||
logger.debug(`NoPresentation is verified: ${isVerified}. ${message}`); | ||
return result; | ||
@@ -132,0 +137,0 @@ } catch (e) { |
@@ -143,2 +143,4 @@ | ||
async function verifyPresentationRequest (authorization: string, presentationRequest: PresentationRequestPb): Promise<UnumDto<VerifiedStatus>> { | ||
logger.debug(`Verifying the presentation request ${presentationRequest.uuid}`); | ||
if (!presentationRequest.proof) { | ||
@@ -170,2 +172,4 @@ throw new CustError(400, 'Invalid PresentationRequest: proof is required.'); | ||
if (!isVerified) { | ||
logger.warn(`Presentation request ${presentationRequest.uuid} signature can not be verified.`); | ||
const result: UnumDto<VerifiedStatus> = { | ||
@@ -187,2 +191,4 @@ authToken, | ||
}; | ||
logger.debug(`Presentation request ${presentationRequest.uuid} signature verified.`); | ||
return result; | ||
@@ -189,0 +195,0 @@ } |
@@ -149,2 +149,3 @@ import { omit } from 'lodash'; | ||
const validatePresentation = (presentation: PresentationPb): PresentationPb => { | ||
logger.debug('Validating a Presentation input'); | ||
const { type, verifiableCredential, proof, presentationRequestId, verifierDid, context } = presentation; | ||
@@ -201,2 +202,3 @@ let retObj: JSONObj = {}; | ||
logger.debug('Presentation input is validated'); | ||
return presentation; | ||
@@ -285,2 +287,3 @@ }; | ||
logger.warn(`Presentation verifier not matching input verifier. ${message}`); | ||
const result: UnumDto<VerifiedStatus> = { | ||
@@ -307,5 +310,2 @@ authToken, | ||
// Verify the data given. As of now only one secp256r1 public key is expected. | ||
// In future, there is a possibility that, more than one secp256r1 public key can be there for a given DID. | ||
// This scenario will be handled later. | ||
let isPresentationVerified = false; | ||
@@ -358,2 +358,4 @@ try { | ||
}; | ||
logger.warn(`Presentation signature can not be verified. ${message}`); | ||
return result; | ||
@@ -410,2 +412,4 @@ } | ||
}; | ||
logger.warn(`Presentation credentials are not valid. ${credentialInvalidMessage}`); | ||
return result; | ||
@@ -425,2 +429,3 @@ } | ||
logger.debug(`Presentation is verify: ${isVerified}`); | ||
return result; | ||
@@ -427,0 +432,0 @@ } catch (error) { |
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
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
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
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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1413547
16728