mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-05 13:26:31 +00:00
Patch GCP secret manager integration edge-case
This commit is contained in:
@@ -317,8 +317,8 @@ const syncSecretsGCPSecretManager = async ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface GCPSMListSecretsRes {
|
interface GCPSMListSecretsRes {
|
||||||
secrets: GCPSecret[];
|
secrets?: GCPSecret[];
|
||||||
totalSize: number;
|
totalSize?: number;
|
||||||
nextPageToken?: string;
|
nextPageToken?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -345,7 +345,9 @@ const syncSecretsGCPSecretManager = async ({
|
|||||||
}
|
}
|
||||||
)).data;
|
)).data;
|
||||||
|
|
||||||
gcpSecrets = gcpSecrets.concat(res.secrets);
|
if (res.secrets) {
|
||||||
|
gcpSecrets = gcpSecrets.concat(res.secrets);
|
||||||
|
}
|
||||||
|
|
||||||
if (!res.nextPageToken) {
|
if (!res.nextPageToken) {
|
||||||
hasMorePages = false;
|
hasMorePages = false;
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import {
|
|||||||
} from "@app/hooks/api";
|
} from "@app/hooks/api";
|
||||||
|
|
||||||
export default function GCPSecretManagerOAuth2CallbackPage() {
|
export default function GCPSecretManagerOAuth2CallbackPage() {
|
||||||
console.log("GCPSecretManagerOAuth2CallbackPage");
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { mutateAsync } = useAuthorizeIntegration();
|
const { mutateAsync } = useAuthorizeIntegration();
|
||||||
|
|
||||||
@@ -18,10 +17,6 @@ export default function GCPSecretManagerOAuth2CallbackPage() {
|
|||||||
try {
|
try {
|
||||||
// validate state
|
// validate state
|
||||||
|
|
||||||
console.log("gcp oauth2 callback page");
|
|
||||||
console.log("gcp oauth2 callback page code: ", code);
|
|
||||||
console.log("gcp oauth2 callback page state: ", state);
|
|
||||||
|
|
||||||
if (state !== localStorage.getItem("latestCSRFToken")) return;
|
if (state !== localStorage.getItem("latestCSRFToken")) return;
|
||||||
localStorage.removeItem("latestCSRFToken");
|
localStorage.removeItem("latestCSRFToken");
|
||||||
const integrationAuth = await mutateAsync({
|
const integrationAuth = await mutateAsync({
|
||||||
@@ -30,8 +25,6 @@ export default function GCPSecretManagerOAuth2CallbackPage() {
|
|||||||
integration: "gcp-secret-manager"
|
integration: "gcp-secret-manager"
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("integrationAuth: ", integrationAuth);
|
|
||||||
|
|
||||||
router.push(`/integrations/gcp-secret-manager/create?integrationAuthId=${integrationAuth._id}`);
|
router.push(`/integrations/gcp-secret-manager/create?integrationAuthId=${integrationAuth._id}`);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
|||||||
Reference in New Issue
Block a user