saml 0.15.0-rc.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.idea/aws.xml ADDED
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="accountSettings">
4
+ <option name="activeRegion" value="us-east-1" />
5
+ <option name="recentlyUsedRegions">
6
+ <list>
7
+ <option value="us-east-1" />
8
+ </list>
9
+ </option>
10
+ </component>
11
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/node-saml.iml" filepath="$PROJECT_DIR$/.idea/node-saml.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="WEB_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$">
5
+ <excludeFolder url="file://$MODULE_DIR$/temp" />
6
+ <excludeFolder url="file://$MODULE_DIR$/.tmp" />
7
+ <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
+ </content>
9
+ <orderEntry type="inheritedJdk" />
10
+ <orderEntry type="sourceFolder" forTests="false" />
11
+ </component>
12
+ </module>
File without changes
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
package/.travis.yml CHANGED
@@ -1,6 +1,4 @@
1
1
  language: node_js
2
2
  node_js:
3
- - 4.4.3
4
- - 8.17.0
5
3
  - 10.16.0
6
4
  - 12.10.0
package/CHANGELOG.md ADDED
@@ -0,0 +1,57 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
+
5
+ ## [2.0.0](https://github.com/auth0/node-saml/compare/v1.0.1...v2.0.0) (2022-02-04)
6
+
7
+
8
+ ### ⚠ BREAKING CHANGES
9
+
10
+ * Requires NodeJS >= 12
11
+
12
+ Upgraded the xml-encryption package which removes the vulnerable node-forge dependency
13
+ See https://github.com/advisories/GHSA-8fr3-hfg3-gpgp
14
+
15
+ ### Bug Fixes
16
+
17
+ * remove vulnerable node-forge dependency ([0106c61](https://github.com/auth0/node-saml/commit/0106c611a1263150e42692411aeeea0c95ec0755))
18
+
19
+ ### [1.0.1](https://github.com/auth0/node-saml/compare/v1.0.0...v1.0.1) (2021-09-17)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * update xmldom and xml-crypto to fix security issues ([6ad0243](https://github.com/auth0/node-saml/commit/6ad0243fe8c2f90d71d335500e9a9c8a2c436cb7))
25
+
26
+ ## [1.0.0](https://github.com/auth0/node-saml/compare/v0.15.0...v1.0.0) (2020-11-04)
27
+
28
+
29
+ ### ⚠ BREAKING CHANGES
30
+
31
+ * update xml-crypto and xmldom dependencies to fix sec issues
32
+ * stop supporting node v4 and v8
33
+ * xml-encryption major version bump, fix typo in config property
34
+ from `keyEncryptionAlgorighm` to `keyEncryptionAlgorithm` consumed by
35
+ new xml-encryption library version.
36
+
37
+ ### Features
38
+
39
+ * fix sec issues with dependencies ([06acc02](https://github.com/auth0/node-saml/commit/06acc0238d7161c123f2f6924aa9f5984a5a2f32))
40
+ * update xml-crypto and xmldom dependencies to fix sec issues ([772c30e](https://github.com/auth0/node-saml/commit/772c30e4333d0af0e783c163e371c49ec0386c23))
41
+
42
+
43
+ * remove node v4 and v8 in travis configuration ([d8c62af](https://github.com/auth0/node-saml/commit/d8c62af972e6c6edbc052fafed749b254e73569c))
44
+
45
+ ## [0.15.0](https://github.com/auth0/node-saml/compare/v0.13.0...v0.15.0) (2020-10-01)
46
+
47
+
48
+ ### Features
49
+
50
+ * **saml11:** adds saml11.createUnsignedAssertion() ([51170c9](https://github.com/auth0/node-saml/commit/51170c91f5ddf9c31cb00b03fe5d8c513131e165))
51
+ * **saml20:** adds Saml20.createUnsignedAssertion() ([de0e766](https://github.com/auth0/node-saml/commit/de0e766f3fcb52913a93ff52cc1feefebf47eb00))
52
+ * **xml/sign:** unsigned assertions should have whitespace removed as well ([968d0e7](https://github.com/auth0/node-saml/commit/968d0e7559dd72f7d029752ced9887855e7d44c4))
53
+
54
+
55
+ ### Bug Fixes
56
+
57
+ * **saml20:** parses saml20.template only once at start up ([cb3bfcd](https://github.com/auth0/node-saml/commit/cb3bfcdc4b034b6ac3ea52172c1be7d6193fddec))
package/README.md CHANGED
@@ -4,6 +4,10 @@ Create SAML assertions. Supports SAML 1.1 and SAML 2.0 tokens.
4
4
 
5
5
  [![Build Status](https://travis-ci.org/auth0/node-saml.png)](https://travis-ci.org/auth0/node-saml)
6
6
 
7
+ ### Supported Node Versions
8
+
9
+ node >= 12
10
+
7
11
  ### Usage
8
12
 
9
13
  ```js
package/lib/saml11.js CHANGED
@@ -1,6 +1,6 @@
1
1
  var path = require('path');
2
2
  var utils = require('./utils');
3
- var Parser = require('xmldom').DOMParser;
3
+ var Parser = require('@xmldom/xmldom').DOMParser;
4
4
  var xmlenc = require('xml-encryption');
5
5
  var moment = require('moment');
6
6
  var async = require('async');
@@ -55,7 +55,7 @@ function extractSaml11Options(opts) {
55
55
  * @param [options.encryptionCert] {Buffer}
56
56
  * @param [options.encryptionPublicKey] {Buffer}
57
57
  * @param [options.encryptionAlgorithm] {string}
58
- * @param [options.keyEncryptionAlgorighm] {string}
58
+ * @param [options.keyEncryptionAlgorithm] {string}
59
59
  *
60
60
  * @param {Function} [callback] required if encrypting
61
61
  * @return {String|*}
@@ -88,7 +88,7 @@ exports.create = function(options, callback) {
88
88
  * @param [options.encryptionCert] {Buffer}
89
89
  * @param [options.encryptionPublicKey] {Buffer}
90
90
  * @param [options.encryptionAlgorithm] {string}
91
- * @param [options.keyEncryptionAlgorighm] {string}
91
+ * @param [options.keyEncryptionAlgorithm] {string}
92
92
  *
93
93
  * @param {Function} [callback] required if encrypting
94
94
  * @return {String|*}
@@ -120,7 +120,7 @@ function createAssertion(options, strategies, callback) {
120
120
  conditions[0].setAttribute('NotBefore', now.format('YYYY-MM-DDTHH:mm:ss.SSS[Z]'));
121
121
  conditions[0].setAttribute('NotOnOrAfter', now.add(options.lifetimeInSeconds, 'seconds').format('YYYY-MM-DDTHH:mm:ss.SSS[Z]'));
122
122
  }
123
-
123
+
124
124
  if (options.audiences) {
125
125
  var audiences = options.audiences instanceof Array ? options.audiences : [options.audiences];
126
126
  audiences.forEach(function (audience) {
@@ -135,7 +135,7 @@ function createAssertion(options, strategies, callback) {
135
135
  var statement = doc.documentElement.getElementsByTagNameNS(NAMESPACE, 'AttributeStatement')[0];
136
136
  Object.keys(options.attributes).forEach(function(prop) {
137
137
  if(typeof options.attributes[prop] === 'undefined') return;
138
-
138
+
139
139
  // <saml:Attribute AttributeName="name" AttributeNamespace="http://schemas.xmlsoap.org/claims/identity">
140
140
  // <saml:AttributeValue>Foo Bar</saml:AttributeValue>
141
141
  // </saml:Attribute>
@@ -162,15 +162,15 @@ function createAssertion(options, strategies, callback) {
162
162
  .setAttribute('AuthenticationInstant', now.format('YYYY-MM-DDTHH:mm:ss.SSS[Z]'));
163
163
 
164
164
  var nameID = doc.documentElement.getElementsByTagNameNS(NAMESPACE, 'NameIdentifier')[0];
165
-
165
+
166
166
  if (options.nameIdentifier) {
167
167
  nameID.textContent = options.nameIdentifier;
168
-
168
+
169
169
  doc.getElementsByTagName('saml:AuthenticationStatement')[0]
170
170
  .getElementsByTagName('saml:NameIdentifier')[0]
171
171
  .textContent = options.nameIdentifier;
172
172
  }
173
-
173
+
174
174
  if (options.nameIdentifierFormat) {
175
175
  var nameIDs = doc.documentElement.getElementsByTagNameNS(NAMESPACE, 'NameIdentifier');
176
176
  nameIDs[0].setAttribute('Format', options.nameIdentifierFormat);
package/lib/saml20.js CHANGED
@@ -94,7 +94,7 @@ function extractSaml20Options(opts) {
94
94
  * @param [options.encryptionCert] {Buffer}
95
95
  * @param [options.encryptionPublicKey] {Buffer}
96
96
  * @param [options.encryptionAlgorithm] {string}
97
- * @param [options.keyEncryptionAlgorighm] {string}
97
+ * @param [options.keyEncryptionAlgorithm] {string}
98
98
  *
99
99
  * @param {Function} [callback] required if encrypting
100
100
  * @return {*}
@@ -133,7 +133,7 @@ exports.create = function createSignedAssertion(options, callback) {
133
133
  * @param [options.encryptionCert] {Buffer}
134
134
  * @param [options.encryptionPublicKey] {Buffer}
135
135
  * @param [options.encryptionAlgorithm] {string}
136
- * @param [options.keyEncryptionAlgorighm] {string}
136
+ * @param [options.keyEncryptionAlgorithm] {string}
137
137
  *
138
138
  * @param {Function} [callback] required if encrypting
139
139
  * @return {*}
package/lib/utils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  var fs = require('fs');
2
- var Parser = require('xmldom').DOMParser;
2
+ var Parser = require('@xmldom/xmldom').DOMParser;
3
3
 
4
4
  exports.pemToCert = function(pem) {
5
5
  var cert = /-----BEGIN CERTIFICATE-----([^-]*)-----END CERTIFICATE-----/g.exec(pem.toString());
@@ -10,7 +10,7 @@ exports.fromEncryptXmlOptions = function (options) {
10
10
  rsa_pub: options.encryptionPublicKey,
11
11
  pem: options.encryptionCert,
12
12
  encryptionAlgorithm: options.encryptionAlgorithm || 'http://www.w3.org/2001/04/xmlenc#aes256-cbc',
13
- keyEncryptionAlgorighm: options.keyEncryptionAlgorighm || 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p',
13
+ keyEncryptionAlgorithm: options.keyEncryptionAlgorithm || 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p',
14
14
  };
15
15
 
16
16
  // expose the encryptOptions as these are needed when adding the SubjectConfirmation
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "saml",
3
- "version": "0.15.0-rc.0",
3
+ "version": "2.0.0",
4
+ "engines": {
5
+ "node": ">=12"
6
+ },
4
7
  "devDependencies": {
5
- "@commitlint/cli": "^9.1.2",
6
- "@commitlint/config-conventional": "^9.1.2",
8
+ "@commitlint/cli": "^11.0.0",
9
+ "@commitlint/config-conventional": "^11.0.0",
7
10
  "chai": "^4.2.0",
8
11
  "husky": "^4.3.0",
9
- "mocha": "3.5.3",
12
+ "mocha": "^8.2.0",
10
13
  "should": "~1.2.1",
11
14
  "standard-version": "^9.0.0"
12
15
  },
@@ -19,13 +22,13 @@
19
22
  "author": "Matias Woloski (Auth0)",
20
23
  "license": "MIT",
21
24
  "dependencies": {
25
+ "@xmldom/xmldom": "^0.7.4",
22
26
  "async": "~0.2.9",
23
27
  "moment": "2.19.3",
24
28
  "valid-url": "~1.0.9",
25
- "xml-crypto": "~1.0.1",
26
- "xml-encryption": "0.11.2",
29
+ "xml-crypto": "^2.1.3",
30
+ "xml-encryption": "^2.0.0",
27
31
  "xml-name-validator": "~2.0.1",
28
- "xmldom": "=0.1.15",
29
32
  "xpath": "0.0.5"
30
33
  },
31
34
  "scripts": {
@@ -2,7 +2,7 @@ var assert = require('chai').assert;
2
2
  var fs = require('fs');
3
3
  var moment = require('moment');
4
4
  var should = require('should');
5
- var xmldom = require('xmldom');
5
+ var xmldom = require('@xmldom/xmldom');
6
6
  var xmlenc = require('xml-encryption');
7
7
 
8
8
  var utils = require('./utils');
@@ -27,7 +27,7 @@ describe('saml 1.1', function () {
27
27
  it: it.skip
28
28
  })
29
29
  });
30
-
30
+
31
31
  function saml11TestSuite(options) {
32
32
  var createAssertion = options.createAssertion;
33
33
  var assertSignature = options.assertSignature;
@@ -3,7 +3,7 @@ var fs = require('fs');
3
3
  var utils = require('./utils');
4
4
  var moment = require('moment');
5
5
  var should = require('should');
6
- var xmldom = require('xmldom');
6
+ var xmldom = require('@xmldom/xmldom');
7
7
  var xmlenc = require('xml-encryption');
8
8
 
9
9
  var saml = require('../lib/saml20');
package/test/utils.js CHANGED
@@ -1,5 +1,5 @@
1
1
  var xmlCrypto = require('xml-crypto');
2
- var xmldom = require('xmldom');
2
+ var xmldom = require('@xmldom/xmldom');
3
3
 
4
4
  /**
5
5
  * @param {string} assertion