mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 22:27:48 +00:00
fix: handle disabled/destroyed values in gcp sync
This commit is contained in:
@@ -71,8 +71,13 @@ const getGcpSecrets = async (accessToken: string, secretSync: TGcpSyncWithCreden
|
|||||||
|
|
||||||
res[key] = Buffer.from(secretLatest.payload.data, "base64").toString("utf-8");
|
res[key] = Buffer.from(secretLatest.payload.data, "base64").toString("utf-8");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// when a secret in GCP has no versions, we treat it as if it's a blank value
|
// when a secret in GCP has no versions, or is disabled/destroyed, we treat it as if it's a blank value
|
||||||
if (error instanceof AxiosError && error.response?.status === 404) {
|
if (
|
||||||
|
error instanceof AxiosError &&
|
||||||
|
(error.response?.status === 404 ||
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||||
|
(error.response?.status === 400 && error.response.data.error.status === "FAILED_PRECONDITION"))
|
||||||
|
) {
|
||||||
res[key] = "";
|
res[key] = "";
|
||||||
} else {
|
} else {
|
||||||
throw new SecretSyncError({
|
throw new SecretSyncError({
|
||||||
|
|||||||
Reference in New Issue
Block a user