Skip to content

Commit

Permalink
feat: require Node.js version ^12.19.0 || ^14.15.0
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Node.js runtime version policy changed. Version
12.19.0 is now the minimum required runtime and *ONLY LTS* releases are
supported. This means "Current" Node releases are not officially
supported and you may get mixed results when using them.
  • Loading branch information
panva committed Mar 3, 2020
1 parent 76c36c7 commit 2a54e33
Show file tree
Hide file tree
Showing 28 changed files with 339 additions and 516 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,10 @@ jobs:
strategy:
matrix:
node-version:
- 10.13.0
- 10
- 12.0.0
- 12.19.0
- 12
- 13.7.0
- 13
- 14.0.0
- 14.15.0
- 14
- 15.0.1
- 15
os:
- ubuntu-latest
- windows-latest
Expand Down
2 changes: 1 addition & 1 deletion certification/runner/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const { strict: assert } = require('assert');
const { createWriteStream } = require('fs');

const Got = require('got');
const Got = require('got'); // TODO: upgrade got
const ms = require('ms');

const debug = require('./debug');
Expand Down
30 changes: 15 additions & 15 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ _**default value**_:

[RFC 8705](https://tools.ietf.org/html/rfc8705) - OAuth 2.0 Mutual TLS Client Authentication and Certificate Bound Access Tokens

Enables specific features from the Mutual TLS specification. The three main features have their own specific setting in this feature's configuration object and you must provide functions for resolving some of the functions which are deployment-specific. Note: **This feature is only supported in node runtime >= 12.0.0**
Enables specific features from the Mutual TLS specification. The three main features have their own specific setting in this feature's configuration object and you must provide functions for resolving some of the functions which are deployment-specific.



Expand Down Expand Up @@ -3218,7 +3218,7 @@ _**default value**_:

```js
[
// asymmetric RSAES based (note: RSA-OAEP-* is only supported in node runtime >= 12.9.0)
// asymmetric RSAES based
'RSA-OAEP', 'RSA-OAEP-256', 'RSA-OAEP-384', 'RSA-OAEP-512', 'RSA1_5',
// asymmetric ECDH-ES based
'ECDH-ES', 'ECDH-ES+A128KW', 'ECDH-ES+A192KW', 'ECDH-ES+A256KW',
Expand Down Expand Up @@ -3282,7 +3282,7 @@ _**default value**_:
'RS256', 'RS384', 'RS512',
'PS256', 'PS384', 'PS512',
'ES256', 'ES256K', 'ES384', 'ES512',
'EdDSA', // (note: EdDSA is only supported in node runtime >= 12.0.0)
'EdDSA',
]
```
</details>
Expand Down Expand Up @@ -3310,7 +3310,7 @@ _**default value**_:
'RS256', 'RS384', 'RS512',
'PS256', 'PS384', 'PS512',
'ES256', 'ES256K', 'ES384', 'ES512',
'EdDSA', // (note: EdDSA is only supported in node runtime >= 12.0.0)
'EdDSA',
]
```
</details>
Expand All @@ -3337,7 +3337,7 @@ _**default value**_:

```js
[
// asymmetric RSAES based (note: RSA-OAEP-* is only supported in node runtime >= 12.9.0)
// asymmetric RSAES based
'RSA-OAEP', 'RSA-OAEP-256', 'RSA-OAEP-384', 'RSA-OAEP-512', 'RSA1_5',
// asymmetric ECDH-ES based
'ECDH-ES', 'ECDH-ES+A128KW', 'ECDH-ES+A192KW', 'ECDH-ES+A256KW',
Expand Down Expand Up @@ -3402,7 +3402,7 @@ _**default value**_:
'RS256', 'RS384', 'RS512',
'PS256', 'PS384', 'PS512',
'ES256', 'ES256K', 'ES384', 'ES512',
'EdDSA', // (note: EdDSA is only supported in node runtime >= 12.0.0)
'EdDSA',
]
```
</details>
Expand All @@ -3429,7 +3429,7 @@ _**default value**_:

```js
[
// asymmetric RSAES based (note: RSA-OAEP-* is only supported in node runtime >= 12.9.0)
// asymmetric RSAES based
'RSA-OAEP', 'RSA-OAEP-256', 'RSA-OAEP-384', 'RSA-OAEP-512', 'RSA1_5',
// asymmetric ECDH-ES based
'ECDH-ES', 'ECDH-ES+A128KW', 'ECDH-ES+A192KW', 'ECDH-ES+A256KW',
Expand Down Expand Up @@ -3493,7 +3493,7 @@ _**default value**_:
'RS256', 'RS384', 'RS512',
'PS256', 'PS384', 'PS512',
'ES256', 'ES256K', 'ES384', 'ES512',
'EdDSA', // (note: EdDSA is only supported in node runtime >= 12.0.0)
'EdDSA',
]
```
</details>
Expand Down Expand Up @@ -3524,7 +3524,7 @@ _**default value**_:
'RS256', 'RS384', 'RS512',
'PS256', 'PS384', 'PS512',
'ES256', 'ES256K', 'ES384', 'ES512',
'EdDSA', // (note: EdDSA is only supported in node runtime >= 12.0.0)
'EdDSA',
]
```
</details>
Expand All @@ -3551,7 +3551,7 @@ _**default value**_:

