
Product
Introducing Socket Scanning for OpenVSX Extensions
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.
@byu-oit/fastify-jwt
Advanced tools
A Fastify plugin for verifying callers JWTs with the BYU JWT package
@byu-oit/fastify-jwtProvides a fastify plugin for verifying JWTs at BYU OIT
import Fastify from 'fastify'
import { ByuLogger } from '@byu-oit/logger'
import { ByuJwtProvider } from '@byu-oit/fastify-jwt'
const logger = ByuLogger()
const fastify = Fastify({ logger })
fastify.register(ByuJwtProvider, {
/** Only authenticate routes matching this prefix */
prefix: '/example/v1',
development: process.env.NODE_ENV === 'development',
/** May pass in ByuJwt options from @byu-oit/jwt */
issuer: 'https://api.byu.edu',
additionalValidations: [(jwt) => {
if(false) throw new Error('This will never happen')
}]
})
await fastify.listen({ port: 3000 }).catch(console.error)
In addition to the three properties below, you can also pass in any options that are defined in BYU JWT documentation as well.
| property | type | default | description |
|---|---|---|---|
| prefix | string | undefined | Will only authenticate routes matching this prefix. |
| development | boolean | false | skips JWT verification for development purposes but will throw an error if NODE_ENV is set to production. |
| basePath | string | undefined | will validate that the audience starts with the provided basePath in production. |
FAQs
A Fastify plugin for verifying callers JWTs with the BYU JWT package
The npm package @byu-oit/fastify-jwt receives a total of 20 weekly downloads. As such, @byu-oit/fastify-jwt popularity was classified as not popular.
We found that @byu-oit/fastify-jwt demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.

Product
Bringing supply chain security to the next generation of JavaScript package managers

Product
A safer, faster way to eliminate vulnerabilities without updating dependencies