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
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ describe('ImportAssetTypes', () => {
};
const importContext: ImportContext = {
spacesRootPath: '/tmp/import/spaces',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'api-key-1',
host: 'https://api.contentstack.io/v3',
org_uid: 'org-1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ describe('ImportAssets', () => {
};
const importContext: ImportContext = {
spacesRootPath: '/tmp/import/spaces',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'api-key-1',
host: 'https://api.contentstack.io/v3',
org_uid: 'org-1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ describe('CSAssetsImportAdapter (base)', () => {
};
const importContext: ImportContext = {
spacesRootPath: '/tmp/import/spaces',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'api-key-1',
host: 'https://api.contentstack.io/v3',
org_uid: 'org-1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ describe('ImportFields', () => {
};
const importContext: ImportContext = {
spacesRootPath: '/tmp/import/spaces',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'api-key-1',
host: 'https://api.contentstack.io/v3',
org_uid: 'org-1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ describe('ImportSpaces', () => {
contentDir: '/tmp/import',
csAssetsUrl: 'https://am.example.com',
org_uid: 'org-1',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'api-key-1',
host: 'https://api.contentstack.io/v3',
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe('ImportWorkspace', () => {

const importContext: ImportContext = {
spacesRootPath: '/tmp/import/spaces',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'api-key-1',
host: 'https://api.contentstack.io/v3',
org_uid: 'org-1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ describe('detectAssetManagementExportFromContentDir', () => {
);
fs.writeFileSync(
path.join(tmpRoot, 'branches.json'),
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
JSON.stringify([{ stackHeaders: { api_key: 'source-stack-key' } }]),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ describe('Bootstrap Integration Tests', () => {
const mockOptions = {
cloneDirectory: '/test/path',
seedParams: {
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
stackAPIKey: 'test-key',
managementTokenAlias: 'test-alias',
managementToken: 'test-token',
Expand Down Expand Up @@ -118,6 +119,7 @@ describe('Bootstrap Integration Tests', () => {
it('should validate SeedParams interface includes managementTokenAlias and managementToken', () => {
// Verify that SeedParams interface includes the new properties
const mockSeedParams = {
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
stackAPIKey: 'test-key',
org: 'test-org',
stackName: 'test-stack',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ describe('BaseBulkCommand', () => {
(command as any).bulkOperationConfig = {
publishMode: 'bulk',
apiKey: undefined,
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
stackApiKey: 'fallback-key',
branch: 'main',
bulkOperationFolder: './bulk-operation',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ describe('Bulk Operation Log Handler', () => {
locales: ['en-us'],
items: [{ uid: 'entry1' }],
status: 'success',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
branch: 'main',
},
Expand Down Expand Up @@ -254,6 +255,7 @@ describe('Bulk Operation Log Handler', () => {
items: [{ uid: 'entry1' }],
status: 'failed',
error: 'Network error',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
branch: 'main',
},
Expand Down Expand Up @@ -351,6 +353,7 @@ describe('Bulk Operation Log Handler', () => {
item: { uid: 'entry1', type: 'entry', locale: 'en-us' },
environments: ['prod'],
status: 'success',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
branch: 'main',
},
Expand Down Expand Up @@ -400,6 +403,7 @@ describe('Bulk Operation Log Handler', () => {
environments: ['prod'],
status: 'failed',
error: 'Network error',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
branch: 'main',
},
Expand Down Expand Up @@ -442,6 +446,7 @@ describe('Bulk Operation Log Handler', () => {
locales: ['en-us'],
items: [{ uid: 'entry1', type: 'entry', locale: 'en-us' }],
status: 'success',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
branch: 'main',
};
Expand All @@ -467,6 +472,7 @@ describe('Bulk Operation Log Handler', () => {
locales: ['en-us'],
items: [],
status: 'success',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
branch: 'main',
};
Expand All @@ -492,6 +498,7 @@ describe('Bulk Operation Log Handler', () => {
locales: [],
items: [],
status: 'success',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
branch: 'main',
};
Expand Down Expand Up @@ -528,6 +535,7 @@ describe('Bulk Operation Log Handler', () => {
items: [],
status: 'failed',
error: 'API Error',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
branch: 'main',
};
Expand Down Expand Up @@ -563,6 +571,7 @@ describe('Bulk Operation Log Handler', () => {
item: { uid: 'entry1', type: 'entry', locale: 'en-us' },
environments: ['prod'],
status: 'success',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
branch: 'main',
};
Expand All @@ -586,6 +595,7 @@ describe('Bulk Operation Log Handler', () => {
item: { uid: 'new-entry', type: 'entry', locale: 'en-us' },
environments: ['prod'],
status: 'success',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
branch: 'main',
};
Expand Down Expand Up @@ -622,6 +632,7 @@ describe('Bulk Operation Log Handler', () => {
environments: ['prod'],
status: 'failed',
error: 'Publish failed',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
branch: 'main',
};
Expand All @@ -644,6 +655,7 @@ describe('Bulk Operation Log Handler', () => {
item: { uid: 'entry1', type: 'entry', locale: 'en-us' },
environments: [],
status: 'failed',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
branch: 'main',
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ describe('Config Builder Utilities', () => {
};

configHandlerGetStub.withArgs('tokens.test-alias').returns({
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'stack-from-alias',
token: 'cs-token-123',
});
Expand All @@ -589,6 +590,7 @@ describe('Config Builder Utilities', () => {
};

configHandlerGetStub.withArgs('tokens.test-alias').returns({
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'stack-mgmt',
token: 'cs-mgmt-token',
type: 'management',
Expand All @@ -598,6 +600,7 @@ describe('Config Builder Utilities', () => {
type: 'delivery',
token: 'cs-delivery-token',
environment: 'production',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'stack123',
});

Expand All @@ -619,6 +622,7 @@ describe('Config Builder Utilities', () => {
};

configHandlerGetStub.withArgs('tokens.test-alias').returns({
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'stack-mgmt',
token: 'cs-mgmt-token',
type: 'management',
Expand All @@ -640,6 +644,7 @@ describe('Config Builder Utilities', () => {
};

configHandlerGetStub.withArgs('tokens.test-alias').returns({
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'stack-mgmt',
token: 'cs-mgmt-token',
type: 'management',
Expand All @@ -648,6 +653,7 @@ describe('Config Builder Utilities', () => {
configHandlerGetStub.withArgs('tokens.mgmt-alias').returns({
type: 'management',
token: 'cs-mgmt-token',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'stack123',
});

Expand All @@ -665,6 +671,7 @@ describe('Config Builder Utilities', () => {
};

configHandlerGetStub.withArgs('tokens.test-alias').returns({
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'stack-mgmt',
token: 'cs-mgmt-token',
type: 'management',
Expand All @@ -674,6 +681,7 @@ describe('Config Builder Utilities', () => {
type: 'delivery',
token: 'cs-delivery-token',
environment: 'production', // Different from source-env
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'stack123',
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ describe('Revert Retry Handler', () => {
items: [{ uid: 'entry1', locale: 'en-us', contentType: 'blog', version: 1, type: 'entry' }],
status: 'failed',
error: 'Network timeout',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
branch: 'main',
},
Expand All @@ -86,6 +87,7 @@ describe('Revert Retry Handler', () => {
locales: ['en-us'],
items: [{ uid: 'asset1', locale: 'en-us', version: 1, type: 'asset' }],
status: 'failed',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
branch: 'main',
},
Expand Down Expand Up @@ -121,6 +123,7 @@ describe('Revert Retry Handler', () => {
locales: ['en-us'],
items: [{ uid: 'entry1', locale: 'en-us', contentType: 'blog', version: 1, type: 'entry' }],
status: 'success',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
branch: 'main',
},
Expand Down Expand Up @@ -161,6 +164,7 @@ describe('Revert Retry Handler', () => {
locales: ['en-us'],
items: [{ uid: 'entry1', locale: 'en-us', contentType: 'blog', version: 1, type: 'entry' }],
status: 'failed',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
branch: 'main',
},
Expand Down Expand Up @@ -201,6 +205,7 @@ describe('Revert Retry Handler', () => {
locales: ['en-us'],
items: [{ uid: 'entry1', locale: 'en-us', contentType: 'blog', version: 1, type: 'entry' }],
status: 'success',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
branch: 'main',
},
Expand Down Expand Up @@ -260,6 +265,7 @@ describe('Revert Retry Handler', () => {
locales: ['en-us'],
items: [{ uid: 'entry1', locale: 'en-us', contentType: 'blog', version: 1, type: 'entry' }],
status: 'failed',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
branch: 'main',
},
Expand Down Expand Up @@ -295,6 +301,7 @@ describe('Revert Retry Handler', () => {
locales: ['en-us'],
items: [{ uid: 'asset1', locale: 'en-us', version: 1, type: 'asset' }],
status: 'failed',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
branch: 'main',
},
Expand Down Expand Up @@ -337,6 +344,7 @@ describe('Revert Retry Handler', () => {
locales: ['en-us'],
items: [{ uid: 'entry1', locale: 'en-us', contentType: 'blog', version: 1, type: 'entry' as const }],
status: 'success' as const,
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
branch: 'main',
},
Expand All @@ -360,6 +368,7 @@ describe('Revert Retry Handler', () => {
locales: ['en-us'],
items: [{ uid: 'entry1', locale: 'en-us', contentType: 'blog', version: 1, type: 'entry' as const }],
status: 'success' as const,
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
branch: 'main',
},
Expand All @@ -380,6 +389,7 @@ describe('Revert Retry Handler', () => {
item: { uid: 'entry1', locale: 'en-us', contentType: 'blog', version: 1, type: 'entry' as const },
environments: ['prod'],
status: 'success' as const,
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
branch: 'main',
},
Expand All @@ -400,6 +410,7 @@ describe('Revert Retry Handler', () => {
item: { uid: 'entry1', locale: 'en-us', contentType: 'blog', version: 1, type: 'entry' as const },
environments: ['prod'],
status: 'success' as const,
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
branch: 'main',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ describe('Stack Clone Test', () => {

describe('createNewStack', () => {
it('should call createNewStack', async () => {
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
const createNewStackStub = sandbox.stub(handler, 'createNewStack').resolves({ api_key: 'test-key' });
await handler.createNewStack({ orgUid: 'dummyOrg' });
expect(createNewStackStub.calledOnce).to.be.true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ describe('Command Helpers', () => {
executeDestination: async () => {},
cmdExport: async () => true,
setBranch: async () => {},
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
createNewStack: async (params: any) => ({ api_key: 'test-key' }),
cloneTypeSelection: async () => 'success',
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,12 @@ describe('CloneHandler - Branch', () => {
try {
await handler.resolveBranchAliases(true);
// If it doesn't throw, verify stack was called
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
expect(mockClient.stack.calledWith({ api_key: 'test-source-key' })).to.be.true;
} catch (error) {
// Expected to fail due to actual function call without proper setup
expect(error).to.exist;
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
expect(mockClient.stack.calledWith({ api_key: 'test-source-key' })).to.be.true;
}
});
Expand All @@ -120,10 +122,12 @@ describe('CloneHandler - Branch', () => {

try {
await handler.resolveBranchAliases(false);
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
expect(mockClient.stack.calledWith({ api_key: 'test-target-key' })).to.be.true;
} catch (error) {
// Expected to fail due to actual function call without proper setup
expect(error).to.exist;
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
expect(mockClient.stack.calledWith({ api_key: 'test-target-key' })).to.be.true;
}
});
Expand Down
Loading
Loading