Skip to content
Open
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,8 +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',
apiKey: 'API_KEY',
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,8 +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',
apiKey: 'API_KEY',
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,8 +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',
apiKey: 'API_KEY',
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,8 +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',
apiKey: 'API_KEY',
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,8 +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',
apiKey: 'API_KEY',
host: 'https://api.contentstack.io/v3',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +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',
apiKey: 'API_KEY',
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,8 +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' } }]),
JSON.stringify([{ stackHeaders: { api_key: 'API_KEY' } }]),
);

stub(utilities.configHandler, 'get').withArgs('region').returns({
Expand All @@ -62,6 +61,6 @@ describe('detectAssetManagementExportFromContentDir', () => {
const flags = detectAssetManagementExportFromContentDir(tmpRoot);
expect(flags.assetManagementEnabled).to.equal(true);
expect(flags.assetManagementUrl).to.equal('https://am.example.com');
expect(flags.source_stack).to.equal('source-stack-key');
expect(flags.source_stack).to.equal('API_KEY');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ describe('Bootstrap Integration Tests', () => {
const mockOptions = {
cloneDirectory: '/test/path',
seedParams: {
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
stackAPIKey: 'test-key',
stackAPIKey: 'API_KEY',
managementTokenAlias: 'test-alias',
managementToken: 'test-token',
},
Expand Down Expand Up @@ -118,8 +117,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',
stackAPIKey: 'API_KEY',
org: 'test-org',
stackName: 'test-stack',
yes: 'yes',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -719,8 +719,7 @@ describe('BaseBulkCommand', () => {
(command as any).bulkOperationConfig = {
publishMode: 'bulk',
apiKey: undefined,
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
stackApiKey: 'fallback-key',
stackApiKey: 'API_KEY',
branch: 'main',
bulkOperationFolder: './bulk-operation',
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +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',
apiKey: 'API_KEY',
branch: 'main',
},
];
Expand Down Expand Up @@ -255,8 +254,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',
apiKey: 'API_KEY',
branch: 'main',
},
];
Expand Down Expand Up @@ -353,8 +351,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',
apiKey: 'API_KEY',
branch: 'main',
},
];
Expand Down Expand Up @@ -403,8 +400,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',
apiKey: 'API_KEY',
branch: 'main',
},
];
Expand Down Expand Up @@ -446,8 +442,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',
apiKey: 'API_KEY',
branch: 'main',
};

Expand All @@ -472,8 +467,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',
apiKey: 'API_KEY',
branch: 'main',
};

Expand All @@ -498,8 +492,7 @@ describe('Bulk Operation Log Handler', () => {
locales: [],
items: [],
status: 'success',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'test-key',
apiKey: 'API_KEY',
branch: 'main',
};

Expand Down Expand Up @@ -535,8 +528,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',
apiKey: 'API_KEY',
branch: 'main',
};

Expand Down Expand Up @@ -571,8 +563,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',
apiKey: 'API_KEY',
branch: 'main',
};

Expand All @@ -595,8 +586,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',
apiKey: 'API_KEY',
branch: 'main',
};

Expand Down Expand Up @@ -632,8 +622,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',
apiKey: 'API_KEY',
branch: 'main',
};

Expand All @@ -655,8 +644,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',
apiKey: 'API_KEY',
branch: 'main',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,15 +518,14 @@ describe('Config Builder Utilities', () => {
};

configHandlerGetStub.withArgs('tokens.test-alias').returns({
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'stack-from-alias',
apiKey: 'API_KEY',
token: 'cs-token-123',
});

const stackConfig = setupStackConfig(flags);

expect(stackConfig.alias).to.equal('test-alias');
expect(stackConfig.apiKey).to.equal('stack-from-alias');
expect(stackConfig.apiKey).to.equal('API_KEY');
expect(configHandlerGetStub.calledWith('tokens.test-alias')).to.be.true;
});

Expand All @@ -541,8 +540,7 @@ describe('Config Builder Utilities', () => {
};

configHandlerGetStub.withArgs('tokens.test-alias').returns({
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'stack-mgmt',
apiKey: 'API_KEY',
token: 'cs-mgmt-token',
type: 'management',
});
Expand All @@ -551,8 +549,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',
apiKey: 'API_KEY',
});

const stackConfig = setupStackConfig(flags);
Expand All @@ -573,8 +570,7 @@ describe('Config Builder Utilities', () => {
};

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

configHandlerGetStub.withArgs('tokens.test-alias').returns({
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'stack-mgmt',
apiKey: 'API_KEY',
token: 'cs-mgmt-token',
type: 'management',
});

configHandlerGetStub.withArgs('tokens.mgmt-alias').returns({
type: 'management',
token: 'cs-mgmt-token',
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'stack123',
apiKey: 'API_KEY',
});

expect(() => setupStackConfig(flags)).to.throw(/is not a delivery token/);
Expand All @@ -622,8 +616,7 @@ describe('Config Builder Utilities', () => {
};

configHandlerGetStub.withArgs('tokens.test-alias').returns({
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
apiKey: 'stack-mgmt',
apiKey: 'API_KEY',
token: 'cs-mgmt-token',
type: 'management',
});
Expand All @@ -632,8 +625,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',
apiKey: 'API_KEY',
});

const stackConfig = setupStackConfig(flags);
Expand All @@ -644,7 +636,7 @@ describe('Config Builder Utilities', () => {

it('should set custom CMA host', () => {
const flags: CommandFlags = {
'stack-api-key': 'stack123',
'stack-api-key': 'API_KEY',
operation: 'publish',
environments: ['dev'],
locales: ['en-us'],
Expand All @@ -657,7 +649,7 @@ describe('Config Builder Utilities', () => {

it('should set custom CDA host', () => {
const flags: CommandFlags = {
'stack-api-key': 'stack123',
'stack-api-key': 'API_KEY',
operation: 'publish',
environments: ['dev'],
locales: ['en-us'],
Expand All @@ -671,7 +663,7 @@ describe('Config Builder Utilities', () => {

it('should use default CDA host if not provided', () => {
const flags: CommandFlags = {
'stack-api-key': 'stack123',
'stack-api-key': 'API_KEY',
operation: 'publish',
environments: ['dev'],
locales: ['en-us'],
Expand All @@ -684,7 +676,7 @@ describe('Config Builder Utilities', () => {

it('should pass branch to stack config', () => {
const flags: CommandFlags = {
'stack-api-key': 'stack123',
'stack-api-key': 'API_KEY',
operation: 'publish',
environments: ['dev'],
locales: ['en-us'],
Expand All @@ -698,7 +690,7 @@ describe('Config Builder Utilities', () => {

it('should handle source-env without source-alias', () => {
const flags: CommandFlags = {
'stack-api-key': 'stack123',
'stack-api-key': 'API_KEY',
operation: 'publish',
'source-env': 'production',
environments: ['dev'],
Expand Down
Loading
Loading