fix(oidc): handle literal \n in PEM key from .env files
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
086ac02205
commit
f06852dd3b
|
|
@ -6658,6 +6658,7 @@ async function initOidcKeys() {
|
||||||
const pemBody = pemEnv
|
const pemBody = pemEnv
|
||||||
.replace(/-----BEGIN PRIVATE KEY-----/, '')
|
.replace(/-----BEGIN PRIVATE KEY-----/, '')
|
||||||
.replace(/-----END PRIVATE KEY-----/, '')
|
.replace(/-----END PRIVATE KEY-----/, '')
|
||||||
|
.replace(/\\n/g, '') // literal \n from .env files
|
||||||
.replace(/\s/g, '');
|
.replace(/\s/g, '');
|
||||||
const binaryDer = Uint8Array.from(atob(pemBody), c => c.charCodeAt(0));
|
const binaryDer = Uint8Array.from(atob(pemBody), c => c.charCodeAt(0));
|
||||||
oidcPrivateKey = await crypto.subtle.importKey(
|
oidcPrivateKey = await crypto.subtle.importKey(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue