Rewire dashboard to pull from v3/secrets with folderId support

This commit is contained in:
Tuan Dang
2023-08-28 09:12:04 +01:00
parent f924d0c02c
commit d72ddfe315
5 changed files with 13 additions and 2 deletions
+5 -1
View File
@@ -498,6 +498,7 @@ export const getSecretsHelper = async ({
workspaceId,
environment,
authData,
folderId,
secretPath = "/"
}: GetSecretsParams) => {
let secrets: ISecret[] = [];
@@ -507,7 +508,10 @@ export const getSecretsHelper = async ({
throw UnauthorizedRequestError({ message: "Folder Permission Denied" });
}
}
const folderId = await getFolderIdFromServiceToken(workspaceId, environment, secretPath);
if (!folderId) {
folderId = await getFolderIdFromServiceToken(workspaceId, environment, secretPath);
}
// get personal secrets first
secrets = await Secret.find({