重构 JWKS 模块,新增 JWKS 管理器,优化密钥生成与管理逻辑,更新路由处理

This commit is contained in:
2026-02-12 21:11:16 +08:00
parent 3cca0720c1
commit bb8ce3338d
7 changed files with 184 additions and 39 deletions

View File

@@ -0,0 +1,18 @@
import { router } from '@/app.ts'
import { manager } from '@/modules/jwks/index.ts'
router.all('/api/convex/jwks.json', async (req, res) => {
const jwks = await manager.getJWKS()
res.setHeader('Content-Type', 'application/json');
res.end(JSON.stringify(jwks));
})
// rsync -avz kevisual:/root/kevisual/assistant-app/storage/jwks/ ./storage/jwks
// router.all('/api/convex/sign', async (req, res) => {
// const payload = {
// sub: 'abc'
// };
// const token = await manager.sign(payload);
// res.setHeader('Content-Type', 'application/json');
// res.end(JSON.stringify({ token }));
// });