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

Bump prettier from 2.8.8 to 3.0.0 #350

Merged
merged 2 commits into from
Jul 21, 2023
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 .grenrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module.exports = {
release: function (placeholders) {
placeholders.body = placeholders.body.replace(
"*No changelog for this release.*",
"\n_No changelog for this release._"
"\n_No changelog for this release._",
);
return `## ${placeholders.release} (${placeholders.date})\n${placeholders.body}`;
},
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ var doc = new dom().parseFromString(xml);

var signature = select(
doc,
"//*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']"
"//*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']",
)[0];
var sig = new SignedXml({ publicCert: fs.readFileSync("client_public.pem") });
sig.loadSignature(signature);
Expand Down
2 changes: 1 addition & 1 deletion example/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function validateXml(xml, key) {
const doc = new dom().parseFromString(xml);
const signature = select(
"/*/*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']",
doc
doc,
)[0];
const sig = new SignedXml();
sig.publicCert = key;
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"lcov": "^1.16.0",
"mocha": "^10.2.0",
"nyc": "^15.1.0",
"prettier": "^2.8.8",
"prettier": "^3.0.0",
"prettier-plugin-packagejson": "^2.4.5",
"release-it": "^16.1.3",
"source-map-support": "^0.5.21",
Expand Down
10 changes: 5 additions & 5 deletions src/c14n-canonicalization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class C14nCanonicalization implements CanonicalizationOrTransformationAlg
prefixesInScope: string[],
defaultNs: string,
defaultNsForPrefix: string,
ancestorNamespaces: NamespacePrefix[]
ancestorNamespaces: NamespacePrefix[],
): RenderedNamespace {
let i;
let attr;
Expand Down Expand Up @@ -161,7 +161,7 @@ export class C14nCanonicalization implements CanonicalizationOrTransformationAlg
return ` xmlns:${attr.prefix}="${attr.namespaceURI}"`;
}
return ` xmlns="${attr.namespaceURI}"`;
})
}),
);

return { rendered: res.join(""), newDefaultNs };
Expand All @@ -182,14 +182,14 @@ export class C14nCanonicalization implements CanonicalizationOrTransformationAlg
prefixesInScope,
defaultNs,
defaultNsForPrefix,
ancestorNamespaces
ancestorNamespaces,
);
const res = ["<", node.tagName, ns.rendered, this.renderAttrs(node), ">"];

for (i = 0; i < node.childNodes.length; ++i) {
pfxCopy = prefixesInScope.slice(0);
res.push(
this.processInner(node.childNodes[i], pfxCopy, ns.newDefaultNs, defaultNsForPrefix, [])
this.processInner(node.childNodes[i], pfxCopy, ns.newDefaultNs, defaultNsForPrefix, []),
);
}

