
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
@cloudflare/util-api
Advanced tools
Handy utilities to help interact with the v4 API.
Lightweight. Asynchronous. In TypeScript.
$ npm install @cloudflare/util-api
Assuming your node service/worker is behind api-gateway:
import { apiGateway } from '@cloudflare/util-api';
async function handleRequest(request: Request) {
try {
const decodedJWT = await apiGateway.authenticateRequest(request);
console.log(decodedJWT.user.email);
} catch (e) {
// Authentication failed
}
}
If you only have a Bearer token:
import { apiGateway } from '@cloudflare/util-api';
async function handleBearer(bearer: string) {
try {
const decodedJWT = await apiGateway.authenticateBearer(bearer);
console.log(decodedJWT.user.email);
} catch (e) {
// Authentication failed
}
}
If you only have a JWT:
import { apiGateway } from '@cloudflare/util-api';
async function handleJWT(jwt: string) {
try {
const decodedJWT = await apiGateway.authenticateJWT(jwt);
console.log(decodedJWT.user.email);
} catch (e) {
// Authentication failed
}
}
FAQs
Set of utilities to help interact with the v4 API.
The npm package @cloudflare/util-api receives a total of 605 weekly downloads. As such, @cloudflare/util-api popularity was classified as not popular.
We found that @cloudflare/util-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 40 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
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.