Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/server/utils/wallets/getGcpKmsAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ export async function getGcpKmsAccount(
): Promise<GcpKmsAccount> {
const { name: unprocessedName, clientOptions, client } = options;

if (clientOptions?.credentials) {
if (
"private_key" in clientOptions.credentials &&
clientOptions.credentials.private_key
) {
// https://stackoverflow.com/questions/74131595/error-error1e08010cdecoder-routinesunsupported-with-google-auth-library
// new keys are stored correctly with newlines, but older keys need this sanitization for backwards compatibility
clientOptions.credentials.private_key =
clientOptions.credentials.private_key.split(String.raw`\n`).join("\n");
}
}

// we had a bug previously where we previously called it "cryptoKeyVersion" instead of "cryptoKeyVersions"
// if we detect that, we'll fix it here
// TODO: remove this as a breaking change
Expand Down
Loading