Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @digitalcredentials/vc ChangeLog

## 10.0.1

### Changed
- Add a parameter to `createPresentation` to allow VC verification to be optional.
Addresses issue #32. Does not change current default behavior.

## 10.0.0 - 2025-04-30

### Changed
Expand Down
6 changes: 4 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@
* @param {string|Date} [options.now] - A string representing date time in
* ISO 8601 format or an instance of Date. Defaults to current date time.
* @param {number} [options.version = 2.0] - The VC context version to use.
* @param {boolean} [options.verify=true]

Check warning on line 422 in lib/index.js

View workflow job for this annotation

GitHub Actions / lint (20.x)

Missing JSDoc @param "options.verify" description
*
* @throws {TypeError} If verifiableCredential param is missing.
* @throws {Error} If the credential (or the presentation params) are missing
Expand All @@ -428,7 +429,7 @@
* VerifiablePresentation.
*/
export function createPresentation({
verifiableCredential, id, holder, now, version = 2.0
verifiableCredential, id, holder, now, version = 2.0, verify = true
} = {}) {
const initialContext = (version === 2.0) ? CREDENTIALS_CONTEXT_V2_URL :
CREDENTIALS_CONTEXT_V1_URL;
Expand All @@ -440,7 +441,8 @@
const credentials = [].concat(verifiableCredential);
// ensure all credentials are valid
for(const credential of credentials) {
_checkCredential({credential, now});
_checkCredential(
{credential, now, mode: verify ? 'verify' : 'do not force verify'});
}
presentation.verifiableCredential = credentials;
}
Expand Down