Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support signing @direction w/LinkedDataSignature. #188

Merged
merged 2 commits into from
Dec 17, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
node-version: [16.x]
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# jsonld-signatures ChangeLog

## 11.5.0 - 2024-12-dd

### Added
- Add support for signing `@direction` in documents when using the
base `LinkedDataSignature` class. Other cryptosuites may already
support `@direction` if they were not using this class.

## 11.4.0 - 2024-12-15

### Added
Expand Down
5 changes: 3 additions & 2 deletions lib/suites/LinkedDataSignature.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,9 +464,10 @@ function _processSignatureParams({key, signer, verifier}) {

async function _canonize(input, options) {
// convert to RDF dataset and do canonicalization
const opts = {...options};
const opts = {
rdfDirection: 'i18n-datatype', ...options, produceGeneralizedRdf: false,
};
delete opts.format;
opts.produceGeneralizedRdf = false;
const dataset = await jsonld.toRDF(input, opts);
return rdfCanonize.canonize(dataset, options);
}
Loading