
Security News
Deno Goes the Way of the Dinosaur
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.
onestack-auth
Advanced tools
TypeScript SDK for the OneStack auth service: OIDC (Authorization Code + PKCE) client core and managed-profile API. Framework- and runtime-agnostic (Node 22+, Workers, Deno, Bun).
OneStack 身份服务的 TypeScript 客户端 SDK:OIDC(Authorization Code + PKCE)协议核心 + 托管资料 API 客户端。
SDK 只做协议:
运行时无关:纯 ESM + d.ts,只依赖 jose,只用 Web 标准 API(fetch / crypto.subtle),在 Node 22+、Cloudflare Workers、Deno、Bun 上行为一致。所有出站请求均可传入 AbortSignal 控制超时;所有失败归一为 OneStackAuthError(含服务端错误码与 requestId)。
npm install onestack-auth
产品后端持有 client_secret,官网/前端只做跳转与回跳页,token 不落浏览器。
import {
createAuthClient,
OneStackAuthError,
} from "onestack-auth";
const auth = createAuthClient({
issuer: "https://accounts.example.com/api/auth",
clientId: process.env.ACCOUNT_CLIENT_ID!, // 注册产品时获得
clientSecret: process.env.ACCOUNT_CLIENT_SECRET!,
audience: "https://product.example.com", // 本产品源(token audience)
});
// 1) 登录入口:跳转授权页(state/nonce/PKCE 已生成)
app.get("/login", async (req, reply) => {
const transaction = await auth.authorizationTransaction({
callbackUrl: "https://product.example.com/auth/callback",
scope: "identity:migrate", // 按需追加能力 scope
});
// ⚠️ transaction.state/nonce/codeVerifier 由产品自行保存并与回调核对
// (签名 cookie / 临时存储均可——这是产品侧职责)
return reply.redirect(transaction.authorizationUrl);
});
// 2) 回调:换 token 并验签,得到稳定身份 claims
const result = await auth.exchangeCode({
code,
codeVerifier,
callbackUrl: "https://product.example.com/auth/callback",
nonce,
});
// result.claims: StableAccountClaims(sub 唯一键、头像、联系方式…)
// 之后用产品自己的 session 机制记住 result.claims.sub
// 3) 跨站登出:顶层 GET 跳转,让账号会话一并失效
reply.redirect(productSignOutUrl(auth.config, "https://product.example.com/"));
import { getManagedAccountProfile } from "onestack-auth/profile";
const profile = await getManagedAccountProfile(auth.config, accountUserId);
SDK 只是提速器:服务端点是标准 OIDC(发现文档 /.well-known/openid-configuration、Authorization Code + PKCE、JWKS),任何语言用对应 OIDC 库(Python authlib、Go go-oidc…)或裸 HTTP 即可接入。见仓库 docs/auth-integration.md。
try {
await auth.exchangeCode({ ... });
} catch (error) {
if (error instanceof OneStackAuthError) {
error.code; // 服务端错误码(AUTH_RATE_LIMITED…)或 AUTH_HTTP_ERROR / AUTH_NETWORK_ERROR / AUTH_TIMEOUT
error.requestId; // 服务端请求号,便于排查
}
}
FAQs
TypeScript SDK for the OneStack auth service: OIDC (Authorization Code + PKCE) client core and managed-profile API. Framework- and runtime-agnostic (Node 22+, Workers, Deno, Bun).
The npm package onestack-auth receives a total of 25 weekly downloads. As such, onestack-auth popularity was classified as not popular.
We found that onestack-auth demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Cloudflare is acquiring Deno’s team, which will provide another year of bug fixes and security updates before ending support for the runtime.

Security News
Anthropic’s free OSS Scanner uses Mythos and other Claude models to find open source vulnerabilities and send maintainers reports with proposed fixes.

Security News
On Front Lines’ Early Adopters: CISO podcast, Andrew Becherer shares lessons from Datadog, weighs the long-term costs of AI-built tools, and explains how founders can actually gain a CISO’s trust.