xml-crypto
Advanced tools
Comparing version 3.1.0 to 3.2.0
# Changelog | ||
## 3.x (2023-07-14) | ||
### 🚀 Minor Changes | ||
- [**enhancement**] Exports C14nCanonicalization, ExclusiveCanonicalization [#335](https://github.com/node-saml/xml-crypto/pull/335) | ||
### 🔗 Dependencies | ||
- [**dependencies**] Update gren for better support for branches [#339](https://github.com/node-saml/xml-crypto/pull/339) | ||
- [**dependencies**] Bump @xmldom/xmldom [#333](https://github.com/node-saml/xml-crypto/pull/333) | ||
### 🐛 Bug Fixes | ||
- [**bug**] Fix test case error [#338](https://github.com/node-saml/xml-crypto/pull/338) | ||
- [**bug**] Fix missing `index.js` on release [#337](https://github.com/node-saml/xml-crypto/pull/337) | ||
- [**bug**] Fix issue in case when namespace has no prefix [#329](https://github.com/node-saml/xml-crypto/pull/329) | ||
### ⚙️ Technical Tasks | ||
- [**chore**] Don't force `master` branch when generating changelog [#341](https://github.com/node-saml/xml-crypto/pull/341) | ||
- [**chore**] Ignore unnecessary files in the release [#334](https://github.com/node-saml/xml-crypto/pull/334) | ||
--- | ||
## v3.1.0 (2023-06-05) | ||
@@ -4,0 +28,0 @@ |
@@ -0,0 +0,0 @@ // Type definitions for @node-saml/xml-crypto |
var select = require("xpath").select; | ||
module.exports = require("./lib/signed-xml"); | ||
module.exports.C14nCanonicalization = require("./lib/c14n-canonicalization").C14nCanonicalization; | ||
module.exports.C14nCanonicalizationWithComments = require("./lib/c14n-canonicalization").C14nCanonicalizationWithComments; | ||
module.exports.ExclusiveCanonicalization = require("./lib/exclusive-canonicalization").ExclusiveCanonicalization; | ||
module.exports.ExclusiveCanonicalizationWithComments = require("./lib/exclusive-canonicalization").ExclusiveCanonicalizationWithComments; | ||
module.exports.xpath = function (node, xpath) { | ||
return select(xpath, node); | ||
}; |
@@ -170,3 +170,3 @@ /* jshint laxcomma: true */ | ||
p = nsListToRender[a]; | ||
res.push(" xmlns:", p.prefix, '="', p.namespaceURI, '"'); | ||
res.push(" xmlns", p.prefix ? ":" + p.prefix : "", '="', p.namespaceURI, '"'); | ||
} | ||
@@ -173,0 +173,0 @@ |
@@ -0,0 +0,0 @@ var xpath = require("xpath"); |
@@ -0,0 +0,0 @@ /* jshint laxcomma: true */ |
@@ -0,0 +0,0 @@ var StringKeyInfo = require("./string-key-info"), |
@@ -215,18 +215,7 @@ var xpath = require("xpath"), | ||
var returningNs = []; | ||
var subsetAttributes = docSubset[0].attributes; | ||
for (var j = 0; j < ancestorNsWithoutDuplicate.length; j++) { | ||
var isUnique = true; | ||
for (var k = 0; k < subsetAttributes.length; k++) { | ||
var nodeName = subsetAttributes[k].nodeName; | ||
if (nodeName.search(/^xmlns:/) === -1) continue; | ||
var prefix = nodeName.replace(/^xmlns:/, ""); | ||
if (ancestorNsWithoutDuplicate[j].prefix === prefix) { | ||
isUnique = false; | ||
break; | ||
} | ||
const subsetNsPrefix = findNSPrefix(docSubset[0]); | ||
for (const ancestorNs of ancestorNsWithoutDuplicate) { | ||
if (ancestorNs.prefix !== subsetNsPrefix) { | ||
returningNs.push(ancestorNs); | ||
} | ||
if (isUnique) { | ||
returningNs.push(ancestorNsWithoutDuplicate[j]); | ||
} | ||
} | ||
@@ -251,5 +240,5 @@ | ||
var attr = parent.attributes[i]; | ||
if (attr && attr.nodeName && attr.nodeName.search(/^xmlns:/) !== -1) { | ||
if (attr && attr.nodeName && attr.nodeName.search(/^xmlns:?/) !== -1) { | ||
nsArray.push({ | ||
prefix: attr.nodeName.replace(/^xmlns:/, ""), | ||
prefix: attr.nodeName.replace(/^xmlns:?/, ""), | ||
namespaceURI: attr.nodeValue, | ||
@@ -264,2 +253,13 @@ }); | ||
function findNSPrefix(subset) { | ||
const subsetAttributes = subset.attributes; | ||
for (let k = 0; k < subsetAttributes.length; k++) { | ||
const nodeName = subsetAttributes[k].nodeName; | ||
if (nodeName.search(/^xmlns:?/) !== -1) { | ||
return nodeName.replace(/^xmlns:?/, ""); | ||
} | ||
} | ||
return subset.prefix || ""; | ||
} | ||
/** | ||
@@ -266,0 +266,0 @@ * Xml signature implementation |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ var select = require("xpath").select; |
{ | ||
"name": "xml-crypto", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"private": false, | ||
@@ -22,9 +22,14 @@ "description": "Xml digital signature and encryption library for Node.js", | ||
], | ||
"main": "./index.js", | ||
"types": "./index.d.ts", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"files": [ | ||
"CHANGELOG.md", | ||
"index.d.ts", | ||
"lib" | ||
], | ||
"directories": { | ||
"lib": "./lib" | ||
"lib": "lib" | ||
}, | ||
"scripts": { | ||
"changelog": "gren changelog --override --generate --head master", | ||
"changelog": "gren changelog --override --generate", | ||
"lint": "eslint --ext .js \"**/*.js\" --cache && npm run prettier-check", | ||
@@ -39,7 +44,7 @@ "lint:fix": "eslint --ext .js --fix \"**/*.js\" && npm run prettier-format", | ||
"dependencies": { | ||
"@xmldom/xmldom": "0.8.7", | ||
"@xmldom/xmldom": "^0.8.8", | ||
"xpath": "0.0.32" | ||
}, | ||
"devDependencies": { | ||
"@cjbarth/github-release-notes": "^4.0.0", | ||
"@cjbarth/github-release-notes": "^4.1.0", | ||
"@prettier/plugin-xml": "^2.2.0", | ||
@@ -46,0 +51,0 @@ "ejs": "3.1.9", |
@@ -0,0 +0,0 @@ # xml-crypto |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
92475
13
1800
+ Added@xmldom/xmldom@0.8.10(transitive)
- Removed@xmldom/xmldom@0.8.7(transitive)
Updated@xmldom/xmldom@^0.8.8