fix(SSO): JWK関数の仕様変更に対応 (MisskeyIO#959)

MisskeyIO#950
This commit is contained in:
あわわわとーにゅ 2025-04-01 01:53:25 +09:00 committed by GitHub
parent cf1151aa28
commit eb5e94dbf8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 13 additions and 10 deletions

View file

@ -123,7 +123,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
}
const { publicKey, privateKey } = ps.useCertificate
? await jose.generateKeyPair(ps.signatureAlgorithm).then(async keypair => ({
? await jose.generateKeyPair(ps.signatureAlgorithm, { extractable: true }).then(async keypair => ({
publicKey: JSON.stringify(await jose.exportJWK(keypair.publicKey)),
privateKey: JSON.stringify(await jose.exportJWK(keypair.privateKey)),
}))
@ -139,6 +139,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
tenYearsLaterTime,
publicKey,
privateKey ?? '',
ps.signatureAlgorithm,
) : undefined;
const ssoServiceProvider = await this.singleSignOnServiceProviderRepository.insert({

View file

@ -60,7 +60,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
const alg = ps.signatureAlgorithm ? ps.signatureAlgorithm : service.signatureAlgorithm;
const { publicKey, privateKey } = ps.regenerateCertificate
? await jose.generateKeyPair(alg).then(async keypair => ({
? await jose.generateKeyPair(alg, { extractable: true }).then(async keypair => ({
publicKey: JSON.stringify(await jose.exportJWK(keypair.publicKey)),
privateKey: JSON.stringify(await jose.exportJWK(keypair.privateKey)),
}))
@ -76,6 +76,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
tenYearsLaterTime,
publicKey ?? '',
privateKey ?? '',
alg,
) : undefined;
await this.singleSignOnServiceProviderRepository.update(service.id, {