Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fastify/bearer-auth

Package Overview
Dependencies
Maintainers
17
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastify/bearer-auth - npm Package Compare versions

Comparing version 7.0.0 to 7.0.1

4

package.json
{
"name": "@fastify/bearer-auth",
"version": "7.0.0",
"version": "7.0.1",
"description": "An authentication plugin for Fastify",

@@ -32,5 +32,5 @@ "main": "plugin.js",

"devDependencies": {
"@fastify/auth": "^2.0.0",
"@types/node": "^17.0.0",
"fastify": "^3.0.0",
"fastify-auth": "^1.0.1",
"pre-commit": "^1.2.2",

@@ -37,0 +37,0 @@ "snazzy": "^9.0.0",

@@ -1,5 +0,5 @@

# fastify-bearer-auth
# @fastify/bearer-auth
![CI](https://github.com/fastify/fastify-bearer-auth/workflows/CI/badge.svg)
[![npm version](https://img.shields.io/npm/v/fastify-bearer-auth)](https://www.npmjs.com/package/fastify-bearer-auth)
[![npm version](https://img.shields.io/npm/v/@fastify/bearer-auth)](https://www.npmjs.com/package/@fastify/bearer-auth)
[![Known Vulnerabilities](https://snyk.io/test/github/fastify/fastify-bearer-auth/badge.svg)](https://snyk.io/test/github/fastify/fastify-bearer-auth)

@@ -9,3 +9,3 @@ [![Coverage Status](https://coveralls.io/repos/github/fastify/fastify-bearer-auth/badge.svg?branch=master)](https://coveralls.io/github/fastify/fastify-bearer-auth?branch=master)

*fastify-bearer-auth* provides a simple request hook for the [Fastify][fastify]
*@fastify/bearer-auth* provides a simple request hook for the [Fastify][fastify]
web framework.

@@ -21,3 +21,3 @@

const fastify = require('fastify')()
const bearerAuthPlugin = require('fastify-bearer-auth')
const bearerAuthPlugin = require('@fastify/bearer-auth')
const keys = new Set(['a-super-secret-key', 'another-super-secret-key'])

@@ -41,3 +41,3 @@

*fastify-bearer-auth* exports a standard [Fastify plugin][fplugin]. This allows
*@fastify/bearer-auth* exports a standard [Fastify plugin][fplugin]. This allows
you to register the plugin within scoped paths. Therefore, you could have some

@@ -94,10 +94,10 @@ paths that are not protected by the plugin and others that are. See the [Fastify][fastify]

## Integration with `fastify-auth`
## Integration with `@fastify/auth`
This plugin can integrate with `fastify-auth` by following this example:
This plugin can integrate with `@fastify/auth` by following this example:
```js
const fastify = require('fastify')()
const auth = require('fastify-auth')
const bearerAuthPlugin = require('fastify-bearer-auth')
const auth = require('@fastify/auth')
const bearerAuthPlugin = require('@fastify/bearer-auth')
const keys = new Set(['a-super-secret-key', 'another-super-secret-key'])

@@ -138,3 +138,3 @@

will allow `fastify.auth` to continue with the next authentication scheme in the hook list.
Note that by setting `{ verifyErrorLogLevel: 'debug' }` in the options, `fastify-bearer-auth` will emit all verification error logs at the `debug` level. Since it is not the only authentication method here, emitting verification error logs at the `error` level may be not appropriate here.
Note that by setting `{ verifyErrorLogLevel: 'debug' }` in the options, `@fastify/bearer-auth` will emit all verification error logs at the `debug` level. Since it is not the only authentication method here, emitting verification error logs at the `error` level may be not appropriate here.
If `verifyBearerAuth` is the last hook in the list, `fastify.auth` will reply with `Unauthorized`.

@@ -141,0 +141,0 @@ ## License

@@ -18,3 +18,3 @@ 'use strict'

code: () => response,
send: send
send
}

@@ -41,4 +41,4 @@

code: () => response,
header: header,
send: send
header,
send
}

@@ -71,3 +71,3 @@ function header (key, value) {

code: () => response,
send: send
send
}

@@ -95,3 +95,3 @@

code: () => response,
send: send
send
}

@@ -119,3 +119,3 @@

code: () => response,
send: send
send
}

@@ -146,3 +146,3 @@

code: () => response,
send: send
send
}

@@ -171,3 +171,3 @@

code: () => response,
send: send
send
}

@@ -199,3 +199,3 @@

code: () => response,
send: send
send
}

@@ -227,3 +227,3 @@

code: () => response,
send: send
send
}

@@ -252,3 +252,3 @@

code: () => response,
send: send
send
}

@@ -279,4 +279,4 @@

code: () => response,
header: header,
send: send
header,
send
}

@@ -319,3 +319,3 @@ function header (key, value) {

},
send: send
send
}

@@ -353,3 +353,3 @@

},
send: send
send
}

@@ -387,3 +387,3 @@

},
send: send
send
}

@@ -421,3 +421,3 @@

},
send: send
send
}

@@ -455,3 +455,3 @@

},
send: send
send
}

@@ -484,3 +484,3 @@

},
send: send
send
}

@@ -521,3 +521,3 @@

},
send: send
send
}

@@ -555,3 +555,3 @@

},
send: send
send
}

@@ -558,0 +558,0 @@

@@ -56,3 +56,3 @@ 'use strict'

test('integration with fastify-auth', async (t) => {
test('integration with @fastify/auth', async (t) => {
t.plan(3)

@@ -68,3 +68,3 @@

})
await fastify.register(require('fastify-auth'))
await fastify.register(require('@fastify/auth'))

@@ -119,3 +119,3 @@ fastify.route({

test('integration with fastify-auth; not the last auth option', async (t) => {
test('integration with @fastify/auth; not the last auth option', async (t) => {
t.plan(3)

@@ -128,3 +128,3 @@

})
await fastify.register(require('fastify-auth'))
await fastify.register(require('@fastify/auth'))

@@ -131,0 +131,0 @@ fastify.route({

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc