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

SECNG-1381 | Update dependencies, update library to 4.0.0 #261

Merged
merged 8 commits into from
Oct 15, 2022
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
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ coverage
node_modules
lib
*.html
.circleci/
.github/
.nvmrc
7 changes: 2 additions & 5 deletions lib/saml2.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ url = require 'url'
util = require 'util'
xmlbuilder = require 'xmlbuilder2'
xmlcrypto = require 'xml-crypto'
xmldom = require 'xmldom'
xmldom = require '@xmldom/xmldom'
xmlenc = require 'xml-encryption'
zlib = require 'zlib'
SignedXml = require('xml-crypto').SignedXml
Expand Down Expand Up @@ -239,10 +239,7 @@ decrypt_assertion = (dom, private_keys, cb) ->
# This checks the signature of a saml document and returns either array containing the signed data if valid, or null
# if the signature is invalid. Comparing the result against null is NOT sufficient for signature checks as it doesn't
# verify the signature is signing the important content, nor is it preventing the parsing of unsigned content.
check_saml_signature = (_xml, certificate) ->
# xml-crypto requires that whitespace is normalized as such:
# https://github.com/yaronn/xml-crypto/commit/17f75c538674c0afe29e766b058004ad23bd5136#diff-5dfe38baf287dcf756a17c2dd63483781b53bf4b669e10efdd01e74bcd8e780aL69
xml = _xml.replace(/\r\n?/g, '\n')
check_saml_signature = (xml, certificate) ->
doc = (new xmldom.DOMParser()).parseFromString(xml)

# xpath failed to capture <ds:Signature> nodes of direct descendents of the root.
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "saml2-js",
"version": "3.1.0",
"version": "4.0.0",
"description": "SAML 2.0 node helpers",
"author": "Clever",
"license": "Apache-2.0",
Expand All @@ -10,8 +10,8 @@
},
"scripts": {
"build": "coffee --bare -c -o lib-js lib",
"test": "NODE_ENV=test mocha --require coffee-script/register test/*.coffee",
"test-cov": "NODE_ENV=test nyc --extension .coffee -r html -r text mocha --require coffee-script/register test/*.coffee",
"test": "NODE_ENV=test mocha --require coffeescript/register test/*.coffee",
"test-cov": "NODE_ENV=test nyc --extension .coffee -r html -r text mocha --require coffeescript/register test/*.coffee",
"prepare": "npm run build"
},
"repository": {
Expand All @@ -26,18 +26,18 @@
"url": "https://github.com/Clever/saml2/issues"
},
"devDependencies": {
"coffee-script": "^1.12.0",
"mocha": "^8.2.0",
"coffeescript": "^1.12.7",
"mocha": "^8.4.0",
"nyc": "^15.0.0"
},
"dependencies": {
"@xmldom/xmldom": "^0.8.3",
"async": "^3.2.0",
"debug": "^4.3.0",
"underscore": "^1.8.0",
"xml-crypto": "^2.0.0",
"xml-encryption": "^1.2.1",
"xml-crypto": "^3.0.0",
"xml-encryption": "^2.0.0",
"xml2js": "^0.4.0",
"xmlbuilder2": "^2.4.0",
"xmldom": "^0.4.0"
"xmlbuilder2": "^2.4.0"
}
}
2 changes: 1 addition & 1 deletion test/saml2.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ fs = require 'fs'
saml2 = require "#{__dirname}/../lib/saml2"
url = require 'url'
util = require 'util'
xmldom = require 'xmldom'
xmldom = require '@xmldom/xmldom'
xmlcrypto = require 'xml-crypto'

describe 'saml2', ->
Expand Down