Skip to content

Commit 22491aa

Browse files
authored
Merge pull request #2677 from RedisInsight/e2e/feature/RI-4481_hide_db_security_fields
e2e/feature/RI-4481_hide_database_passwords
2 parents e31b3b7 + 2215262 commit 22491aa

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

tests/e2e/tests/web/critical-path/database/clone-databases.e2e.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ test
100100
await myRedisDatabasePage.reloadPage();
101101
})
102102
.meta({ rte: rte.sentinel })('Verify that user can clone Sentinel', async t => {
103+
const hiddenPassword = '************';
104+
103105
await databaseHelper.clickOnEditDatabaseByName(ossSentinelConfig.masters[1].alias);
104106
await t.click(myRedisDatabasePage.AddRedisDatabase.cloneDatabaseButton);
105107

@@ -120,7 +122,7 @@ test
120122
await t
121123
.click(myRedisDatabasePage.AddRedisDatabase.cloneSentinelNavigation)
122124
.expect(myRedisDatabasePage.AddRedisDatabase.portInput.getAttribute('value')).eql(ossSentinelConfig.sentinelPort, 'Invalid sentinel port')
123-
.expect(myRedisDatabasePage.AddRedisDatabase.passwordInput.getAttribute('value')).eql(ossSentinelConfig.sentinelPassword, 'Invalid sentinel password');
125+
.expect(myRedisDatabasePage.AddRedisDatabase.passwordInput.getAttribute('value')).eql(hiddenPassword, 'Invalid sentinel password');
124126
// Clone Sentinel Primary Group
125127
await t.click(myRedisDatabasePage.AddRedisDatabase.addRedisDatabaseButton);
126128
await t.expect(myRedisDatabasePage.dbNameList.withExactText(ossSentinelConfig.masters[1].alias).count).gt(1, 'Primary Group was not cloned');

tests/e2e/tests/web/critical-path/database/import-databases.e2e.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ const dbData = [
7676
}
7777
];
7878
const findImportedRdmDbNameInList = async(dbName: string): Promise<string> => rdmData.dbImportedNames.find(item => item === dbName)!;
79+
const hiddenPassword = '************';
7980

8081
fixture `Import databases`
8182
.meta({ type: 'critical_path', rte: rte.none })
@@ -152,8 +153,8 @@ test('Connection import from JSON', async t => {
152153
// Verify username imported
153154
await t.expect(myRedisDatabasePage.AddRedisDatabase.usernameInput.value).eql(rdmListOfDB[1].username, 'Username import incorrect');
154155
// Verify password imported
155-
await t.click(myRedisDatabasePage.AddRedisDatabase.showPasswordBtn);
156-
await t.expect(myRedisDatabasePage.AddRedisDatabase.passwordInput.value).eql(rdmListOfDB[1].auth, 'Password import incorrect');
156+
// Verify that user can see 12 hidden characters regardless of the actual database password when it is set
157+
await t.expect(myRedisDatabasePage.AddRedisDatabase.passwordInput.value).eql(hiddenPassword, 'Password import incorrect');
157158

158159
// Verify cluster connection type imported
159160
await databaseHelper.clickOnEditDatabaseByName(rdmData.dbImportedNames[2]);
@@ -256,11 +257,12 @@ test('Import SSH parameters', async t => {
256257
await t.expect(myRedisDatabasePage.AddRedisDatabase.sshHostInput.value).eql(racompListOfSSHDB[0].sshHost, 'SSH host import incorrect');
257258
await t.expect(myRedisDatabasePage.AddRedisDatabase.sshPortInput.value).eql((racompListOfSSHDB[0].sshPort).toString(), 'SSH port import incorrect');
258259
await t.expect(myRedisDatabasePage.AddRedisDatabase.sshUsernameInput.value).eql(racompListOfSSHDB[0].sshUser, 'SSH username import incorrect');
259-
await t.expect(myRedisDatabasePage.AddRedisDatabase.sshPasswordInput.value).eql(racompListOfSSHDB[0].sshPassword, 'SSH password import incorrect');
260+
// Verify that password, passphrase and private key are hidden for SSH option
261+
await t.expect(myRedisDatabasePage.AddRedisDatabase.sshPasswordInput.value).eql(hiddenPassword, 'SSH password import incorrect');
260262

261263
await databaseHelper.clickOnEditDatabaseByName(racompListOfSSHDB[1].name);
262264
// Verify that user can import the SSH Private Key both by its value specified in the file and by the file path
263-
await t.expect(myRedisDatabasePage.AddRedisDatabase.sshPrivateKeyInput.textContent).contains(sshPrivateKey, 'SSH Private key import incorrect');
265+
await t.expect(myRedisDatabasePage.AddRedisDatabase.sshPrivateKeyInput.textContent).contains(hiddenPassword, 'SSH Private key import incorrect');
264266
// Verify that user can import the SSH parameters with Passcode
265-
await t.expect(myRedisDatabasePage.AddRedisDatabase.sshPassphraseInput.value).eql(racompListOfSSHDB[1].sshKeyPassphrase, 'SSH Passphrase import incorrect');
267+
await t.expect(myRedisDatabasePage.AddRedisDatabase.sshPassphraseInput.value).eql(hiddenPassword, 'SSH Passphrase import incorrect');
266268
});

0 commit comments

Comments
 (0)