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(
40
40
) : Promise < GcpKmsAccount > {
41
41
const { name : unprocessedName , clientOptions, client } = options ;
42
42
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
+
43
55
// we had a bug previously where we previously called it "cryptoKeyVersion" instead of "cryptoKeyVersions"
44
56
// if we detect that, we'll fix it here
45
57
// TODO: remove this as a breaking change
You can’t perform that action at this time.
0 commit comments