Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions lib/core/buckets/helpers/uploadValidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { getContext } from "../../../requestContext";
const EXEMPT_CLIENTS: Record<string, string> = {
"internxt-cli": "1.6.3",
"drive-desktop-windows": "2.6.6",
// All versions
"drive-desktop-linux": '*',
"drive-desktop-linux": '2.5.3',
};

export function shouldEnforceUploadValidation(): boolean {
Expand Down
15 changes: 10 additions & 5 deletions tests/lib/core/buckets/helpers/uploadValidation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,21 @@ describe('shouldEnforceUploadValidation()', () => {
});
});

describe('When the client is drive-desktop-linux (all versions exempt)', () => {
it('When called with any version, then it should not enforce', () => {
mockContext('drive-desktop-linux', '0.0.1');
describe('When the client is drive-desktop-linux (exempt up to 2.5.3)', () => {
it('When version is below the exempt threshold, then it should not enforce', () => {
mockContext('drive-desktop-linux', '2.5.2');
expect(shouldEnforceUploadValidation()).toBe(false);
});

it('When called with a high version, then it should not enforce', () => {
mockContext('drive-desktop-linux', '99.99.99');
it('When version equals the exempt threshold, then it should not enforce', () => {
mockContext('drive-desktop-linux', '2.5.3');
expect(shouldEnforceUploadValidation()).toBe(false);
});

it('When version is above the exempt threshold, then it should enforce', () => {
mockContext('drive-desktop-linux', '2.5.4');
expect(shouldEnforceUploadValidation()).toBe(true);
});
});

describe('When the client is internxt-cli (exempt up to 1.6.3)', () => {
Expand Down
Loading