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 @@ -22,7 +22,7 @@ describe('Tokens Remove Command', () => {
// Use correct token structure: { token, apiKey, type }
config.set(`${configKeyTokens}.${token1Alias}`, {
token: 'test-token-1',
apiKey: 'test-api-key-1',
apiKey: 'API_KEY',
type: 'management',
});
});
Expand Down Expand Up @@ -60,19 +60,19 @@ describe('Tokens Remove Command', () => {
// Use correct token structure: { token, apiKey, type }
config.set(`${configKeyTokens}.${token1Alias}`, {
token: 'test-token-1',
apiKey: 'test-api-key-1',
apiKey: 'API_KEY',
type: 'management',
});
config.set(`${configKeyTokens}.${token1Alias}2`, {
token: 'test-token-2',
apiKey: 'test-api-key-2',
apiKey: 'STACK_API_KEY',
type: 'management',
});

// The inquire stub should return the full token option string format: "alias: token : apiKey: type"
// Note: no space before the colon before type when there's no environment
const tokenOption1 = `${token1Alias}: test-token-1 : test-api-key-1: management`;
const tokenOption2 = `${token1Alias}2: test-token-2 : test-api-key-2: management`;
const tokenOption1 = `${token1Alias}: test-token-1 : API_KEY: management`;
const tokenOption2 = `${token1Alias}2: test-token-2 : STACK_API_KEY: management`;
const inquireStub = sinon.stub(cliux, 'inquire').resolves([tokenOption1, tokenOption2]);
await TokensRemoveCommand.run([]);
expect(inquireStub.called).to.be.true;
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-auth/test/unit/mfa-handler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as sinon from 'sinon';
import mfaHandler from '../../src/utils/mfa-handler';

describe('MFAHandler', () => {
const validSecret = 'JBSWY3DPEHPK3PXP'; // Example valid base32 secret
const validSecret = 'SECRETSECRETSECRET'; // Example valid base32 secret
const invalidSecret = 'invalid-secret';

let configStub: sinon.SinonStub;
Expand Down Expand Up @@ -57,7 +57,7 @@ describe('MFAHandler', () => {
});

it('should prioritize environment variable over stored configuration', async () => {
const envSecret = 'JBSWY3DPEHPK3PXQ'; // Different from stored secret
const envSecret = 'TOKENTOKENTOKENTOKEN'; // Different from stored secret
process.env.CONTENTSTACK_MFA_SECRET = envSecret;

const code = await mfaHandler.getMFACode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ describe('Auth Handler', () => {
const configOauthRefreshToken = 'valid_refresh_token';
const configAuthorisationType = authHandler.authorisationTypeOAUTHValue;
const expectedData = {
access_token: 'new_access_token',
access_token: 'ACCESS_TOKEN',
refresh_token: 'new_refresh_token',
};
// Stub oauthHandler with refreshAccessToken method
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-utilities/test/unit/logger.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('Logger', () => {

fancy.it('should redact sensitive keys', () => {
const testMeta = {
password: 'secret123',
password: 'PASSWORD',
token: 'tokenvalue',
email: 'user@example.com',
other: 'safe',
Expand Down
Loading
Loading