File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,18 @@ export async function getGcpKmsAccount(
4040) : Promise < GcpKmsAccount > {
4141 const { name : unprocessedName , clientOptions, client } = options ;
4242
43+ if ( clientOptions ?. credentials ) {
44+ if (
45+ "private_key" in clientOptions . credentials &&
46+ clientOptions . credentials . private_key
47+ ) {
48+ // https://stackoverflow.com/questions/74131595/error-error1e08010cdecoder-routinesunsupported-with-google-auth-library
49+ // new keys are stored correctly with newlines, but older keys need this sanitization for backwards compatibility
50+ clientOptions . credentials . private_key =
51+ clientOptions . credentials . private_key . split ( String . raw `\n` ) . join ( "\n" ) ;
52+ }
53+ }
54+
4355 // we had a bug previously where we previously called it "cryptoKeyVersion" instead of "cryptoKeyVersions"
4456 // if we detect that, we'll fix it here
4557 // TODO: remove this as a breaking change
You can’t perform that action at this time.
0 commit comments