Files
openobserve/tests/ui-testing/playwright-tests/GeneralTests/cipherKeys.spec.js
T
Shrinath RaoandClaude Sonnet 4.6 0929fa5678 test: Sentinel audit fixes + parallelize Metrics E2E shard (~22 min → ~5-7 min) (#12367)
## Summary

Two independent improvements to the Playwright E2E test suite.

---

### Part 1 — Sentinel audit fixes (original PR scope)

Fixes from the Sentinel audit review of PR #12358 (selector drift
stabilization).

- **Dead code removal**: delete `clickJobID()` from `logsPageEP.js`
(unreachable code containing `console.log`); remove unused `chromium`
import
- **Critical fix**: replace `console.log`/`console.error` in
`decryptLogSQL()` with `testLogger` equivalents
- **POM compliance**: replace raw `page.locator()` call in
`alerts-ui-operations.spec.js` `beforeEach` with
`pm.alertsPage.isIncidentsFeatureEnabled()`; add that method to
`alertsPage.js`
- **POM compliance**: move per-test `const pm = new PageManager(page)`
into `beforeEach` in `service-graph.spec.js`; replace raw
`page.waitForLoadState()` with
`pm.serviceGraphPage.waitForGraphReload()`; add `waitForGraphReload()`
to `serviceGraphPage.js`
- **Inline selector cleanup**: move metrics tab inline string literals
in `serviceGraphPage.js` into constructor properties
- **Tagging**: add
`@cipherKeys/@enterprise/@P1/@P2/@negative/@validation` to all 6 tests
in `cipherKeys.spec.js` (were untagged); add `@P1/@P2` to all 5 tests in
`regexPatternManagement.spec.js`
- **ESM fix**: correct `export const path = require('path')` → `import
path from 'path'` in `logoManagementPage.js`
- **Deduplication**: consolidate
`createFirstFunction`/`createSecondFunction` into shared
`createFunction(name, vrlCode)` in `pipelinesEP.js`

---

### Part 2 — Parallelize Metrics E2E shard

**Problem**: The `e2e / Metrics` CI shard was consistently the slowest
job at ~22 minutes per PR run, while all other shards complete in ~5-7
minutes.

**Root cause**: 9 of 11 Metrics spec files used
`test.describe.configure({ mode: 'serial' })` because they shared a
describe-scope `let pm` variable reassigned in `beforeEach`. This forced
every test in those files onto a single Playwright worker, eliminating
all parallelism despite `fullyParallel: true` and 5 workers being
configured.

**Fix applied to all 9 affected files** (`metrics.spec.js`,
`metrics-config.spec.js`, `metrics-config-tabs.spec.js`,
`metrics-visualizations.spec.js`,
`metrics-promql-query-persistence.spec.js`,
`metrics-table-column-order.spec.js`, `metrics-queries.spec.js`,
`metrics-aggregations.spec.js`, `metrics-advanced.spec.js`):
- Remove `test.describe.configure({ mode: 'serial' })`
- Replace shared `let pm` + `beforeEach` pattern with a `setupTest(page,
testInfo)` helper that creates and returns a fresh `PageManager` per
test — the same pattern already used in `metrics-promql-builder.spec.js`
(the one file that was already parallel)
- `metrics-table-column-order.spec.js`: pass `pm` explicitly into
`setupTableChart(pm, page, mode)` since it can no longer close over a
describe-scope variable
- Split consolidated mega-tests (for-loops over multiple independent
scenarios) in `metrics-queries`, `metrics-aggregations`, and
`metrics-advanced` into individual `test()` blocks so Playwright can
distribute them across workers

**No test assertions, selectors, query logic, or validation changed.**

| File | Tests before | Tests after |
|---|---|---|
| `metrics.spec.js` | 10 (serial) | 10 (parallel) |
| `metrics-config.spec.js` | 2 (serial) | 2 (parallel) |
| `metrics-config-tabs.spec.js` | 3 (serial) | 3 (parallel) |
| `metrics-visualizations.spec.js` | 4 (serial) | 4 (parallel) |
| `metrics-promql-query-persistence.spec.js` | 6 (serial) | 6 (parallel)
|
| `metrics-table-column-order.spec.js` | 20 (serial) | 20 (parallel) |
| `metrics-queries.spec.js` | 4 mega-tests (serial) | 12 individual
(parallel) |
| `metrics-aggregations.spec.js` | 3 mega-tests (serial) | 10 individual
(parallel) |
| `metrics-advanced.spec.js` | 4 mega-tests (serial) | 12 individual
(parallel) |