```js
[
// asymmetric RSAES based (note: RSA-OAEP-* is only supported in node runtime >= 12.9.0)
// asymmetric RSAES based
'RSA-OAEP', 'RSA-OAEP-256', 'RSA-OAEP-384', 'RSA-OAEP-512', 'RSA1_5',
// asymmetric ECDH-ES based
'ECDH-ES', 'ECDH-ES+A128KW', 'ECDH-ES+A192KW', 'ECDH-ES+A256KW',
Expand Down Expand Up @@ -3616,7 +3616,7 @@ _**default value**_:
'RS256', 'RS384', 'RS512',
'PS256', 'PS384', 'PS512',
'ES256', 'ES256K', 'ES384', 'ES512',
'EdDSA', // (note: EdDSA is only supported in node runtime >= 12.0.0)
'EdDSA',
]
```
</details>
Expand Down Expand Up @@ -3646,7 +3646,7 @@ _**default value**_:
'RS256', 'RS384', 'RS512',
'PS256', 'PS384', 'PS512',
'ES256', 'ES256K', 'ES384', 'ES512',
'EdDSA', // (note: EdDSA is only supported in node runtime >= 12.0.0)
'EdDSA',
]
```
</details>
Expand Down Expand Up @@ -3676,7 +3676,7 @@ _**default value**_:
'RS256', 'RS384', 'RS512',
'PS256', 'PS384', 'PS512',
'ES256', 'ES256K', 'ES384', 'ES512',
'EdDSA', // (note: EdDSA is only supported in node runtime >= 12.0.0)
'EdDSA',
]
```
</details>
Expand All @@ -3703,7 +3703,7 @@ _**default value**_:

```js
[
// asymmetric RSAES based (note: RSA-OAEP-* is only supported in node runtime >= 12.9.0)
// asymmetric RSAES based
'RSA-OAEP', 'RSA-OAEP-256', 'RSA-OAEP-384', 'RSA-OAEP-512', 'RSA1_5',
// asymmetric ECDH-ES based
'ECDH-ES', 'ECDH-ES+A128KW', 'ECDH-ES+A192KW', 'ECDH-ES+A256KW',
Expand Down Expand Up @@ -3768,7 +3768,7 @@ _**default value**_:
'RS256', 'RS384', 'RS512',
'PS256', 'PS384', 'PS512',
'ES256', 'ES256K', 'ES384', 'ES512',
'EdDSA', // (note: EdDSA is only supported in node runtime >= 12.0.0)
'EdDSA',
]
```
</details>
Expand Down
2 changes: 1 addition & 1 deletion lib/actions/introspection.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ module.exports = function introspectionAction(provider) {
jti: token.jti, // TODO: in v7.x omit if jti === params.token
aud: token.aud,
scope: token.scope,
cnf: token.isSenderConstrained() ? {} : undefined, // TODO: in v7.x omit if RefreshToken
cnf: token.isSenderConstrained() ? {} : undefined,
token_type: token.kind !== 'RefreshToken' ? token.tokenType : undefined,
});

Expand Down
4 changes: 2 additions & 2 deletions lib/adapters/memory_adapter.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const LRU = require('lru-cache');
const Cache = require('lru-cache');

const epochTime = require('../helpers/epoch_time');

let storage = new LRU({});
let storage = new Cache();

function grantKeyFor(id) {
return `grant:${id}`;
Expand Down
10 changes: 4 additions & 6 deletions lib/consts/jwa.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
const runtimeSupport = require('../helpers/runtime_support');

const signingAlgValues = [
'HS256', 'HS384', 'HS512',
'RS256', 'RS384', 'RS512',
'PS256', 'PS384', 'PS512',
'ES256', 'ES256K', 'ES384', 'ES512',
runtimeSupport.EdDSA ? 'EdDSA' : undefined,
].filter(Boolean);
'EdDSA',
];

const encryptionAlgValues = [
// asymmetric
'RSA-OAEP',
...(runtimeSupport.oaepHash ? ['RSA-OAEP-256', 'RSA-OAEP-384', 'RSA-OAEP-512'] : []),
'RSA-OAEP-256', 'RSA-OAEP-384', 'RSA-OAEP-512',
'RSA1_5',
'ECDH-ES', 'ECDH-ES+A128KW', 'ECDH-ES+A192KW', 'ECDH-ES+A256KW',
// symmetric
'A128GCMKW', 'A192GCMKW', 'A256GCMKW', 'A128KW', 'A192KW', 'A256KW',
'PBES2-HS256+A128KW', 'PBES2-HS384+A192KW', 'PBES2-HS512+A256KW',
// direct
'dir',
].filter(Boolean);
];

const encryptionEncValues = [
'A128CBC-HS256', 'A128GCM', 'A192CBC-HS384', 'A192GCM', 'A256CBC-HS512', 'A256GCM',
Expand Down
12 changes: 0 additions & 12 deletions lib/helpers/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const docs = require('./docs');
const getDefaults = require('./defaults');
const { STABLE, DRAFTS } = require('./features');
const attention = require('./attention');
const runtimeSupport = require('./runtime_support');
const instance = require('./weak_cache');

function authEndpointDefaults(config) {
Expand Down Expand Up @@ -73,8 +72,6 @@ class Configuration {

this.logDraftNotice();

this.checkRuntimeFeatures();

this.ensureMaps();
this.ensureSets();

Expand Down Expand Up @@ -149,15 +146,6 @@ class Configuration {
});
}

checkRuntimeFeatures() {
if (this.features.mTLS.enabled && !runtimeSupport.KeyObject) {
throw new TypeError('mTLS can only be enabled on Node.js >= 12.0.0 runtime');
}
if ((this.formats.AccessToken === 'paseto' || this.formats.ClientCredentials === 'paseto') && !runtimeSupport.EdDSA) {
throw new TypeError('paseto structured tokens can only be enabled on Node.js >= 12.0.0 runtime');
}
}

fixResponseTypes() {
const types = new Set();

Expand Down
Loading

0 comments on commit 2a54e33

Please sign in to comment.