fastify-auth0-verify
Advanced tools
| import js from '@eslint/js' | ||
| import importPlugin from 'eslint-plugin-import' | ||
| import eslintN from 'eslint-plugin-n' | ||
| import eslintPrettier from 'eslint-plugin-prettier/recommended' | ||
| import promisePlugin from 'eslint-plugin-promise' | ||
| import neostandard from 'neostandard' | ||
| export default [ | ||
| ...neostandard({ | ||
| ignores: neostandard.resolveIgnoresFromGitignore() | ||
| }), | ||
| js.configs.recommended, | ||
| eslintPrettier, | ||
| importPlugin.flatConfigs.recommended, | ||
| eslintN.configs['flat/recommended'], | ||
| promisePlugin.configs['flat/recommended'], | ||
| { | ||
| rules: { | ||
| 'n/no-unpublished-require': 'off', | ||
| } | ||
| } | ||
| ] |
+10
-10
| { | ||
| "name": "fastify-auth0-verify", | ||
| "version": "4.0.0", | ||
| "version": "4.1.0", | ||
| "description": "Auth0 verification plugin for Fastify", | ||
@@ -51,19 +51,19 @@ "author": "NearForm Ltd", | ||
| "@fastify/jwt": "^10.0.0", | ||
| "fastify-jwt-jwks": "^2.0.3", | ||
| "fastify-jwt-jwks": "^3.0.0", | ||
| "fastify-plugin": "^5.1.0" | ||
| }, | ||
| "devDependencies": { | ||
| "cross-fetch": "^4.1.0", | ||
| "dotenv": "^17.2.3", | ||
| "eslint": "^8.23.0", | ||
| "eslint-config-prettier": "^9.0.0", | ||
| "eslint-config-standard": "^17.1.0", | ||
| "@eslint/eslintrc": "^3.3.3", | ||
| "@eslint/js": "^9.39.1", | ||
| "eslint": "^9.39.1", | ||
| "eslint-config-prettier": "^10.1.8", | ||
| "eslint-plugin-import": "^2.32.0", | ||
| "eslint-plugin-n": "^16.0.0", | ||
| "eslint-plugin-n": "^17.23.1", | ||
| "eslint-plugin-prettier": "^5.5.4", | ||
| "eslint-plugin-promise": "^6.0.1", | ||
| "eslint-plugin-promise": "^7.2.1", | ||
| "fast-jwt": "^6.1.0", | ||
| "fastify": "^5.6.2", | ||
| "jest": "^30.2.0", | ||
| "neostandard": "^0.12.2", | ||
| "nock": "^14.0.10", | ||
| "node-cache": "^5.1.2", | ||
| "prettier": "^3.7.4", | ||
@@ -70,0 +70,0 @@ "tsd": "^0.33.0", |
+21
-10
| 'use strict' | ||
| // eslint-disable-next-line n/no-unsupported-features/node-builtins | ||
| const { describe, test, before, after, beforeEach, afterEach } = require('node:test') | ||
@@ -10,3 +11,10 @@ const { readFileSync } = require('fs') | ||
| /* eslint-disable max-len */ | ||
| function withResolvers() { | ||
| let res, rej | ||
| const promise = new Promise((resolve, reject) => { | ||
| res = resolve | ||
| rej = reject | ||
| }) | ||
| return { promise, resolve: res, reject: rej } | ||
| } | ||
@@ -186,3 +194,2 @@ /* | ||
| } | ||
| /* eslint-enable max-len */ | ||
@@ -623,3 +630,3 @@ async function buildServer(options) { | ||
| signature: | ||
| 'HYgGxrwl3vthMChCy44eg-VK0x_SR-mf6761VI9jNk9rMqKZmFcabE7dVUA_hCKFXyj7VL7bJ09i3PxYFkj78PMz28B9hZz_h4ntVuafPmDL9FCHvW91oZTJRhosNor2yyUFcx6ijfu6WeUTZRtQdBqvcAgtKutNl9H0Q0wff-Jn10ViiFJTEmiaC-XhoZFjZQee7_bS7mOZtJCZeH69D_CWrCf4I-N2nl8U1sVHp-H0fRCc5D5SvlIhCsIXYJoFDRAuTtRvwrXXVPlIPugCeJ8l91S-GbIEEUejDCE8JPW9bEGfKoAFBiIbnRBSb4hKEbdFUqWHk-5_YOLzvPnq57vlCB8yeC10exEgiSeSb74tXGZyB4z540Mjt-2k9O9t7Uz1ICDZHvrYLUN2wzlSKqSucOvr5YpH8y-iLaWqAQeiR2b6w0u_c9kMEgzCAaobJp4QxjGkKHfYNmUFlV1uoY5_I2CBls-ICr0_E9PicMBnddg_JG8KabqAmZObCrkM5WRxSPPNLTElmw80MACxFqgaKxsMg-6uqmgTwy9ie9TjYVVdL1pdxWWaLDhzpDN1mmdTuIazfnSaib7PnzgPPgHlN7TnSCmCnYzffAg-i2Fz8JOhiK50mF86hc8n6em6K7cbVLm0nQcA4249D88Um9KBs8AoPXov8HGAS4Khwhk' // eslint-disable-line max-len | ||
| 'HYgGxrwl3vthMChCy44eg-VK0x_SR-mf6761VI9jNk9rMqKZmFcabE7dVUA_hCKFXyj7VL7bJ09i3PxYFkj78PMz28B9hZz_h4ntVuafPmDL9FCHvW91oZTJRhosNor2yyUFcx6ijfu6WeUTZRtQdBqvcAgtKutNl9H0Q0wff-Jn10ViiFJTEmiaC-XhoZFjZQee7_bS7mOZtJCZeH69D_CWrCf4I-N2nl8U1sVHp-H0fRCc5D5SvlIhCsIXYJoFDRAuTtRvwrXXVPlIPugCeJ8l91S-GbIEEUejDCE8JPW9bEGfKoAFBiIbnRBSb4hKEbdFUqWHk-5_YOLzvPnq57vlCB8yeC10exEgiSeSb74tXGZyB4z540Mjt-2k9O9t7Uz1ICDZHvrYLUN2wzlSKqSucOvr5YpH8y-iLaWqAQeiR2b6w0u_c9kMEgzCAaobJp4QxjGkKHfYNmUFlV1uoY5_I2CBls-ICr0_E9PicMBnddg_JG8KabqAmZObCrkM5WRxSPPNLTElmw80MACxFqgaKxsMg-6uqmgTwy9ie9TjYVVdL1pdxWWaLDhzpDN1mmdTuIazfnSaib7PnzgPPgHlN7TnSCmCnYzffAg-i2Fz8JOhiK50mF86hc8n6em6K7cbVLm0nQcA4249D88Um9KBs8AoPXov8HGAS4Khwhk' | ||
| }) | ||
@@ -1013,13 +1020,17 @@ }) | ||
| describe('Cleanup', function () { | ||
| test('should close the cache when the server stops', function (t, done) { | ||
| test('should close the cache when the server stops', async function (t) { | ||
| const NodeCache = require('node-cache') | ||
| t.mock.method(NodeCache.prototype, 'close') | ||
| buildServer({ secret: 'secret' }).then(server => { | ||
| server.close(() => { | ||
| t.assert.ok(NodeCache.prototype.close.mock.callCount() > 0) | ||
| done() | ||
| }) | ||
| }, done) | ||
| const server = await buildServer({ secret: 'secret' }) | ||
| const { resolve, promise } = withResolvers() | ||
| server.close(() => { | ||
| t.assert.ok(NodeCache.prototype.close.mock.callCount() > 0) | ||
| resolve() | ||
| }) | ||
| await promise | ||
| }) | ||
| }) |
@@ -1,6 +0,12 @@ | ||
| require('dotenv').config() | ||
| const Fastify = require('fastify') | ||
| const fetch = require('cross-fetch') | ||
| // eslint-disable-next-line n/no-unsupported-features/node-builtins | ||
| const { describe, test, before, after } = require('node:test') | ||
| try { | ||
| // eslint-disable-next-line n/no-unsupported-features/node-builtins | ||
| process.loadEnvFile() | ||
| } catch (e) { | ||
| console.error('Failed to load .env file', e) | ||
| } | ||
| if ( | ||
@@ -79,2 +85,3 @@ !process.env.AUTH0_DOMAIN || | ||
| test('Returns protected route when expected auth header is provided', async t => { | ||
| // eslint-disable-next-line n/no-unsupported-features/node-builtins | ||
| const authResponse = await fetch(`https://${process.env.AUTH0_DOMAIN}/oauth/token`, { | ||
@@ -81,0 +88,0 @@ method: 'POST', |
| module.exports = { | ||
| extends: ['standard', 'plugin:prettier/recommended'], | ||
| overrides: [ | ||
| { | ||
| extends: ['standard', 'plugin:prettier/recommended'], | ||
| files: ['test/**'] | ||
| } | ||
| ] | ||
| } |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
68365
1.3%1217
2.18%2
-60%+ Added
- Removed
- Removed
- Removed
Updated