**Expected impact**: ~1300s (~22 min) → ~300-400s (~5-7 min) wall-clock
time.

---

## Test plan
- [ ] All 40 tests in the 4 Sentinel-audit spec files enumerate cleanly
via `npx playwright test --list`
- [ ] Tag filters `@cipherKeys`, `@P2`, `@sdr` match expected tests
- [ ] All Metrics spec files enumerate cleanly with no serial mode
warnings
- [ ] Metrics shard CI time drops to ~5-7 min on next PR run

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 02:31:44 +00:00

518 lines
25 KiB
JavaScript

const { test, expect, navigateToBase } = require('../utils/enhanced-baseFixtures.js');
const testLogger = require('../utils/test-logger.js');
const { CipherKeys } = require('../../pages/generalPages/cipherKeys.js');
const { getOrgIdentifier, isCloudEnvironment } = require('../utils/cloud-auth.js');
test.describe("Cipher Keys for security", { tag: '@enterprise' }, () => {
let cipherKeys;
const cipherName = `c${Date.now()}-${Math.random().toString(36).substring(7)}`;
const simpleSecret = process.env['SIMPLE_KEYS'];
const simpleSecretUp = process.env['SIMPLE_KEYS_UP'];
const simpleSecretInvalid = 'invalidSecret';
const tinkeySecretInvalid = `{
"primaryKeyId": ${process.env['PRIMARY_KEY_ID_VAL']},
"key": [{
"keyData": {
"typeUrl": "type.googleapis.com/google.crypto.tink.AesSivKey",
"value": "${process.env['PRIMARY_KEY_ID_VAL']}",
"keyMaterialType": "SYMMETRIC"
},
"status": "ENABLED",
"keyId": ${process.env['PRIMARY_KEY_ID_VAL']},
"outputPrefixType": "TINK"
}]
}`;
const tinkeySecret = `{
"primaryKeyId": ${process.env['PRIMARY_KEY_ID']},
"key": [{
"keyData": {
"typeUrl": "type.googleapis.com/google.crypto.tink.AesSivKey",
"value": "${process.env['PRIMARY_KEY_ID_VAL']}",
"keyMaterialType": "SYMMETRIC"
},
"status": "ENABLED",
"keyId": ${process.env['PRIMARY_KEY_ID']},
"outputPrefixType": "TINK"
}]
}`;
const tinkeySecretUp = `{
"primaryKeyId": ${process.env['PRIMARY_KEY_ID_UP']},
"key": [{
"keyData": {
"typeUrl": "type.googleapis.com/google.crypto.tink.AesSivKey",
"value": "${process.env['PRIMARY_KEY_ID_VAL_UP']}",
"keyMaterialType": "SYMMETRIC"
},
"status": "ENABLED",
"keyId": ${process.env['PRIMARY_KEY_ID_UP']},
"outputPrefixType": "TINK"
}]
}`;
const baseURL = process.env['AKEYLESS_URL'];
const accessID = process.env['AKEYLESS_ACCESS_ID'];
const accessKey = process.env['AKEYLESS_ACCESS_KEY'];
// Static Secrets
const staticSecretSimple = process.env['STATIC_SECRET_SIMPLE'];
const staticSecretSimpleUp = process.env['STATIC_SECRET_SIMPLE_UP'];
const staticSecretTink = process.env['STATIC_SECRET_TINK'];
const staticSecretTinkUp = process.env['STATIC_SECRET_TINK_UP'];
const simpleEncryDataDFCInvalid = 'Invalid';
// DFC Names and Encrypted Data
const simpleNameDFC = process.env['SIMPLE_NAME_DFC'];
const simpleEncryDataTedDFC = process.env['SIMPLE_ENCRYPTED_DATA_TED_DFC'];
const simpleUpNameDFC = process.env['SIMPLE_UP_NAME_DFC'];
const simpleUpEncryDataTedDFC = process.env['SIMPLE_UP_ENCRYPTED_DATA_TED_DFC'];
const tinkDFC = process.env['TINK_DFC'];
const tinkEncryDataTedDFC = process.env['TINK_ENCRYPTED_DATA_TED_DFC'];
const tinkUpDFC = process.env['TINK_UP_DFC'];
const tinkUpEncryDataTedDFC = process.env['TINK_UP_ENCRYPTED_DATA_TED_DFC'];
test.beforeEach(async ({ page }, testInfo) => {
testLogger.testStart(testInfo.title, testInfo.file);
await navigateToBase(page);
cipherKeys = new CipherKeys(page);
await page.waitForLoadState('domcontentloaded');
testLogger.info('Cipher keys test setup completed');
});
test("Error Message displayed if Simple cipher keys created with invalid secret", {
tag: ['@cipherKeys', '@enterprise', '@P1', '@negative']
}, async ({ page }) => {
await cipherKeys.navigateToSettingsMenu();
// Navigate to Cipher Key Management
await cipherKeys.navigateToCipherKeyTab();
// Add Cipher Key with invalid secret
await cipherKeys.addCipherKey();
await cipherKeys.addCipherKeyName(cipherName);
await cipherKeys.addCipherKeyOO(simpleSecretInvalid);
await cipherKeys.addCipherKeyContinue();
const cipherKeyResp1 = page.waitForResponse(
resp => resp.url().includes('/cipher_keys') && resp.request().method() === 'POST',
{ timeout: 15000 }
);
await cipherKeys.addCipherKeySave();
const resp1 = await cipherKeyResp1;
testLogger.info(`POST /cipher_keys status: ${resp1.status()}`);
test.skip(resp1.status() === 403, 'Cipher key API returned 403 — feature not enabled in this environment');
await cipherKeys.verifyAlertMessage('failed to decode the key, check if secret value and mechanism match');
testLogger.info('Test completed successfully');
});
// Skipped: Requires signOut/re-login flow not compatible with cloud OIDC auth.
// Needs additional migration when un-skipped (replace LoginPage, hardcoded org, logsPage references).
test.skip("Simple cipher keys created, updated and deleted to store at OpenObserve", async ({ page }) => {
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.addCipherKey();
await cipherKeys.addCipherKeyName(cipherName);
await cipherKeys.addCipherKeyOO(simpleSecret);
await cipherKeys.addCipherKeyContinue();
await cipherKeys.addCipherKeySave();
await cipherKeys.verifyAlertMessage('check_circleCipher key created successfully');
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.updateCipherKeys(cipherName);
await cipherKeys.updateCipherKeysSecret();
await cipherKeys.updateCipherKeysSecretCancel();
await cipherKeys.updateCipherKeysCancel();
await page.waitForTimeout(1000);
await cipherKeys.signOut();
await page.waitForTimeout(10000);
// TODO: Re-login flow needs cloud OIDC migration
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.updateCipherKeys(cipherName);
await cipherKeys.updateCipherKeysSecret();
await cipherKeys.addCipherKeyOO(simpleSecretUp);
await cipherKeys.addCipherKeyContinue();
await cipherKeys.addCipherKeySave();
await cipherKeys.verifyAlertMessage('check_circleCipher key updated successfully');
await page.waitForTimeout(1000);
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.deletedCipherKeys(cipherName);
await cipherKeys.requestCipherKeysCancel();
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.deletedCipherKeys(cipherName);
await cipherKeys.requestCipherKeysOk();
await cipherKeys.verifyAlertMessage('check_circleCipher Key deleted successfully');
});
test("Error Message displayed if Tink cipher keys created with invalid json", {
tag: ['@cipherKeys', '@enterprise', '@P1', '@negative']
}, async ({ page }) => {
test.skip(!process.env['PRIMARY_KEY_ID_VAL'], 'Requires PRIMARY_KEY_ID_VAL env var');
await cipherKeys.navigateToSettingsMenu();
// Navigate to Cipher Key Management
await cipherKeys.navigateToCipherKeyTab();
// Add Cipher Key with invalid secret json
await cipherKeys.addCipherKey();
await cipherKeys.addCipherKeyName(cipherName);
await cipherKeys.addCipherKeyOO(tinkeySecretInvalid);
await cipherKeys.addCipherKeyContinue();
await cipherKeys.addCipherKeyTink();
const cipherKeyResp3 = page.waitForResponse(
resp => resp.url().includes('/cipher_keys') && resp.request().method() === 'POST',
{ timeout: 15000 }
);
await cipherKeys.addCipherKeySave();
const resp3 = await cipherKeyResp3;
testLogger.info(`POST /cipher_keys status: ${resp3.status()}`);
test.skip(resp3.status() === 403, 'Cipher key API returned 403 — feature not enabled in this environment');
await cipherKeys.verifyAlertMessage('error deserializing tink keyset, please check if provided json is valid tink keyset');
testLogger.info('Test completed successfully');
});
// Skipped: Requires signOut/re-login flow not compatible with cloud OIDC auth.
test.skip("Tink cipher keys created, updated and deleted to store at OpenObserve", async ({ page }) => {
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.addCipherKey();
await cipherKeys.addCipherKeyName(cipherName);
await cipherKeys.addCipherKeyOO(tinkeySecret);
await cipherKeys.addCipherKeyContinue();
await cipherKeys.addCipherKeyTink();
await cipherKeys.addCipherKeySave();
await cipherKeys.verifyAlertMessage('check_circleCipher key created successfully');
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.updateCipherKeys(cipherName);
await cipherKeys.updateCipherKeysSecret();
await cipherKeys.updateCipherKeysSecretCancel();
await cipherKeys.updateCipherKeysCancel();
await page.waitForTimeout(1000);
// TODO: signOut/re-login needs cloud OIDC migration
await cipherKeys.signOut();
await page.waitForTimeout(10000);
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.updateCipherKeys(cipherName);
await cipherKeys.updateCipherKeysSecret();
await cipherKeys.addCipherKeyOO(tinkeySecretUp);
await cipherKeys.addCipherKeyContinue();
await cipherKeys.addCipherKeyTink();
await cipherKeys.addCipherKeySave();
await cipherKeys.verifyAlertMessage('check_circleCipher key updated successfully');
await page.waitForTimeout(1000);
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.deletedCipherKeys(cipherName);
await cipherKeys.requestCipherKeysCancel();
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.deletedCipherKeys(cipherName);
await cipherKeys.requestCipherKeysOk();
await cipherKeys.verifyAlertMessage('check_circleCipher Key deleted successfully');
});
test("Error Message displayed if Cipher Key Name Blank", {
tag: ['@cipherKeys', '@enterprise', '@P2', '@validation']
}, async ({ page }) => {
await cipherKeys.navigateToSettingsMenu();
// Navigate to Cipher Key Management
await cipherKeys.navigateToCipherKeyTab();
// Add Cipher Key with blank name
await cipherKeys.addCipherKey();
await cipherKeys.addCipherKeyContinue();
await cipherKeys.verifyNameError();
testLogger.info('Test completed successfully');
});
test("Error Message displayed if Cipher Key Secret Blank", {
tag: ['@cipherKeys', '@enterprise', '@P2', '@validation']
}, async ({ page }) => {
await cipherKeys.navigateToSettingsMenu();
// Navigate to Cipher Key Management
await cipherKeys.navigateToCipherKeyTab();
// Add Cipher Key with blank secret
await cipherKeys.addCipherKey();
await cipherKeys.addCipherKeyName(cipherName);
await cipherKeys.addCipherKeyContinue();
await cipherKeys.verifySecretError();
testLogger.info('Test completed successfully');
});
test("Error Message displayed if Cipher Key Secret Invalid", {
tag: ['@cipherKeys', '@enterprise', '@P2', '@negative']
}, async ({ page }) => {
await cipherKeys.navigateToSettingsMenu();
// Navigate to Cipher Key Management
await cipherKeys.navigateToCipherKeyTab();
// Add Cipher Key with invalid secret
await cipherKeys.addCipherKey();
await cipherKeys.addCipherKeyName(cipherName);
await cipherKeys.addCipherKeyOO('invalidSecret');
await cipherKeys.addCipherKeyContinue();
const cipherKeyResp7 = page.waitForResponse(
resp => resp.url().includes('/cipher_keys') && resp.request().method() === 'POST',
{ timeout: 15000 }
);
await cipherKeys.addCipherKeySave();
const resp7 = await cipherKeyResp7;
testLogger.info(`POST /cipher_keys status: ${resp7.status()}`);
test.skip(resp7.status() === 403, 'Cipher key API returned 403 — feature not enabled in this environment');
await cipherKeys.verifyAlertMessage('failed to decode the key, check if secret value and mechanism match');
testLogger.info('Test completed successfully');
});
// Skipped: Requires signOut/re-login flow not compatible with cloud OIDC auth.
test.skip("Simple cipher keys created, updated and deleted to store at Akeyless with Static Secret", async ({ page }) => {
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.addCipherKey();
await cipherKeys.addCipherKeyName(cipherName);
await cipherKeys.addCipherKeyType();
await cipherKeys.addCipherKeyTypeURL(baseURL);
await cipherKeys.addCipherKeyTypeID(accessID);
await cipherKeys.addCipherKeyTypeKey(accessKey);
await cipherKeys.addCipherKeyStaticName(staticSecretSimple);
await cipherKeys.addCipherKeyContinue();
await cipherKeys.addCipherKeySave();
await cipherKeys.verifyAlertMessage('check_circleCipher key created successfully');
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.updateCipherKeys(cipherName);
await cipherKeys.updateCipherKeysCancel();
await page.waitForTimeout(1000);
// TODO: signOut/re-login needs cloud OIDC migration
await cipherKeys.signOut();
await page.waitForTimeout(10000);
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.updateCipherKeys(cipherName);
await cipherKeys.addCipherKeyStaticName(staticSecretSimpleUp);
await cipherKeys.addCipherKeyContinue();
await cipherKeys.addCipherKeySave();
await cipherKeys.verifyAlertMessage('check_circleCipher key updated successfully');
await page.waitForTimeout(1000);
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.deletedCipherKeys(cipherName);
await cipherKeys.requestCipherKeysCancel();
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.deletedCipherKeys(cipherName);
await cipherKeys.requestCipherKeysOk();
await cipherKeys.verifyAlertMessage('check_circleCipher Key deleted successfully');
});
// Skipped: Requires signOut/re-login flow not compatible with cloud OIDC auth.
test.skip("Tink cipher keys created, updated and deleted to store at Akeyless with Static Secret", async ({ page }) => {
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.addCipherKey();
await cipherKeys.addCipherKeyName(cipherName);
await cipherKeys.addCipherKeyType();
await cipherKeys.addCipherKeyTypeURL(baseURL);
await cipherKeys.addCipherKeyTypeID(accessID);
await cipherKeys.addCipherKeyTypeKey(accessKey);
await cipherKeys.addCipherKeyStaticName(staticSecretTink);
await cipherKeys.addCipherKeyContinue();
await cipherKeys.addCipherKeyTink();
await cipherKeys.addCipherKeySave();
await cipherKeys.verifyAlertMessage('check_circleCipher key created successfully');
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.updateCipherKeys(cipherName);
await cipherKeys.updateCipherKeysCancel();
await page.waitForTimeout(1000);
// TODO: signOut/re-login needs cloud OIDC migration
await cipherKeys.signOut();
await page.waitForTimeout(10000);
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.updateCipherKeys(cipherName);
await cipherKeys.addCipherKeyStaticName(staticSecretTinkUp);
await cipherKeys.addCipherKeyContinue();
await cipherKeys.addCipherKeyTink();
await cipherKeys.addCipherKeySave();
await cipherKeys.verifyAlertMessage('check_circleCipher key updated successfully');
await page.waitForTimeout(1000);
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.deletedCipherKeys(cipherName);
await cipherKeys.requestCipherKeysCancel();
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.deletedCipherKeys(cipherName);
await cipherKeys.requestCipherKeysOk();
await cipherKeys.verifyAlertMessage('check_circleCipher Key deleted successfully');
});
test("Error Message displayed if DFC Encrypted Data Invalid at Akeyless", {
tag: ['@cipherKeys', '@enterprise', '@P1', '@negative']
}, async ({ page }) => {
test.skip(!process.env['AKEYLESS_URL'], 'Requires AKEYLESS env vars');
await cipherKeys.navigateToSettingsMenu();
// Navigate to Cipher Key Management
await cipherKeys.navigateToCipherKeyTab();
// Add Cipher Key with invalid encrypted data
await cipherKeys.addCipherKey();
await cipherKeys.addCipherKeyName(cipherName);
await cipherKeys.addCipherKeyType();
await cipherKeys.addCipherKeyTypeURL(baseURL);
await cipherKeys.addCipherKeyTypeID(accessID);
await cipherKeys.addCipherKeyTypeKey(accessKey);
await cipherKeys.addCipherKeyDFC();
await cipherKeys.addCipherKeyNameDFC(simpleNameDFC);
await cipherKeys.addCipherKeyEncryDataDFC(simpleEncryDataDFCInvalid);
await cipherKeys.addCipherKeyContinue();
const cipherKeyResp8 = page.waitForResponse(
resp => resp.url().includes('/cipher_keys') && resp.request().method() === 'POST',
{ timeout: 15000 }
);
await cipherKeys.addCipherKeySave();
const resp8 = await cipherKeyResp8;
testLogger.info(`POST /cipher_keys status: ${resp8.status()}`);
test.skip(resp8.status() === 403, 'Cipher key API returned 403 — feature not enabled in this environment');
await cipherKeys.verifyAlertMessage('failed to decode the ciphertext: illegal base64 data at input byte 4');
testLogger.info('Test completed successfully');
});
// Skipped: Requires signOut/re-login flow not compatible with cloud OIDC auth.
test.skip("Simple cipher keys created, updated and deleted with Akeyless DFC Secret", async ({ page }) => {
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.addCipherKey();
await cipherKeys.addCipherKeyName(cipherName);
await cipherKeys.addCipherKeyType();
await cipherKeys.addCipherKeyTypeURL(baseURL);
await cipherKeys.addCipherKeyTypeID(accessID);
await cipherKeys.addCipherKeyTypeKey(accessKey);
await cipherKeys.addCipherKeyDFC();
await cipherKeys.addCipherKeyNameDFC(simpleNameDFC);
await cipherKeys.addCipherKeyEncryDataDFC(simpleEncryDataTedDFC);
await cipherKeys.addCipherKeyContinue();
await cipherKeys.addCipherKeySave();
await cipherKeys.verifyAlertMessage('check_circleCipher key created successfully');
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.updateCipherKeys(cipherName);
await cipherKeys.updateCipherKeysCancel();
await page.waitForTimeout(1000);
// TODO: signOut/re-login needs cloud OIDC migration
await cipherKeys.signOut();
await page.waitForTimeout(10000);
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.updateCipherKeys(cipherName);
await cipherKeys.addCipherKeyNameDFC(simpleUpNameDFC);
await cipherKeys.addCipherKeyEncryDataDFC(simpleUpEncryDataTedDFC);
await cipherKeys.addCipherKeyContinue();
await cipherKeys.addCipherKeySave();
await cipherKeys.verifyAlertMessage('check_circleCipher key updated successfully');
await page.waitForTimeout(1000);
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.deletedCipherKeys(cipherName);
await cipherKeys.requestCipherKeysCancel();
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.deletedCipherKeys(cipherName);
await cipherKeys.requestCipherKeysOk();
await cipherKeys.verifyAlertMessage('check_circleCipher Key deleted successfully');
});
// Skipped: Requires signOut/re-login flow not compatible with cloud OIDC auth.
test.skip("Tink cipher keys created, updated and deleted with Akeyless DFC Secret", async ({ page }) => {
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.addCipherKey();
await cipherKeys.addCipherKeyName(cipherName);
await cipherKeys.addCipherKeyType();
await cipherKeys.addCipherKeyTypeURL(baseURL);
await cipherKeys.addCipherKeyTypeID(accessID);
await cipherKeys.addCipherKeyTypeKey(accessKey);
await cipherKeys.addCipherKeyDFC();
await cipherKeys.addCipherKeyNameDFC(tinkDFC);
await cipherKeys.addCipherKeyEncryDataDFC(tinkEncryDataTedDFC);
await cipherKeys.addCipherKeyContinue();
await cipherKeys.addCipherKeyTink();
await cipherKeys.addCipherKeySave();
await cipherKeys.verifyAlertMessage('check_circleCipher key created successfully');
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.updateCipherKeys(cipherName);
await cipherKeys.updateCipherKeysCancel();
await page.waitForTimeout(1000);
// TODO: signOut/re-login needs cloud OIDC migration
await cipherKeys.signOut();
await page.waitForTimeout(10000);
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.updateCipherKeys(cipherName);
await cipherKeys.addCipherKeyNameDFC(tinkUpDFC);
await cipherKeys.addCipherKeyEncryDataDFC(tinkUpEncryDataTedDFC);
await cipherKeys.addCipherKeyContinue();
await cipherKeys.addCipherKeyTink();
await cipherKeys.addCipherKeySave();
await cipherKeys.verifyAlertMessage('check_circleCipher key updated successfully');
await page.waitForTimeout(1000);
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.deletedCipherKeys(cipherName);
await cipherKeys.requestCipherKeysCancel();
await page.goto(process.env["ZO_BASE_URL"] + `/web/settings/cipher_keys?org_identifier=${getOrgIdentifier()}`);
await cipherKeys.navigateToSettingsMenu();
await cipherKeys.navigateToCipherKeyTab();
await cipherKeys.deletedCipherKeys(cipherName);
await cipherKeys.requestCipherKeysOk();
await cipherKeys.verifyAlertMessage('check_circleCipher Key deleted successfully');
});
});