From 92b097b62a6a4b21397bb36cd4858df60ad4e664 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Mon, 15 Mar 2021 18:15:41 +0000 Subject: [PATCH 1/4] chore(index): lint with standard --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 73d07ae..daf98a2 100644 --- a/index.js +++ b/index.js @@ -18,11 +18,11 @@ function basicPlugin (fastify, opts, next) { if (authenticateHeader) { reply.header(authenticateHeader.key, authenticateHeader.value) } - var credentials = auth(req) + const credentials = auth(req) if (credentials == null) { done(new Unauthorized('Missing or bad formatted authorization header')) } else { - var result = validate(credentials.name, credentials.pass, req, reply, done) + const result = validate(credentials.name, credentials.pass, req, reply, done) if (result && typeof result.then === 'function') { result.then(done, done) } From d5bda7b245ac27e73fe2a1743c66761c4defd980 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Mon, 15 Mar 2021 18:20:02 +0000 Subject: [PATCH 2/4] docs(readme): add npm and snyk badges --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2bd1705..2ebbf8d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # fastify-basic-auth -[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/) ![CI](https://github.com/fastify/fastify-basic-auth/workflows/CI/badge.svg) +![CI](https://github.com/fastify/fastify-basic-auth/workflows/CI/badge.svg?branch=master) +[![NPM version](https://img.shields.io/npm/v/fastify-basic-auth.svg?style=flat)](https://www.npmjs.com/package/fastify-basic-auth) +[![Known Vulnerabilities](https://snyk.io/test/github/fastify/fastify-basic-auth/badge.svg)](https://snyk.io/test/github/fastify/fastify-basic-auth) +[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/) A simple basic auth plugin for Fastify. From 5eb98cd4297d273bac45fff79ab39935db1ed39f Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Mon, 15 Mar 2021 18:24:32 +0000 Subject: [PATCH 3/4] build(deps-dev): add @types/node --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 46e8dbf..0f46021 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ }, "homepage": "https://github.com/fastify/fastify-basic-auth#readme", "devDependencies": { + "@types/node": "^14.14.34", "fastify": "^3.0.0", "fastify-auth": "^1.0.0", "standard": "^16.0.1", From 5c714e08086340813458597fb5f6b7581bc8eac4 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Mon, 15 Mar 2021 18:24:50 +0000 Subject: [PATCH 4/4] build(deps-dev): bump tsd from 0.11.0 to 0.14.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0f46021..4fb7f5a 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "fastify-auth": "^1.0.0", "standard": "^16.0.1", "tap": "^14.10.7", - "tsd": "^0.11.0" + "tsd": "^0.14.0" }, "dependencies": { "basic-auth": "^2.0.1",