mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 19:16:22 +00:00
adjustment: removed artificial limiting of pit versions
This commit is contained in:
@@ -72,7 +72,7 @@ type TSecretServiceFactoryDep = {
|
||||
secretDAL: TSecretDALFactory;
|
||||
secretTagDAL: TSecretTagDALFactory;
|
||||
secretVersionDAL: TSecretVersionDALFactory;
|
||||
projectDAL: Pick<TProjectDALFactory, "checkProjectUpgradeStatus" | "findProjectBySlug" | "findById">;
|
||||
projectDAL: Pick<TProjectDALFactory, "checkProjectUpgradeStatus" | "findProjectBySlug">;
|
||||
projectEnvDAL: Pick<TProjectEnvDALFactory, "findOne">;
|
||||
folderDAL: Pick<
|
||||
TSecretFolderDALFactory,
|
||||
@@ -1354,16 +1354,7 @@ export const secretServiceFactory = ({
|
||||
);
|
||||
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Read, ProjectPermissionSub.SecretRollback);
|
||||
|
||||
const { pitVersionLimit } = await projectDAL.findById(folder.projectId);
|
||||
const computedQueryLimit = Math.min(pitVersionLimit - offset, limit);
|
||||
if (offset > pitVersionLimit || computedQueryLimit <= 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const secretVersions = await secretVersionDAL.find(
|
||||
{ secretId },
|
||||
{ offset, limit: computedQueryLimit, sort: [["createdAt", "desc"]] }
|
||||
);
|
||||
const secretVersions = await secretVersionDAL.find({ secretId }, { offset, limit, sort: [["createdAt", "desc"]] });
|
||||
return secretVersions;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user