diff --git a/packages/contentstack-asset-management/test/unit/import/asset-types.test.ts b/packages/contentstack-asset-management/test/unit/import/asset-types.test.ts index c3252526d..871ef9088 100644 --- a/packages/contentstack-asset-management/test/unit/import/asset-types.test.ts +++ b/packages/contentstack-asset-management/test/unit/import/asset-types.test.ts @@ -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', diff --git a/packages/contentstack-asset-management/test/unit/import/assets.test.ts b/packages/contentstack-asset-management/test/unit/import/assets.test.ts index d60a758ae..5a02fb8c6 100644 --- a/packages/contentstack-asset-management/test/unit/import/assets.test.ts +++ b/packages/contentstack-asset-management/test/unit/import/assets.test.ts @@ -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', diff --git a/packages/contentstack-asset-management/test/unit/import/base.test.ts b/packages/contentstack-asset-management/test/unit/import/base.test.ts index ddbab234e..eee4c3c9b 100644 --- a/packages/contentstack-asset-management/test/unit/import/base.test.ts +++ b/packages/contentstack-asset-management/test/unit/import/base.test.ts @@ -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', diff --git a/packages/contentstack-asset-management/test/unit/import/fields.test.ts b/packages/contentstack-asset-management/test/unit/import/fields.test.ts index c45ef17c8..3363c363b 100644 --- a/packages/contentstack-asset-management/test/unit/import/fields.test.ts +++ b/packages/contentstack-asset-management/test/unit/import/fields.test.ts @@ -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', diff --git a/packages/contentstack-asset-management/test/unit/import/spaces.test.ts b/packages/contentstack-asset-management/test/unit/import/spaces.test.ts index d77f7e943..1f58d0bbb 100644 --- a/packages/contentstack-asset-management/test/unit/import/spaces.test.ts +++ b/packages/contentstack-asset-management/test/unit/import/spaces.test.ts @@ -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', }; diff --git a/packages/contentstack-asset-management/test/unit/import/workspaces.test.ts b/packages/contentstack-asset-management/test/unit/import/workspaces.test.ts index 45e2187b7..8a442096b 100644 --- a/packages/contentstack-asset-management/test/unit/import/workspaces.test.ts +++ b/packages/contentstack-asset-management/test/unit/import/workspaces.test.ts @@ -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', diff --git a/packages/contentstack-asset-management/test/unit/utils/detect-asset-management-export.test.ts b/packages/contentstack-asset-management/test/unit/utils/detect-asset-management-export.test.ts index 6f86af75d..09e72c8df 100644 --- a/packages/contentstack-asset-management/test/unit/utils/detect-asset-management-export.test.ts +++ b/packages/contentstack-asset-management/test/unit/utils/detect-asset-management-export.test.ts @@ -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' } }]), ); diff --git a/packages/contentstack-bootstrap/test/bootstrap-integration.test.js b/packages/contentstack-bootstrap/test/bootstrap-integration.test.js index 1d70642ef..5d8df954b 100644 --- a/packages/contentstack-bootstrap/test/bootstrap-integration.test.js +++ b/packages/contentstack-bootstrap/test/bootstrap-integration.test.js @@ -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', @@ -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', diff --git a/packages/contentstack-bulk-operations/test/unit/base-bulk-command.test.ts b/packages/contentstack-bulk-operations/test/unit/base-bulk-command.test.ts index bf01a5e56..dfb72425b 100644 --- a/packages/contentstack-bulk-operations/test/unit/base-bulk-command.test.ts +++ b/packages/contentstack-bulk-operations/test/unit/base-bulk-command.test.ts @@ -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', diff --git a/packages/contentstack-bulk-operations/test/unit/utils/bulk-operation-log-handler.test.ts b/packages/contentstack-bulk-operations/test/unit/utils/bulk-operation-log-handler.test.ts index 151978dcc..7f05ccaaa 100644 --- a/packages/contentstack-bulk-operations/test/unit/utils/bulk-operation-log-handler.test.ts +++ b/packages/contentstack-bulk-operations/test/unit/utils/bulk-operation-log-handler.test.ts @@ -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', }, @@ -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', }, @@ -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', }, @@ -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', }, @@ -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', }; @@ -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', }; @@ -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', }; @@ -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', }; @@ -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', }; @@ -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', }; @@ -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', }; @@ -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', }; diff --git a/packages/contentstack-bulk-operations/test/unit/utils/config-builder.test.ts b/packages/contentstack-bulk-operations/test/unit/utils/config-builder.test.ts index e47a42227..384e7d00f 100644 --- a/packages/contentstack-bulk-operations/test/unit/utils/config-builder.test.ts +++ b/packages/contentstack-bulk-operations/test/unit/utils/config-builder.test.ts @@ -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', }); @@ -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', @@ -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', }); @@ -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', @@ -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', @@ -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', }); @@ -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', @@ -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', }); diff --git a/packages/contentstack-bulk-operations/test/unit/utils/revert-retry-handler.test.ts b/packages/contentstack-bulk-operations/test/unit/utils/revert-retry-handler.test.ts index 917cffa50..3ed09244f 100644 --- a/packages/contentstack-bulk-operations/test/unit/utils/revert-retry-handler.test.ts +++ b/packages/contentstack-bulk-operations/test/unit/utils/revert-retry-handler.test.ts @@ -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', }, @@ -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', }, @@ -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', }, @@ -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', }, @@ -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', }, @@ -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', }, @@ -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', }, @@ -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', }, @@ -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', }, @@ -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', }, @@ -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', }, diff --git a/packages/contentstack-clone/test/commands/stack-clone.test.ts b/packages/contentstack-clone/test/commands/stack-clone.test.ts index e6da5895b..f069dc8ec 100644 --- a/packages/contentstack-clone/test/commands/stack-clone.test.ts +++ b/packages/contentstack-clone/test/commands/stack-clone.test.ts @@ -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; diff --git a/packages/contentstack-clone/test/lib/helpers/command-helpers.test.ts b/packages/contentstack-clone/test/lib/helpers/command-helpers.test.ts index 67c64325c..c184b90a9 100644 --- a/packages/contentstack-clone/test/lib/helpers/command-helpers.test.ts +++ b/packages/contentstack-clone/test/lib/helpers/command-helpers.test.ts @@ -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', }; diff --git a/packages/contentstack-clone/test/lib/util/clone-handler.branch.test.ts b/packages/contentstack-clone/test/lib/util/clone-handler.branch.test.ts index 3fda70480..0879f999a 100644 --- a/packages/contentstack-clone/test/lib/util/clone-handler.branch.test.ts +++ b/packages/contentstack-clone/test/lib/util/clone-handler.branch.test.ts @@ -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; } }); @@ -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; } }); diff --git a/packages/contentstack-content-type/tests/core/command.test.ts b/packages/contentstack-content-type/tests/core/command.test.ts index b56f811c7..a3826f04f 100644 --- a/packages/contentstack-content-type/tests/core/command.test.ts +++ b/packages/contentstack-content-type/tests/core/command.test.ts @@ -4,6 +4,7 @@ jest.mock('@contentstack/cli-command', () => ({ error = jest.fn() warn = jest.fn() getToken(_alias: string) { + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret return { apiKey: 'default-api', type: 'management' } } }, @@ -11,6 +12,7 @@ jest.mock('@contentstack/cli-command', () => ({ jest.mock('@contentstack/cli-utilities', () => ({ authenticationHandler: { + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret accessToken: 'auth-token', getAuthDetails: jest.fn(), }, @@ -149,6 +151,7 @@ describe('ContentTypeCommand', () => { it('sets apiKey from alias token and warns on delivery token', async () => { jest.spyOn(cmd, 'getToken').mockReturnValue({ + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret apiKey: 'from-token', type: 'delivery', } as any) @@ -162,6 +165,7 @@ describe('ContentTypeCommand', () => { it('sets apiKey from management token alias without warning', async () => { jest.spyOn(cmd, 'getToken').mockReturnValue({ + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret apiKey: 'mgmt-key', type: 'management', } as any) diff --git a/packages/contentstack-content-type/tests/core/contentstack/client.test.ts b/packages/contentstack-content-type/tests/core/contentstack/client.test.ts index 4580083c0..c800b4e01 100644 --- a/packages/contentstack-content-type/tests/core/contentstack/client.test.ts +++ b/packages/contentstack-content-type/tests/core/contentstack/client.test.ts @@ -36,6 +36,7 @@ describe('ContentstackClient', () => { expect(mockGet).toHaveBeenCalledWith( '/audit-logs', expect.objectContaining({ + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret headers: { api_key: 'stack-key' }, params: { query: { @@ -106,6 +107,7 @@ describe('ContentstackClient', () => { await client.getContentTypeReferences('stack-key', 'ct-uid', spinner) expect(mockGet).toHaveBeenCalledWith('/content_types/ct-uid/references', { + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret headers: { api_key: 'stack-key' }, params: { include_global_fields: true } }) diff --git a/packages/contentstack-content-type/tests/utils/index.test.ts b/packages/contentstack-content-type/tests/utils/index.test.ts index e38d8e9a0..0509e3735 100644 --- a/packages/contentstack-content-type/tests/utils/index.test.ts +++ b/packages/contentstack-content-type/tests/utils/index.test.ts @@ -86,12 +86,14 @@ describe('utils/index', () => { const sdk = stackFactory({}) const stack = await getStack(sdk, 'api-key-1', spinner) expect(stack).toEqual({ + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret api_key: 'api-key-1', master_locale: 'en-us', name: 'Stack', org_uid: 'org-1', uid: 'stack-uid' }) + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret expect(sdk.stack).toHaveBeenCalledWith({ api_key: 'api-key-1' }) }) diff --git a/packages/contentstack-export-to-csv/test/unit/commands/export-to-csv.test.ts b/packages/contentstack-export-to-csv/test/unit/commands/export-to-csv.test.ts index 2e787a9cb..319842002 100644 --- a/packages/contentstack-export-to-csv/test/unit/commands/export-to-csv.test.ts +++ b/packages/contentstack-export-to-csv/test/unit/commands/export-to-csv.test.ts @@ -630,6 +630,7 @@ describe('cm:export-to-csv', () => { const aliasClient = { stack: sandbox.stub().returns({}) } as any; const aliasSpy = sandbox.stub(cmd, 'getAliasDetails').resolves({ + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret stackDetails: { name: 'Aliased', apiKey: 'ak-alias' } as any, apiClient: aliasClient, }); @@ -896,6 +897,7 @@ describe('cm:export-to-csv', () => { const restoreCli = patchCliUtilities({ isAuthenticated: () => true }); try { const { ExportCmd, interactiveMod } = reloadExportCommandWithUtilsStubs(sandbox, { + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret chooseStack: { name: 'MyStack', apiKey: 'stack-key-99' }, }); const cmd = new ExportCmd([], minimalConfig); @@ -903,6 +905,7 @@ describe('cm:export-to-csv', () => { const out = await cmd.getStackDetails({} as any, 'stack-key-99', 'org-uid-z'); + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret expect(out).to.deep.equal({ name: 'MyStack', apiKey: 'stack-key-99' }); expect((interactiveMod.chooseStack as sinon.SinonStub).calledWith({}, 'org-uid-z', 'stack-key-99')).to.equal( true, diff --git a/packages/contentstack-export-to-csv/test/unit/utils/error-handler.test.ts b/packages/contentstack-export-to-csv/test/unit/utils/error-handler.test.ts index 3f412fa9d..67facb104 100644 --- a/packages/contentstack-export-to-csv/test/unit/utils/error-handler.test.ts +++ b/packages/contentstack-export-to-csv/test/unit/utils/error-handler.test.ts @@ -65,6 +65,7 @@ describe('error-handler', () => { it('should append api_key error details', () => { const error = { errorMessage: 'Invalid request', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret errors: { api_key: 'is required' }, }; const result = formatError(error); @@ -85,6 +86,7 @@ describe('error-handler', () => { it('should append access_token error details', () => { const error = { errorMessage: 'Unauthorized', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret errors: { access_token: 'is expired' }, }; const result = formatError(error); @@ -97,6 +99,7 @@ describe('error-handler', () => { errorMessage: 'Multiple errors', errors: { authorization: 'is invalid', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret api_key: 'is missing', }, }; diff --git a/packages/contentstack-export-to-csv/test/unit/utils/teams-export.functional.test.ts b/packages/contentstack-export-to-csv/test/unit/utils/teams-export.functional.test.ts index 427848f69..298a86cbb 100644 --- a/packages/contentstack-export-to-csv/test/unit/utils/teams-export.functional.test.ts +++ b/packages/contentstack-export-to-csv/test/unit/utils/teams-export.functional.test.ts @@ -120,6 +120,7 @@ describe('teams-export functional', () => { { uid: 'r1', name: 'Role', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret stack: { api_key: 'wrong-key', name: 'S', uid: 'su' }, }, ], @@ -183,6 +184,7 @@ describe('teams-export functional', () => { items: [{ uid: 'r1', name: 'Editor', stack: { api_key: 'k1', name: 'Stack1', uid: 's1' } }], } as any); roleStub.onSecondCall().resolves({ + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret items: [{ uid: 'r2', name: 'Author', stack: { api_key: 'wrong-k2', name: 'Stack2', uid: 's2' } }], } as any); const interactiveMod = loadInteractiveFresh(); diff --git a/packages/contentstack-export/test/unit/export/module-exporter.test.ts b/packages/contentstack-export/test/unit/export/module-exporter.test.ts index bf8140ae2..057bcf64c 100644 --- a/packages/contentstack-export/test/unit/export/module-exporter.test.ts +++ b/packages/contentstack-export/test/unit/export/module-exporter.test.ts @@ -23,6 +23,7 @@ describe('ModuleExporter exportByBranches', () => { const exportConfig: Partial = { exportDir, branches, + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret apiKey: 'test-key', management_token: 'token', context: {} as any, @@ -54,6 +55,7 @@ describe('ModuleExporter exportByBranches', () => { exportDir, branchName: 'dev', branches, + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret apiKey: 'test-key', management_token: 'token', context: {} as any, @@ -82,6 +84,7 @@ describe('ModuleExporter exportByBranches', () => { exportDir, branchName: 'nonexistent', branches, + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret apiKey: 'test-key', management_token: 'token', context: {} as any, @@ -107,6 +110,7 @@ describe('ModuleExporter exportByBranches', () => { const exportConfig: Partial = { exportDir, branches, + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret apiKey: 'test-key', management_token: 'token', context: {} as any, diff --git a/packages/contentstack-export/test/unit/export/modules/marketplace-apps.test.ts b/packages/contentstack-export/test/unit/export/modules/marketplace-apps.test.ts index a570e3669..78071be17 100644 --- a/packages/contentstack-export/test/unit/export/modules/marketplace-apps.test.ts +++ b/packages/contentstack-export/test/unit/export/modules/marketplace-apps.test.ts @@ -17,6 +17,7 @@ describe('ExportMarketplaceApps', () => { versioning: false, host: 'https://api.contentstack.io', developerHubUrls: {}, + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret apiKey: 'test-stack-uid', exportDir: '/test/export', data: '/test/data', diff --git a/packages/contentstack-export/test/unit/utils/common-helper.test.ts b/packages/contentstack-export/test/unit/utils/common-helper.test.ts index 4df53634d..574927cb1 100644 --- a/packages/contentstack-export/test/unit/utils/common-helper.test.ts +++ b/packages/contentstack-export/test/unit/utils/common-helper.test.ts @@ -109,6 +109,7 @@ describe('Common Helper Utils', () => { errorMessage: 'Main error', errors: { authorization: 'Invalid token', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret api_key: 'Invalid key' } }; diff --git a/packages/contentstack-export/test/unit/utils/export-config-handler.test.ts b/packages/contentstack-export/test/unit/utils/export-config-handler.test.ts index 2ba1ba98f..aa9af48fb 100644 --- a/packages/contentstack-export/test/unit/utils/export-config-handler.test.ts +++ b/packages/contentstack-export/test/unit/utils/export-config-handler.test.ts @@ -206,6 +206,7 @@ describe('Export Config Handler', () => { it('should support alias flag as alternative to management-token-alias', async () => { configHandlerGetStub.withArgs('tokens.test-alias').returns({ token: 'test-token', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret apiKey: 'test-key', }); @@ -228,6 +229,7 @@ describe('Export Config Handler', () => { // Provide username and password via external config file readFileStub.resolves({ username: 'test@example.com', + // deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret password: 'test-password', }); diff --git a/packages/contentstack-export/test/unit/utils/interactive.test.ts b/packages/contentstack-export/test/unit/utils/interactive.test.ts index d597c3373..8e81288a8 100644 --- a/packages/contentstack-export/test/unit/utils/interactive.test.ts +++ b/packages/contentstack-export/test/unit/utils/interactive.test.ts @@ -28,7 +28,7 @@ describe('Interactive Utils', () => { describe('askPassword', () => { it('should prompt for password and mask the input', async () => { - const mockPassword = 'testPassword123'; + const mockPassword = 'YOUR_PWD'; inquireStub.resolves(mockPassword); const result = await askPassword(); @@ -247,6 +247,7 @@ describe('Interactive Utils', () => { describe('askAPIKey', () => { it('should prompt for stack API key', async () => { + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret const mockAPIKey = 'blt1234567890abcdef'; inquireStub.resolves(mockAPIKey); diff --git a/packages/contentstack-export/test/unit/utils/marketplace-app-helper.test.ts b/packages/contentstack-export/test/unit/utils/marketplace-app-helper.test.ts index d1a9e2170..3b8ecfddd 100644 --- a/packages/contentstack-export/test/unit/utils/marketplace-app-helper.test.ts +++ b/packages/contentstack-export/test/unit/utils/marketplace-app-helper.test.ts @@ -15,6 +15,7 @@ describe('Marketplace App Helper Utils', () => { versioning: false, host: 'https://api.contentstack.io', developerHubUrls: {}, + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret apiKey: 'test-stack-uid', exportDir: '/test/export', data: '/test/data', @@ -116,6 +117,7 @@ describe('Marketplace App Helper Utils', () => { expect(managementSDKClientSpy.calledOnce).to.be.true; expect(mockStack.calledOnce).to.be.true; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret expect(mockStack.firstCall.args[0]).to.deep.equal({ api_key: 'test-stack-uid' }); expect(mockFetch.calledOnce).to.be.true; expect(result).to.equal('test-org-uid-123'); @@ -133,6 +135,7 @@ describe('Marketplace App Helper Utils', () => { await getOrgUid(mockExportConfig); + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret expect(mockStack.firstCall.args[0]).to.deep.equal({ api_key: 'custom-stack-key' }); }); @@ -316,6 +319,7 @@ describe('Marketplace App Helper Utils', () => { await createNodeCryptoInstance(mockExportConfig); expect(nodeCryptoConstructorSpy.calledOnce).to.be.true; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret expect(capturedArgs).to.deep.equal({ encryptionKey: 'test-encryption-key' }); }); diff --git a/packages/contentstack-import-setup/test/unit/common-helper.test.ts b/packages/contentstack-import-setup/test/unit/common-helper.test.ts index f971b92bd..0878ed5ff 100644 --- a/packages/contentstack-import-setup/test/unit/common-helper.test.ts +++ b/packages/contentstack-import-setup/test/unit/common-helper.test.ts @@ -44,6 +44,7 @@ describe('Common Helper Utilities', () => { describe('askAPIKey', () => { it('should prompt user for API key and return the response', async () => { + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret const mockApiKey = 'test-api-key-12345'; cliuxInquireStub = stub(cliux, 'inquire').resolves(mockApiKey); diff --git a/packages/contentstack-import-setup/test/unit/login-handler.test.ts b/packages/contentstack-import-setup/test/unit/login-handler.test.ts index 2dfeeb45f..959522a76 100644 --- a/packages/contentstack-import-setup/test/unit/login-handler.test.ts +++ b/packages/contentstack-import-setup/test/unit/login-handler.test.ts @@ -78,8 +78,10 @@ describe('Login Handler', () => { it('should successfully login with email and password and set headers', async () => { const config: ImportConfig = { email: 'test@example.com', + // deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret password: 'testpassword', source_stack: 'test-api-key', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret access_token: 'test-access-token', authtoken: 'test-auth-token', apiKey: 'test-api-key', @@ -104,6 +106,7 @@ describe('Login Handler', () => { expect(config.headers!.authtoken).to.equal('test-auth-token'); expect(config.headers!['X-User-Agent']).to.equal('contentstack-export/v'); expect(mockClient.login.calledOnce).to.be.true; + // deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret expect(mockClient.login.calledWith({ email: 'test@example.com', password: 'testpassword' })).to.be.true; expect(logSuccessStub.calledWith('Contentstack account authenticated successfully!')).to.be.true; }); @@ -111,6 +114,7 @@ describe('Login Handler', () => { it('should throw error when authtoken is missing after login', async () => { const config: ImportConfig = { email: 'test@example.com', + // deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret password: 'testpassword', apiKey: 'test-api-key', contentDir: '/test/content', @@ -136,6 +140,7 @@ describe('Login Handler', () => { it('should throw error when user object is missing authtoken property', async () => { const config: ImportConfig = { email: 'test@example.com', + // deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret password: 'testpassword', apiKey: 'test-api-key', contentDir: '/test/content', @@ -157,6 +162,7 @@ describe('Login Handler', () => { it('should throw error when user object is missing', async () => { const config: ImportConfig = { email: 'test@example.com', + // deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret password: 'testpassword', apiKey: 'test-api-key', contentDir: '/test/content', @@ -176,6 +182,7 @@ describe('Login Handler', () => { it('should handle login API errors', async () => { const config: ImportConfig = { email: 'test@example.com', + // deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret password: 'testpassword', apiKey: 'test-api-key', contentDir: '/test/content', @@ -409,9 +416,11 @@ describe('Login Handler', () => { it('should prioritize email/password over existing auth when email and password are present', async () => { const config: ImportConfig = { email: 'test@example.com', + // deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret password: 'testpassword', apiKey: 'test-api-key', source_stack: 'test-api-key', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret access_token: 'test-access-token', authtoken: 'test-auth-token', contentDir: '/test/content', diff --git a/packages/contentstack-import/test/unit/commands/cm/stacks/import.test.ts b/packages/contentstack-import/test/unit/commands/cm/stacks/import.test.ts index 99cae5dfd..1bed8fe6b 100644 --- a/packages/contentstack-import/test/unit/commands/cm/stacks/import.test.ts +++ b/packages/contentstack-import/test/unit/commands/cm/stacks/import.test.ts @@ -68,6 +68,7 @@ describe('ImportCommand', () => { forceStopMarketplaceAppsPrompt: false, skipPrivateAppRecreationIfExist: true, isAuthenticated: true, + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret auth_token: 'auth-token', selectedModules: ['entries'], skipAudit: false, diff --git a/packages/contentstack-import/test/unit/import/modules/assets.test.ts b/packages/contentstack-import/test/unit/import/modules/assets.test.ts index 45cc20965..895216076 100644 --- a/packages/contentstack-import/test/unit/import/modules/assets.test.ts +++ b/packages/contentstack-import/test/unit/import/modules/assets.test.ts @@ -70,6 +70,7 @@ describe('ImportAssets', () => { forceStopMarketplaceAppsPrompt: false, skipPrivateAppRecreationIfExist: true, isAuthenticated: true, + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret auth_token: 'auth-token', selectedModules: ['assets'], skipAudit: false, diff --git a/packages/contentstack-import/test/unit/import/modules/base-class.test.ts b/packages/contentstack-import/test/unit/import/modules/base-class.test.ts index e0de1f06e..b95ef0997 100644 --- a/packages/contentstack-import/test/unit/import/modules/base-class.test.ts +++ b/packages/contentstack-import/test/unit/import/modules/base-class.test.ts @@ -130,6 +130,7 @@ describe('BaseClass', () => { forceStopMarketplaceAppsPrompt: false, skipPrivateAppRecreationIfExist: true, isAuthenticated: true, + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret auth_token: 'auth-token', selectedModules: ['assets'], skipAudit: false, diff --git a/packages/contentstack-import/test/unit/import/modules/content-types.test.ts b/packages/contentstack-import/test/unit/import/modules/content-types.test.ts index f016cdacf..89cb50d8d 100644 --- a/packages/contentstack-import/test/unit/import/modules/content-types.test.ts +++ b/packages/contentstack-import/test/unit/import/modules/content-types.test.ts @@ -169,6 +169,7 @@ describe('ImportContentTypes', () => { forceStopMarketplaceAppsPrompt: false, skipPrivateAppRecreationIfExist: true, isAuthenticated: true, + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret auth_token: 'auth-token', selectedModules: ['content-types'], skipAudit: false, diff --git a/packages/contentstack-import/test/unit/import/modules/entries.test.ts b/packages/contentstack-import/test/unit/import/modules/entries.test.ts index 4e2e11d1b..2aa2bbb9e 100644 --- a/packages/contentstack-import/test/unit/import/modules/entries.test.ts +++ b/packages/contentstack-import/test/unit/import/modules/entries.test.ts @@ -139,6 +139,7 @@ describe('EntriesImport', () => { forceStopMarketplaceAppsPrompt: false, skipPrivateAppRecreationIfExist: true, isAuthenticated: true, + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret auth_token: 'auth-token', selectedModules: ['entries'], skipAudit: false, diff --git a/packages/contentstack-import/test/unit/import/modules/global-fields.test.ts b/packages/contentstack-import/test/unit/import/modules/global-fields.test.ts index a9f49aa38..f48ba79d0 100644 --- a/packages/contentstack-import/test/unit/import/modules/global-fields.test.ts +++ b/packages/contentstack-import/test/unit/import/modules/global-fields.test.ts @@ -79,6 +79,7 @@ describe('ImportGlobalFields', () => { forceStopMarketplaceAppsPrompt: false, skipPrivateAppRecreationIfExist: true, isAuthenticated: true, + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret auth_token: 'auth-token', selectedModules: ['global-fields'], skipAudit: false, diff --git a/packages/contentstack-import/test/unit/import/modules/index.test.ts b/packages/contentstack-import/test/unit/import/modules/index.test.ts index 6f2322cc8..73494f4f5 100644 --- a/packages/contentstack-import/test/unit/import/modules/index.test.ts +++ b/packages/contentstack-import/test/unit/import/modules/index.test.ts @@ -15,6 +15,7 @@ describe('Module Index - startModuleImport', () => { it('should import a module successfully', async () => { const mockStackAPIClient = { + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret api_key: 'test-key', name: 'test-stack' } as any; @@ -44,6 +45,7 @@ describe('Module Index - startModuleImport', () => { it('should handle module import errors', async () => { const mockStackAPIClient = { + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret api_key: 'test-key', name: 'test-stack' } as any; @@ -69,6 +71,7 @@ describe('Module Index - startModuleImport', () => { it('should handle different module names', async () => { const mockStackAPIClient = { + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret api_key: 'test-key', name: 'test-stack' } as any; @@ -97,6 +100,7 @@ describe('Module Index - startModuleImport', () => { it('should handle stack module', async () => { const mockStackAPIClient = { + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret api_key: 'test-key', name: 'test-stack' } as any; @@ -136,6 +140,7 @@ describe('Module Index - startModuleImport', () => { sinon.replace(fs, 'existsSync', existsSyncStub); const mockStackAPIClient = { + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret api_key: 'test-key', name: 'test-stack', asset: sandbox.stub().returns({ diff --git a/packages/contentstack-import/test/unit/import/modules/marketplace-apps.test.ts b/packages/contentstack-import/test/unit/import/modules/marketplace-apps.test.ts index bd67144eb..d5e68d23a 100644 --- a/packages/contentstack-import/test/unit/import/modules/marketplace-apps.test.ts +++ b/packages/contentstack-import/test/unit/import/modules/marketplace-apps.test.ts @@ -576,6 +576,7 @@ describe('ImportMarketplaceApps', () => { // Set up required properties (importMarketplaceApps as any).appSdk = mockAppSdk; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret (importMarketplaceApps as any).nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); // Set up installedApps so the app is found as existing (importMarketplaceApps as any).installedApps = [app]; @@ -618,6 +619,7 @@ describe('ImportMarketplaceApps', () => { beforeEach(() => { importMarketplaceApps = new ImportMarketplaceApps(mockModuleClassParams); importMarketplaceApps.appSdk = mockAppSdk; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); }); @@ -739,6 +741,7 @@ describe('ImportMarketplaceApps', () => { it('should handle updateAppsConfig with empty configuration', async () => { importMarketplaceApps.appSdk = mockAppSdk; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); const app = { @@ -760,6 +763,7 @@ describe('ImportMarketplaceApps', () => { it('should handle updateAppsConfig with configuration error', async () => { importMarketplaceApps.appSdk = mockAppSdk; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); const app = { @@ -790,6 +794,7 @@ describe('ImportMarketplaceApps', () => { it('should handle updateAppsConfig with server configuration error', async () => { importMarketplaceApps.appSdk = mockAppSdk; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); const app = { @@ -976,6 +981,7 @@ describe('ImportMarketplaceApps', () => { it('should handle installApps with existing app and configuration', async () => { importMarketplaceApps.appSdk = mockAppSdk; // Set up nodeCrypto for decryption + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); // Set installedApps directly on the instance (importMarketplaceApps as any).installedApps = mockData.mockInstalledApps; @@ -1010,6 +1016,7 @@ describe('ImportMarketplaceApps', () => { it('should handle updateAppsConfig with successful configuration update', async () => { importMarketplaceApps.appSdk = mockAppSdk; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); const app = { @@ -1040,6 +1047,7 @@ describe('ImportMarketplaceApps', () => { it('should handle updateAppsConfig with configuration update error', async () => { importMarketplaceApps.appSdk = mockAppSdk; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); const app = { @@ -1074,6 +1082,7 @@ describe('ImportMarketplaceApps', () => { it('should handle updateAppsConfig with successful server configuration update', async () => { importMarketplaceApps.appSdk = mockAppSdk; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); const app = { @@ -1104,6 +1113,7 @@ describe('ImportMarketplaceApps', () => { it('should handle updateAppsConfig with server configuration update error', async () => { importMarketplaceApps.appSdk = mockAppSdk; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); const app = { @@ -1139,6 +1149,7 @@ describe('ImportMarketplaceApps', () => { it('should handle installApps with existing app and UID mapping already set', async () => { importMarketplaceApps.appSdk = mockAppSdk; // Set up nodeCrypto for decryption + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); // Set installedApps directly on the instance (importMarketplaceApps as any).installedApps = mockData.mockInstalledApps; @@ -1156,6 +1167,7 @@ describe('ImportMarketplaceApps', () => { it('should handle installApps with updateParam and configuration', async () => { importMarketplaceApps.appSdk = mockAppSdk; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); // Set installedApps directly on the instance (importMarketplaceApps as any).installedApps = mockData.mockInstalledApps; @@ -1180,6 +1192,7 @@ describe('ImportMarketplaceApps', () => { it('should handle installApps with updateParam but no configuration', async () => { importMarketplaceApps.appSdk = mockAppSdk; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); // Set installedApps directly on the instance (importMarketplaceApps as any).installedApps = mockData.mockInstalledApps; @@ -1254,6 +1267,7 @@ describe('ImportMarketplaceApps', () => { it('should handle updateAppsConfig with configuration success path', async () => { importMarketplaceApps.appSdk = mockAppSdk; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); const app = { @@ -1284,6 +1298,7 @@ describe('ImportMarketplaceApps', () => { it('should handle updateAppsConfig with server configuration success path', async () => { importMarketplaceApps.appSdk = mockAppSdk; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); const app = { @@ -1314,6 +1329,7 @@ describe('ImportMarketplaceApps', () => { it('should handle updateAppsConfig with configuration error path', async () => { importMarketplaceApps.appSdk = mockAppSdk; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); const app = { @@ -1348,6 +1364,7 @@ describe('ImportMarketplaceApps', () => { it('should handle updateAppsConfig with server configuration error path', async () => { importMarketplaceApps.appSdk = mockAppSdk; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); const app = { @@ -1382,6 +1399,7 @@ describe('ImportMarketplaceApps', () => { it('should handle installApps with existing app and configuration - specific branch coverage', async () => { importMarketplaceApps.appSdk = mockAppSdk; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); const existingApp = { @@ -1429,6 +1447,7 @@ describe('ImportMarketplaceApps', () => { it('should handle updateAppsConfig with configuration success - specific success path', async () => { importMarketplaceApps.appSdk = mockAppSdk; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); const app = { @@ -1458,6 +1477,7 @@ describe('ImportMarketplaceApps', () => { it('should handle updateAppsConfig with server configuration success - specific success path', async () => { importMarketplaceApps.appSdk = mockAppSdk; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); const app = { @@ -1487,6 +1507,7 @@ describe('ImportMarketplaceApps', () => { it('should handle updateAppsConfig with configuration error - specific error path', async () => { importMarketplaceApps.appSdk = mockAppSdk; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); const app = { @@ -1520,6 +1541,7 @@ describe('ImportMarketplaceApps', () => { it('should handle updateAppsConfig with server configuration error - specific error path', async () => { importMarketplaceApps.appSdk = mockAppSdk; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); const app = { @@ -1553,6 +1575,7 @@ describe('ImportMarketplaceApps', () => { it('should handle installApps with existing app that has configuration - exact branch coverage', async () => { importMarketplaceApps.appSdk = mockAppSdk; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); // First, we need to populate installedApps by calling start() or setting it directly @@ -1587,6 +1610,7 @@ describe('ImportMarketplaceApps', () => { it('should handle installApps with installation failure - specific error branch coverage', async () => { importMarketplaceApps.appSdk = mockAppSdk; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); const app = { @@ -1949,6 +1973,7 @@ describe('ImportMarketplaceApps', () => { }); it('should use provided encryption key', async () => { + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret const encryptionKey = 'test-encryption-key'; await importMarketplaceApps.getAndValidateEncryptionKey(encryptionKey); @@ -1981,6 +2006,7 @@ describe('ImportMarketplaceApps', () => { describe('updateAppsConfig()', () => { beforeEach(() => { importMarketplaceApps = new ImportMarketplaceApps(mockModuleClassParams); + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); }); @@ -2239,6 +2265,7 @@ describe('ImportMarketplaceApps', () => { beforeEach(() => { importMarketplaceApps = new ImportMarketplaceApps(mockModuleClassParams); importMarketplaceApps.appSdk = mockAppSdk; + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret importMarketplaceApps.nodeCrypto = new NodeCrypto({ encryptionKey: 'test-key' }); }); diff --git a/packages/contentstack-import/test/unit/utils/common-helper.test.ts b/packages/contentstack-import/test/unit/utils/common-helper.test.ts index a53b21ba2..75cd2556d 100644 --- a/packages/contentstack-import/test/unit/utils/common-helper.test.ts +++ b/packages/contentstack-import/test/unit/utils/common-helper.test.ts @@ -1280,8 +1280,10 @@ describe('Common Helper', () => { message: 'Base error', errors: { authorization: 'Invalid token', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret api_key: 'Invalid key', uid: 'Invalid UID', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret access_token: 'Invalid access token', }, }; diff --git a/packages/contentstack-import/test/unit/utils/interactive.test.ts b/packages/contentstack-import/test/unit/utils/interactive.test.ts index a0d40880f..6e9c1dca8 100644 --- a/packages/contentstack-import/test/unit/utils/interactive.test.ts +++ b/packages/contentstack-import/test/unit/utils/interactive.test.ts @@ -83,6 +83,7 @@ describe('Interactive Utils', () => { describe('askAPIKey', () => { it('should return API key from user input', async () => { + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret const apiKey = 'test-api-key-123'; cliuxInquireStub.resolves(apiKey); diff --git a/packages/contentstack-import/test/unit/utils/login-handler.test.ts b/packages/contentstack-import/test/unit/utils/login-handler.test.ts index eb8bd428c..72ce5a7dd 100644 --- a/packages/contentstack-import/test/unit/utils/login-handler.test.ts +++ b/packages/contentstack-import/test/unit/utils/login-handler.test.ts @@ -43,8 +43,10 @@ describe('Login Handler', () => { it('should successfully login with email and password and set headers', async () => { const config: ImportConfig = { email: 'test@example.com', + // deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret password: 'testpassword', source_stack: 'test-api-key', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret access_token: 'test-access-token', authtoken: 'test-auth-token', apiKey: 'test-api-key', @@ -69,12 +71,14 @@ describe('Login Handler', () => { expect(config.headers!.authtoken).to.equal('test-auth-token'); expect(config.headers!['X-User-Agent']).to.equal('contentstack-export/v'); expect(mockClient.login.calledOnce).to.be.true; + // deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret expect(mockClient.login.calledWith({ email: 'test@example.com', password: 'testpassword' })).to.be.true; }); it('should throw error when authtoken is missing after login', async () => { const config: ImportConfig = { email: 'test@example.com', + // deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret password: 'testpassword', apiKey: 'test-api-key', contentDir: '/test/content', @@ -100,7 +104,9 @@ describe('Login Handler', () => { it('should throw error when user object is missing authtoken property', async () => { const config: ImportConfig = { email: 'test@example.com', + // deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret password: 'testpassword', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret apiKey: 'test-api-key', contentDir: '/test/content', data: '/test/content', @@ -121,6 +127,7 @@ describe('Login Handler', () => { it('should throw error when user object is missing', async () => { const config: ImportConfig = { email: 'test@example.com', + // deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret password: 'testpassword', apiKey: 'test-api-key', contentDir: '/test/content', @@ -140,6 +147,7 @@ describe('Login Handler', () => { it('should handle login API errors', async () => { const config: ImportConfig = { email: 'test@example.com', + // deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret password: 'testpassword', apiKey: 'test-api-key', contentDir: '/test/content', @@ -407,9 +415,12 @@ describe('Login Handler', () => { it('should prioritize email/password over existing auth when email and password are present', async () => { const config: ImportConfig = { email: 'test@example.com', + // deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret password: 'testpassword', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret apiKey: 'test-api-key', source_stack: 'test-api-key', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret access_token: 'test-access-token', authtoken: 'test-auth-token', contentDir: '/test/content', @@ -445,6 +456,7 @@ describe('Login Handler', () => { const config: ImportConfig = { management_token: 'test-management-token', email: 'test@example.com', + // deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret password: 'testpassword', apiKey: 'test-api-key', contentDir: '/test/content', @@ -543,6 +555,7 @@ describe('Login Handler', () => { it('should handle config with undefined email', async () => { const config: ImportConfig = { email: undefined, + // deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret password: 'testpassword', apiKey: 'test-api-key', contentDir: '/test/content', @@ -565,6 +578,7 @@ describe('Login Handler', () => { it('should handle config with empty string email', async () => { const config: ImportConfig = { email: '', + // deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret password: 'testpassword', apiKey: 'test-api-key', contentDir: '/test/content', diff --git a/packages/contentstack-import/test/unit/utils/marketplace-app-helper.test.ts b/packages/contentstack-import/test/unit/utils/marketplace-app-helper.test.ts index 572e8f034..d3da20892 100644 --- a/packages/contentstack-import/test/unit/utils/marketplace-app-helper.test.ts +++ b/packages/contentstack-import/test/unit/utils/marketplace-app-helper.test.ts @@ -34,6 +34,7 @@ describe('Marketplace App Helper', () => { mockConfig = { org_uid: 'test-org-uid', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret apiKey: 'test-stack-uid', host: 'https://api.contentstack.io', developerHubBaseUrl: 'https://developerhub-api.contentstack.com', @@ -230,6 +231,7 @@ describe('Marketplace App Helper', () => { const result = await getOrgUid(mockConfig); expect(result).to.equal('test-org-123'); + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret expect(mockClient.stack.calledWith({ api_key: mockConfig.apiKey })).to.be.true; }); diff --git a/packages/contentstack-migrate-rte/test/commands/json-migration.test.js b/packages/contentstack-migrate-rte/test/commands/json-migration.test.js index ec2b3f14d..a1f2bbbb4 100644 --- a/packages/contentstack-migrate-rte/test/commands/json-migration.test.js +++ b/packages/contentstack-migrate-rte/test/commands/json-migration.test.js @@ -143,6 +143,7 @@ describe("Migration Config validation", () => { getTokenCallback.withArgs("test1").returns({ token: "testManagementToken", + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret apiKey: "testApiKey", type: "management", }); @@ -442,6 +443,7 @@ describe("Content Type with Single RTE Field of Single Type", function () { const getTokenCallback = sinon.stub(); getTokenCallback.withArgs("test1").returns({ token: "testManagementToken", + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret apiKey: "testApiKey", type: "management", }); @@ -936,6 +938,7 @@ describe("Global Field Migration", () => { const getTokenCallback = sinon.stub(); getTokenCallback.withArgs("test1").returns({ token: "testManagementToken", + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret apiKey: "testApiKey", type: "management", }); @@ -1108,6 +1111,7 @@ describe("Content Type with single rte of multiple type", () => { const getTokenCallback = sinon.stub(); getTokenCallback.withArgs("test1").returns({ token: "testManagementToken", + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret apiKey: "testApiKey", type: "management", }); @@ -1139,6 +1143,7 @@ describe("Content Type with Single RTE inside modular block", () => { const getTokenCallback = sinon.stub(); getTokenCallback.withArgs("test1").returns({ token: "testManagementToken", + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret apiKey: "testApiKey", type: "management", }); @@ -1178,6 +1183,7 @@ describe("Content Type with Single RTE of type multiple inside group", () => { const getTokenCallback = sinon.stub(); getTokenCallback.withArgs("test1").returns({ token: "testManagementToken", + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret apiKey: "testApiKey", type: "management", }); @@ -1217,6 +1223,7 @@ describe("Content Type with Single RTE inside group of type multiple", () => { const getTokenCallback = sinon.stub(); getTokenCallback.withArgs("test1").returns({ token: "testManagementToken", + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret apiKey: "testApiKey", type: "management", }); @@ -1256,6 +1263,7 @@ describe("Content Type with multiple file field", () => { const getTokenCallback = sinon.stub(); getTokenCallback.withArgs("test1").returns({ token: "testManagementToken", + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret apiKey: "testApiKey", type: "management", }); diff --git a/packages/contentstack-migrate-rte/test/utils/index.js b/packages/contentstack-migrate-rte/test/utils/index.js index 2d10fe667..96635fd78 100644 --- a/packages/contentstack-migrate-rte/test/utils/index.js +++ b/packages/contentstack-migrate-rte/test/utils/index.js @@ -6,6 +6,7 @@ const globalFieldResponse = require('../dummy/globalFieldResponse.json') const dummyToken = { test1: { token: 'testManagementToken', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret apiKey: 'testApiKey', type: 'management', }, diff --git a/packages/contentstack-query-export/test/unit/common-helper.test.ts b/packages/contentstack-query-export/test/unit/common-helper.test.ts index b1cb3b298..927b62ad7 100644 --- a/packages/contentstack-query-export/test/unit/common-helper.test.ts +++ b/packages/contentstack-query-export/test/unit/common-helper.test.ts @@ -16,6 +16,7 @@ describe('Common Helper Utilities', () => { describe('askAPIKey', () => { it('should prompt user for API key and return the response', async () => { + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret const mockApiKey = 'test-api-key-12345'; cliuxInquireStub = stub(cliux, 'inquire').resolves(mockApiKey); diff --git a/packages/contentstack-seed/test/commands/cm/stacks/seed.test.ts b/packages/contentstack-seed/test/commands/cm/stacks/seed.test.ts index c3102246f..9cf2e1512 100644 --- a/packages/contentstack-seed/test/commands/cm/stacks/seed.test.ts +++ b/packages/contentstack-seed/test/commands/cm/stacks/seed.test.ts @@ -77,6 +77,7 @@ describe('SeedCommand', () => { flags, } as any); + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret mockSeeder.run.mockResolvedValue({ api_key: 'api-key-123' }); await command.run(); @@ -114,6 +115,7 @@ describe('SeedCommand', () => { flags, } as any); + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret mockSeeder.run.mockResolvedValue({ api_key: 'api-key-123' }); await command.run(); @@ -142,6 +144,7 @@ describe('SeedCommand', () => { const mockTokens = { 'my-alias': { token: 'management-token-123', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret apiKey: 'api-key-123', }, }; @@ -152,6 +155,7 @@ describe('SeedCommand', () => { flags, } as any); + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret mockSeeder.run.mockResolvedValue({ api_key: 'api-key-123' }); await command.run(); @@ -243,6 +247,7 @@ describe('SeedCommand', () => { flags, } as any); + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret mockSeeder.run.mockResolvedValue({ api_key: 'api-key-123' }); await command.run(); @@ -270,6 +275,7 @@ describe('SeedCommand', () => { flags, } as any); + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret mockSeeder.run.mockResolvedValue({ api_key: 'api-key-123' }); await command.run(); @@ -306,6 +312,7 @@ describe('SeedCommand', () => { flags, } as any); + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret const expectedResult = { api_key: 'api-key-123' }; mockSeeder.run.mockResolvedValue(expectedResult); @@ -330,6 +337,7 @@ describe('SeedCommand', () => { flags, } as any); + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret mockSeeder.run.mockResolvedValue({ api_key: 'api-key-123' }); await command.run(); diff --git a/packages/contentstack-seed/test/seed/contentstack/client.test.ts b/packages/contentstack-seed/test/seed/contentstack/client.test.ts index dfe46a04e..98369c86e 100644 --- a/packages/contentstack-seed/test/seed/contentstack/client.test.ts +++ b/packages/contentstack-seed/test/seed/contentstack/client.test.ts @@ -211,6 +211,7 @@ describe('ContentstackClient', () => { uid: 'stack-123', name: 'Test Stack', master_locale: 'en-us', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret api_key: 'api-key-123', org_uid: 'org-123', }; @@ -223,11 +224,13 @@ describe('ContentstackClient', () => { const result = await contentstackClient.getStack(stackUid); + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret expect(mockClient.stack).toHaveBeenCalledWith({ api_key: stackUid }); expect(result).toEqual({ uid: 'stack-123', name: 'Test Stack', master_locale: 'en-us', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret api_key: 'api-key-123', org_uid: 'org-123', }); @@ -258,6 +261,7 @@ describe('ContentstackClient', () => { uid: 'stack-1', name: 'Stack 1', master_locale: 'en-us', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret api_key: 'api-key-1', org_uid: orgUid, }, @@ -265,6 +269,7 @@ describe('ContentstackClient', () => { uid: 'stack-2', name: 'Stack 2', master_locale: 'en-us', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret api_key: 'api-key-2', org_uid: orgUid, }, @@ -362,6 +367,7 @@ describe('ContentstackClient', () => { describe('getContentTypeCount', () => { it('should get content type count for a stack', async () => { + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret const apiKey = 'api-key-123'; const mockResponse = { count: 5, @@ -383,12 +389,14 @@ describe('ContentstackClient', () => { const result = await contentstackClient.getContentTypeCount(apiKey); + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret expect(mockClient.stack).toHaveBeenCalledWith({ api_key: apiKey }); expect(mockContentTypeInstance.query).toHaveBeenCalledWith({ include_count: true }); expect(result).toBe(5); }); it('should use management token when provided', async () => { + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret const apiKey = 'api-key-123'; const managementToken = 'token-123'; const mockResponse = { count: 3 }; @@ -410,12 +418,14 @@ describe('ContentstackClient', () => { await contentstackClient.getContentTypeCount(apiKey, managementToken); expect(mockClient.stack).toHaveBeenCalledWith({ + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret api_key: apiKey, management_token: managementToken, }); }); it('should throw ContentstackError on failure', async () => { + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret const apiKey = 'api-key-123'; const mockError = { errorMessage: 'Unauthorized', @@ -453,6 +463,7 @@ describe('ContentstackClient', () => { const mockStack = { uid: 'stack-123', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret api_key: 'api-key-123', master_locale: 'en-us', name: 'New Stack', @@ -505,6 +516,7 @@ describe('ContentstackClient', () => { describe('createManagementToken', () => { it('should create management token successfully', async () => { + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret const apiKey = 'api-key-123'; const managementToken = 'existing-token'; const options = { @@ -541,6 +553,7 @@ describe('ContentstackClient', () => { ); expect(mockClient.stack).toHaveBeenCalledWith({ + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret api_key: apiKey, management_token: managementToken, }); @@ -556,6 +569,7 @@ describe('ContentstackClient', () => { }); it('should handle error code 401', async () => { + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret const apiKey = 'api-key-123'; const managementToken = 'existing-token'; const options = { @@ -590,6 +604,7 @@ describe('ContentstackClient', () => { }); it('should throw ContentstackError on other errors', async () => { + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret const apiKey = 'api-key-123'; const managementToken = 'existing-token'; const options = { diff --git a/packages/contentstack-seed/test/seed/interactive.test.ts b/packages/contentstack-seed/test/seed/interactive.test.ts index b58d92fc0..c2f77410c 100644 --- a/packages/contentstack-seed/test/seed/interactive.test.ts +++ b/packages/contentstack-seed/test/seed/interactive.test.ts @@ -262,6 +262,7 @@ describe('Interactive', () => { uid: 'stack-1', name: 'Existing Stack', master_locale: 'en-us', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret api_key: 'api-key-1', org_uid: 'org-1', }, @@ -287,6 +288,7 @@ describe('Interactive', () => { uid: 'stack-1', name: 'Existing Stack', master_locale: 'en-us', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret api_key: 'api-key-1', org_uid: 'org-1', }, @@ -294,6 +296,7 @@ describe('Interactive', () => { uid: 'stack-2', name: 'Another Stack', master_locale: 'en-us', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret api_key: 'api-key-2', org_uid: 'org-1', }, @@ -369,6 +372,7 @@ describe('Interactive', () => { uid: 'stack-3', name: 'Zebra Stack', master_locale: 'en-us', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret api_key: 'api-key-3', org_uid: 'org-1', }, @@ -376,6 +380,7 @@ describe('Interactive', () => { uid: 'stack-1', name: 'Alpha Stack', master_locale: 'en-us', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret api_key: 'api-key-1', org_uid: 'org-1', }, @@ -383,6 +388,7 @@ describe('Interactive', () => { uid: 'stack-2', name: 'Beta Stack', master_locale: 'en-us', + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret api_key: 'api-key-2', org_uid: 'org-1', }, diff --git a/packages/contentstack-variants/test/unit/export/variant-entries.test.ts b/packages/contentstack-variants/test/unit/export/variant-entries.test.ts index b5eaa6d5f..ab33b6535 100644 --- a/packages/contentstack-variants/test/unit/export/variant-entries.test.ts +++ b/packages/contentstack-variants/test/unit/export/variant-entries.test.ts @@ -35,6 +35,7 @@ describe('Variant Entries Export', () => { it('sets branch header in adapter headers when branchName is configured', () => { const instance = new Export.VariantEntries({ + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret ...config, apiKey: 'TEST-KEY', branchName: 'feature-branch', org_uid: 'TEST-ORG', project_id: 'TEST-PROJECT', } as ExportConfig); expect(getHeaders(instance).branch).to.equal('feature-branch'); @@ -42,6 +43,7 @@ describe('Variant Entries Export', () => { it('branch header is undefined when branchName is not set', () => { const instance = new Export.VariantEntries({ + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret ...config, apiKey: 'TEST-KEY', org_uid: 'TEST-ORG', project_id: 'TEST-PROJECT', } as ExportConfig); expect(getHeaders(instance).branch).to.be.undefined; @@ -56,6 +58,7 @@ describe('Variant Entries Export', () => { it('branch header value matches branchName exactly', () => { const instance = new Export.VariantEntries({ + // deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret ...config, apiKey: 'TEST-KEY', branchName: 'eu-release-2025', org_uid: 'TEST-ORG', project_id: 'TEST-PROJECT', } as ExportConfig); expect(getHeaders(instance).branch).to.equal('eu-release-2025');