Expand Down Expand Up @@ -260,7 +260,7 @@ export class C14nCanonicalization implements CanonicalizationOrTransformationAlg
prefixesInScope,
defaultNs,
defaultNsForPrefix,
ancestorNamespaces
ancestorNamespaces,
);
return res;
}
Expand Down
8 changes: 4 additions & 4 deletions src/enveloped-signature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class EnvelopedSignature implements CanonicalizationOrTransformationAlgor
if (null == options.signatureNode) {
const signature = xpath.select1(
"./*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']",
node
node,
);
if (xpath.isNodeLike(signature) && signature.parentNode) {
signature.parentNode.removeChild(signature);
Expand All @@ -22,19 +22,19 @@ export class EnvelopedSignature implements CanonicalizationOrTransformationAlgor
const signatureNode = options.signatureNode;
const expectedSignatureValue = xpath.select1(
".//*[local-name(.)='SignatureValue']/text()",
signatureNode
signatureNode,
);
if (xpath.isTextNode(expectedSignatureValue)) {
const expectedSignatureValueData = expectedSignatureValue.data;

const signatures = xpath.select(
".//*[local-name(.)='Signature' and namespace-uri(.)='http://www.w3.org/2000/09/xmldsig#']",
node
node,
);
for (const nodeSignature of Array.isArray(signatures) ? signatures : []) {
const signatureValue = xpath.select1(
".//*[local-name(.)='SignatureValue']/text()",
nodeSignature
nodeSignature,
);
if (xpath.isTextNode(signatureValue)) {
const signatureValueData = signatureValue.data;
Expand Down
18 changes: 9 additions & 9 deletions src/exclusive-canonicalization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class ExclusiveCanonicalization implements CanonicalizationOrTransformati
prefixesInScope,
defaultNs,
defaultNsForPrefix,
inclusiveNamespacesPrefixList: string[]
inclusiveNamespacesPrefixList: string[],
) {
let i;
let attr;
Expand All @@ -109,7 +109,7 @@ export class ExclusiveCanonicalization implements CanonicalizationOrTransformati
!isPrefixInScope(
prefixesInScope,
node.prefix,
node.namespaceURI || defaultNsForPrefix[node.prefix]
node.namespaceURI || defaultNsForPrefix[node.prefix],
)
) {
nsListToRender.push({
Expand Down Expand Up @@ -172,7 +172,7 @@ export class ExclusiveCanonicalization implements CanonicalizationOrTransformati
prefixesInScope,
defaultNs,
defaultNsForPrefix,
inclusiveNamespacesPrefixList: string[]
inclusiveNamespacesPrefixList: string[],
) {
if (xpath.isComment(node)) {
return this.renderComment(node);
Expand All @@ -188,7 +188,7 @@ export class ExclusiveCanonicalization implements CanonicalizationOrTransformati
prefixesInScope,
defaultNs,
defaultNsForPrefix,
inclusiveNamespacesPrefixList
inclusiveNamespacesPrefixList,
);
const res = ["<", node.tagName, ns.rendered, this.renderAttrs(node), ">"];

Expand All @@ -200,8 +200,8 @@ export class ExclusiveCanonicalization implements CanonicalizationOrTransformati
pfxCopy,
ns.newDefaultNs,
defaultNsForPrefix,
inclusiveNamespacesPrefixList
)
inclusiveNamespacesPrefixList,
),
);
}

Expand Down Expand Up @@ -271,7 +271,7 @@ export class ExclusiveCanonicalization implements CanonicalizationOrTransformati
if (CanonicalizationMethod.length !== 0) {
const inclusiveNamespaces = utils.findChilds(
CanonicalizationMethod[0],
"InclusiveNamespaces"
"InclusiveNamespaces",
);
if (inclusiveNamespaces.length !== 0) {
inclusiveNamespacesPrefixList = (
Expand All @@ -292,7 +292,7 @@ export class ExclusiveCanonicalization implements CanonicalizationOrTransformati
node.setAttributeNS(
"http://www.w3.org/2000/xmlns/",
`xmlns:${prefix}`,
ancestorNamespace.namespaceURI
ancestorNamespace.namespaceURI,
);
}
});
Expand All @@ -305,7 +305,7 @@ export class ExclusiveCanonicalization implements CanonicalizationOrTransformati
[],
defaultNs,
defaultNsForPrefix,
inclusiveNamespacesPrefixList
inclusiveNamespacesPrefixList,
);
return res;
}
Expand Down
16 changes: 8 additions & 8 deletions src/signature-algorithms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class RsaSha1 implements SignatureAlgorithm {
const res = signer.sign(privateKey, "base64");

return res;
}
},
);

verifySignature = createOptionalCallbackFunction(
Expand All @@ -19,7 +19,7 @@ export class RsaSha1 implements SignatureAlgorithm {
const res = verifier.verify(key, signatureValue, "base64");

return res;
}
},
);

getAlgorithmName = () => {
Expand All @@ -35,7 +35,7 @@ export class RsaSha256 implements SignatureAlgorithm {
const res = signer.sign(privateKey, "base64");

return res;
}
},
);

verifySignature = createOptionalCallbackFunction(
Expand All @@ -45,7 +45,7 @@ export class RsaSha256 implements SignatureAlgorithm {
const res = verifier.verify(key, signatureValue, "base64");

return res;
}
},
);

getAlgorithmName = () => {
Expand All @@ -61,7 +61,7 @@ export class RsaSha512 implements SignatureAlgorithm {
const res = signer.sign(privateKey, "base64");

return res;
}
},
);

verifySignature = createOptionalCallbackFunction(
Expand All @@ -71,7 +71,7 @@ export class RsaSha512 implements SignatureAlgorithm {
const res = verifier.verify(key, signatureValue, "base64");

return res;
}
},
);

getAlgorithmName = () => {
Expand All @@ -87,7 +87,7 @@ export class HmacSha1 implements SignatureAlgorithm {
const res = signer.digest("base64");

return res;
}
},
);

verifySignature = createOptionalCallbackFunction(
Expand All @@ -97,7 +97,7 @@ export class HmacSha1 implements SignatureAlgorithm {
const res = verifier.digest("base64");

return res === signatureValue;
}
},
);

getAlgorithmName = () => {
Expand Down
Loading