feat(oidc): add CreateOidcClientSheet component and update imports
Build and Push Auth Portal Docker Image / build-and-push (push) Successful in 2m25s
Build and Push Auth Portal Docker Image / create-release (push) Skipped

- Introduced the CreateOidcClientSheet component for OIDC client creation.
- Updated the index export to include the new component.
- Modified the OIDC admin route to import and utilize the new CreateOidcClientSheet.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
DenozordecandCursor committed 2026-08-11 19:40:39 +07:00
1 parent 0b6fa65b08
commit 36c4091dbf
5 files changed
+251 -101

No files matched your search

+24 -2
View File
@@ -40,8 +40,26 @@ function publicJwkFromPrivateExport(jwk: JWK, kid: string): JWK {
async function materialFromPem(
kid: string,
privatePem: string,
publicJwkJson?: string,
): Promise<OidcKeyMaterial> {
const privateKey = await importPKCS8(privatePem, 'RS256')
// jose defaults extractable=false for private keys → exportJWK throws
const privateKey = await importPKCS8(privatePem, 'RS256', {
extractable: true,
})
if (publicJwkJson) {
try {
const stored = JSON.parse(publicJwkJson) as JWK
return {
kid,
privateKey,
publicJwk: publicJwkFromPrivateExport({ ...stored, kid }, kid),
}
} catch {
// fall through to derive from private key
}
}
const full = await exportJWK(privateKey)
return {
kid,
@@ -67,7 +85,11 @@ export async function ensureOidcSigningKey(
const existing = getActiveOidcSigningKey(app.db)
if (existing) {
cached = await materialFromPem(existing.kid, existing.privatePem)
cached = await materialFromPem(
existing.kid,
existing.privatePem,
existing.publicJwkJson,
)
return cached
}