Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
@tsndr/cloudflare-worker-jwt
Advanced tools
A lightweight JWT implementation with ZERO dependencies for Cloudflare Worker
A lightweight JWT implementation with ZERO dependencies for Cloudflare Workers.
const jwt = require('@tsndr/cloudflare-worker-jwt')
// Creating a token
const token = jwt.sign({ name: 'John Doe', email: 'john.doe@gmail.com' }, 'secret')
// Verifing token
const isValid = jwt.verify(token, secret)
// Decoding token
const payload = jwt.decode(token)
jwt.sign(payload, secret, [algorithm])
Signs a payload and returns the token.
payload
Can be an object, buffer or a string.
secret
A string which is used to sign the payload.
algorithm
(optional, default: HS256
)
The algorithm used to sign the payload, possible values: HS256
(default) or HS512
jwt.verify(token, secret, [algorithm])
Verifies the integrity of the token and returns a boolean value.
token
The token string generated by jwt.sign()
.
secret
A string which is used to sign the payload.
algorithm
(optional, default: HS256
)
The algorithm used to sign the payload, possible values: HS256
(default) or HS512
jwt.decode(token)
Returns the payload without verifying the integrity of the token.
token
The token string generated by jwt.sign()
.
npm i @tsndr/cloudflare-worker-jwt
FAQs
A lightweight JWT implementation with ZERO dependencies for Cloudflare Worker
The npm package @tsndr/cloudflare-worker-jwt receives a total of 15,558 weekly downloads. As such, @tsndr/cloudflare-worker-jwt popularity was classified as popular.
We found that @tsndr/cloudflare-worker-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.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.