diff --git a/src/ops/cloud/SecretsOps.test.ts b/src/ops/cloud/SecretsOps.test.ts new file mode 100644 index 000000000..ee7bf3e25 --- /dev/null +++ b/src/ops/cloud/SecretsOps.test.ts @@ -0,0 +1,168 @@ +/** + * To record and update snapshots, you must perform 3 steps in order: + * + * 1. Record API responses + * + * To record API responses, you must call the test:record script and + * override all the connection state variables required to connect to the + * env to record from: + * + * ATTENTION: For the recording to succeed, you MUST make sure to use a + * user account, not a service account. + * + * FRODO_DEBUG=1 FRODO_HOST=frodo-dev npm run test:record SecretsOps + * + * The above command assumes that you have a connection profile for + * 'frodo-dev' on your development machine. + * + * 2. Update snapshots + * + * After recording API responses, you must manually update/create snapshots + * by running: + * + * FRODO_DEBUG=1 npm run test:update SecretsOps + * + * 3. Test your changes + * + * If 1 and 2 didn't produce any errors, you are ready to run the tests in + * replay mode and make sure they all succeed as well: + * + * FRODO_DEBUG=1 npm run test:only SecretsOps + * + * Note: FRODO_DEBUG=1 is optional and enables debug logging for some output + * in case things don't function as expected + */ + +import { autoSetupPolly } from "../../utils/AutoSetupPolly"; +import { state } from "../../index"; +import * as SecretsOps from './SecretsOps'; +import axios, { AxiosError } from "axios"; + +autoSetupPolly(); + +async function stageSecret( + secret: { + id: string; + value: string; + description: string; + encoding: string; + useInPlaceholders: boolean; + }, + create = true +) { + // delete if exists, then create + try { + await SecretsOps.deleteSecret({ secretId: secret.id, state }) + } catch (error) { + // ignore + } finally { + if (create) { + await SecretsOps.createSecret({ + secretId: secret.id, + value: secret.value, + description: secret.description, + encoding: secret.encoding, + useInPlaceholders: secret.useInPlaceholders, + state: state + }); + } + } +} + +describe('SecretsOps', () => { + const secret1 = { + id: 'esv-frodo-test-secret-1', + value: 'value1', + description: 'description1', + encoding: 'generic', + useInPlaceholders: true + } + const secret2 = { + id: 'esv-frodo-test-secret-2', + value: 'value2', + description: 'description2', + encoding: 'generic', + useInPlaceholders: false + } + const secret3 = { + id: 'esv-frodo-test-secret-3', + value: 'value3', + description: 'description3', + encoding: 'generic', + useInPlaceholders: false + } + // in recording mode, setup test data before recording + beforeAll(async () => { + if (process.env.FRODO_POLLY_MODE === 'record') { + await stageSecret(secret1); + await stageSecret(secret2); + await stageSecret(secret3, false); + } + }); + // in recording mode, remove test data after recording + afterAll(async () => { + if (process.env.FRODO_POLLY_MODE === 'record') { + await stageSecret(secret1, false); + await stageSecret(secret2, false); + await stageSecret(secret3, false); + } + }); + + describe('createSecretsExportTemplate()', () => { + test('0: Method is implemented', async () => { + expect(SecretsOps.createSecretsExportTemplate).toBeDefined(); + }); + + test('1: Return template with meta data', async () => { + expect(SecretsOps.createSecretsExportTemplate({ state: state })).toStrictEqual({ + meta: expect.any(Object), + secrets: {} + }); + }); + }); + + describe('exportSecrets()', () => { + test('0: Method is implemented', async () => { + expect(SecretsOps.exportSecrets).toBeDefined(); + }); + + test('1: Export all secrets', async () => { + const response = await SecretsOps.exportSecrets({ state: state }); + expect(response).toMatchSnapshot({ + meta: expect.any(Object), + }); + }); + }); + + describe('exportSecret()', () => { + test('0: Method is implemented', async () => { + expect(SecretsOps.exportSecret).toBeDefined(); + }); + + test('1: Export secret1', async () => { + const response = await SecretsOps.exportSecret({ secretId: secret1.id, state: state }); + expect(response).toMatchSnapshot({ + meta: expect.any(Object), + }); + }); + + test('2: Export secret2', async () => { + const response = await SecretsOps.exportSecret({ secretId: secret2.id, state: state }); + expect(response).toMatchSnapshot({ + meta: expect.any(Object), + }); + }); + + test('3: Export secret3 (non-existent)', async () => { + let errorCaught = false; + try { + await SecretsOps.exportSecret({ secretId: secret3.id, state: state }) + } catch (e: any) { + errorCaught = true; + expect(axios.isAxiosError(e)).toBeTruthy(); + expect((e as AxiosError).response.status).toBe(404) + } + expect(errorCaught).toBeTruthy(); + }); + }); +}); diff --git a/src/ops/cloud/SecretsOps.ts b/src/ops/cloud/SecretsOps.ts index dac69feae..49a05ada8 100644 --- a/src/ops/cloud/SecretsOps.ts +++ b/src/ops/cloud/SecretsOps.ts @@ -14,6 +14,9 @@ import { VersionOfSecretStatus, } from '../../api/cloud/SecretsApi'; import { State } from '../../shared/State'; +import { debugMessage } from '../../utils/Console'; +import { getMetadata } from '../../utils/ExportImportUtils'; +import { ExportMetaData } from '../OpsTypes'; export type Secret = { /** @@ -27,6 +30,17 @@ export type Secret = { * @returns {Promise} a promise that resolves to a secret */ readSecret(secretId: string): Promise; + /** + * Export secret. The response can be saved to file as is. + * @param secretId secret id/name + * @returns {Promise} Promise resolving to a SecretsExportInterface object. + */ + exportSecret(secretId): Promise; + /** + * Export all secrets + * @returns {Promise} Promise resolving to an SecretsExportInterface object. + */ + exportSecrets(): Promise; /** * Create secret * @param {string} secretId secret id/name @@ -236,7 +250,13 @@ export default (state: State): Secret => { return readSecrets({ state }); }, async readSecret(secretId: string) { - return _getSecret({ secretId, state }); + return readSecret({ secretId, state }); + }, + async exportSecret(secretId: string): Promise { + return exportSecret({ secretId, state }); + }, + async exportSecrets(): Promise { + return exportSecrets({ state }); }, async createSecret( secretId: string, @@ -287,7 +307,7 @@ export default (state: State): Secret => { return _deleteVersionOfSecret({ secretId, version, state }); }, - // Deprecatd + // Deprecated async getSecrets() { return readSecrets({ state }); @@ -338,6 +358,52 @@ export default (state: State): Secret => { }; }; +export interface SecretsExportInterface { + meta?: ExportMetaData; + secrets: Record; +} + +export function createSecretsExportTemplate({ + state, +}: { + state: State; +}): SecretsExportInterface { + return { + meta: getMetadata({ state }), + secrets: {}, + } as SecretsExportInterface; +} + +export async function exportSecret({ + secretId, + state, +}: { + secretId: string; + state: State; +}): Promise { + debugMessage({ message: `SecretsOps.exportSecret: start`, state }); + const exportData = createSecretsExportTemplate({ state }); + const secret = await _getSecret({ secretId, state }); + exportData.secrets[secret._id] = secret; + debugMessage({ message: `VariablesOps.exportSecret: end`, state }); + return exportData; +} + +export async function exportSecrets({ + state, +}: { + state: State; +}): Promise { + debugMessage({ message: `SecretsOps.exportSecrets: start`, state }); + const exportData = createSecretsExportTemplate({ state }); + const secrets = await readSecrets({ state }); + for (const secret of secrets) { + exportData.secrets[secret._id] = secret; + } + debugMessage({ message: `SecretsOps.exportSecrets: end`, state }); + return exportData; +} + export async function enableVersionOfSecret({ secretId, version, @@ -372,6 +438,16 @@ export async function disableVersionOfSecret({ }); } +export async function readSecret({ + secretId, + state, +}: { + secretId: string; + state: State; +}): Promise { + return await _getSecret({ secretId, state }); +} + export async function readSecrets({ state, }: { @@ -385,8 +461,6 @@ export { _putSecret as createSecret, _createNewVersionOfSecret as createVersionOfSecret, _deleteSecret as deleteSecret, - _deleteVersionOfSecret as deleteVersionOfSecret, - _getSecret as readSecret, _getVersionOfSecret as readVersionOfSecret, _getSecretVersions as readVersionsOfSecret, _setSecretDescription as updateSecretDescription, diff --git a/src/ops/cloud/VariablesOps.test.ts b/src/ops/cloud/VariablesOps.test.ts new file mode 100644 index 000000000..8522384c2 --- /dev/null +++ b/src/ops/cloud/VariablesOps.test.ts @@ -0,0 +1,171 @@ +/** + * To record and update snapshots, you must perform 3 steps in order: + * + * 1. Record API responses + * + * To record API responses, you must call the test:record script and + * override all the connection state variables required to connect to the + * env to record from: + * + * ATTENTION: For the recording to succeed, you MUST make sure to use a + * user account, not a service account. + * + * FRODO_DEBUG=1 FRODO_HOST=frodo-dev npm run test:record VariablesOps + * + * The above command assumes that you have a connection profile for + * 'frodo-dev' on your development machine. + * + * 2. Update snapshots + * + * After recording API responses, you must manually update/create snapshots + * by running: + * + * FRODO_DEBUG=1 npm run test:update VariablesOps + * + * 3. Test your changes + * + * If 1 and 2 didn't produce any errors, you are ready to run the tests in + * replay mode and make sure they all succeed as well: + * + * FRODO_DEBUG=1 npm run test:only VariablesOps + * + * Note: FRODO_DEBUG=1 is optional and enables debug logging for some output + * in case things don't function as expected + */ + +import { autoSetupPolly } from "../../utils/AutoSetupPolly"; +import { state } from "../../index"; +import * as VariablesOps from './VariablesOps'; +import axios, { AxiosError } from "axios"; +import { VariableExpressionType } from "../../api/cloud/VariablesApi"; + +autoSetupPolly(); + +async function stageVariable( + variable: { + id: string; + value: string; + description: string; + expressionType: string; + }, + create = true +) { + // delete if exists, then create + try { + await VariablesOps.deleteVariable({ variableId: variable.id, state }) + } catch (error) { + // ignore + } finally { + if (create) { + await VariablesOps.createVariable({ + variableId: variable.id, + value: variable.value, + description: variable.description, + expressionType: variable.expressionType as VariableExpressionType, + state: state + }); + } + } +} + +describe('VariablesOps', () => { + const variable1 = { + id: 'esv-frodo-test-variable-1', + value: 'value1', + description: 'description1', + expressionType: 'string' + } + const variable2 = { + id: 'esv-frodo-test-variable-2', + value: '42', + description: 'description2', + expressionType: 'int' + } + const variable3 = { + id: 'esv-frodo-test-variable-3', + value: 'true', + description: 'description3', + expressionType: 'bool' + } + // in recording mode, setup test data before recording + beforeAll(async () => { + if (process.env.FRODO_POLLY_MODE === 'record') { + await stageVariable(variable1); + await stageVariable(variable2); + await stageVariable(variable3, false); + } + }); + // in recording mode, remove test data after recording + afterAll(async () => { + if (process.env.FRODO_POLLY_MODE === 'record') { + await stageVariable(variable1, false); + await stageVariable(variable2, false); + await stageVariable(variable3, false); + } + }); + + describe('createVariablesExportTemplate()', () => { + test('0: Method is implemented', async () => { + expect(VariablesOps.createVariablesExportTemplate).toBeDefined(); + }); + + test('1: Return template with meta data', async () => { + expect(VariablesOps.createVariablesExportTemplate({ state: state })).toStrictEqual({ + meta: expect.any(Object), + variables: {} + }); + }); + }); + + describe('exportVariables()', () => { + test('0: Method is implemented', async () => { + expect(VariablesOps.exportVariables).toBeDefined(); + }); + + test('1: Export all variables', async () => { + const response = await VariablesOps.exportVariables({ noDecode: false, state: state }); + expect(response).toMatchSnapshot({ + meta: expect.any(Object), + }); + }); + + test('2: Export all variables without decoding', async () => { + const response = await VariablesOps.exportVariables({ noDecode: true, state: state }); + expect(response).toMatchSnapshot({ + meta: expect.any(Object), + }); + }); + }); + + describe('exportVariable()', () => { + test('0: Method is implemented', async () => { + expect(VariablesOps.exportVariable).toBeDefined(); + }); + + test('1: Export variable1', async () => { + const response = await VariablesOps.exportVariable({ variableId: variable1.id, noDecode: false, state: state }); + expect(response).toMatchSnapshot({ + meta: expect.any(Object), + }); + }); + + test('2: Export variable2 without decoding', async () => { + const response = await VariablesOps.exportVariable({ variableId: variable2.id, noDecode: true, state: state }); + expect(response).toMatchSnapshot({ + meta: expect.any(Object), + }); + }); + + test('3: Export variable3 (non-existent)', async () => { + let errorCaught = false; + try { + await VariablesOps.exportVariable({ variableId: variable3.id, noDecode: false, state: state }) + } catch (e: any) { + errorCaught = true; + expect(axios.isAxiosError(e)).toBeTruthy(); + expect((e as AxiosError).response.status).toBe(404) + } + expect(errorCaught).toBeTruthy(); + }); + }); +}); diff --git a/src/ops/cloud/VariablesOps.ts b/src/ops/cloud/VariablesOps.ts index 8d4df1584..31305d2d1 100644 --- a/src/ops/cloud/VariablesOps.ts +++ b/src/ops/cloud/VariablesOps.ts @@ -8,7 +8,10 @@ import { VariableSkeleton, } from '../../api/cloud/VariablesApi'; import { State } from '../../shared/State'; +import { decode } from '../../utils/Base64Utils'; import { debugMessage } from '../../utils/Console'; +import { getMetadata } from '../../utils/ExportImportUtils'; +import { ExportMetaData } from '../OpsTypes'; export type Variable = { /** @@ -22,6 +25,22 @@ export type Variable = { * @returns {Promise} a promise that resolves to an array of variable objects */ readVariables(): Promise; + /** + * Export variable. The response can be saved to file as is. + * @param variableId variable id/name + * @param noDecode Do not include decoded variable value in export + * @returns {Promise} Promise resolving to a VariablesExportInterface object. + */ + exportVariable( + variableId: string, + noDecode: boolean + ): Promise; + /** + * Export all variables + * @param noDecode Do not include decoded variable value in export + * @returns {Promise} Promise resolving to an VariablesExportInterface object. + */ + exportVariables(noDecode: boolean): Promise; /** * Create variable * @param {string} variableId variable id/name @@ -131,6 +150,15 @@ export default (state: State): Variable => { readVariables(): Promise { return readVariables({ state }); }, + async exportVariable( + variableId: string, + noDecode: boolean + ): Promise { + return exportVariable({ variableId, noDecode, state }); + }, + exportVariables(noDecode: boolean): Promise { + return exportVariables({ noDecode, state }); + }, createVariable( variableId: string, value: string, @@ -208,6 +236,22 @@ export default (state: State): Variable => { }; }; +export interface VariablesExportInterface { + meta?: ExportMetaData; + variables: Record; +} + +export function createVariablesExportTemplate({ + state, +}: { + state: State; +}): VariablesExportInterface { + return { + meta: getMetadata({ state }), + variables: {}, + } as VariablesExportInterface; +} + export async function readVariable({ variableId, state, @@ -226,6 +270,46 @@ export async function readVariables({ return (await _getVariables({ state })).result; } +export async function exportVariable({ + variableId, + noDecode, + state, +}: { + variableId: string; + noDecode: boolean; + state: State; +}): Promise { + debugMessage({ message: `VariablesOps.exportVariable: start`, state }); + const exportData = createVariablesExportTemplate({ state }); + const variable = await _getVariable({ variableId, state }); + if (!noDecode) { + variable.value = decode(variable.valueBase64); + } + exportData.variables[variable._id] = variable; + debugMessage({ message: `VariablesOps.exportVariable: end`, state }); + return exportData; +} + +export async function exportVariables({ + noDecode, + state, +}: { + noDecode: boolean; + state: State; +}): Promise { + debugMessage({ message: `VariablesOps.exportVariables: start`, state }); + const exportData = createVariablesExportTemplate({ state }); + const variables = await readVariables({ state }); + for (const variable of variables) { + if (!noDecode) { + variable.value = decode(variable.valueBase64); + } + exportData.variables[variable._id] = variable; + } + debugMessage({ message: `VariablesOps.exportVariables: end`, state }); + return exportData; +} + export async function createVariable({ variableId, value, diff --git a/src/test/mock-recordings/SecretsOps_1659926422/exportSecret_3125031640/1-Export-secret1_1507920427/recording.har b/src/test/mock-recordings/SecretsOps_1659926422/exportSecret_3125031640/1-Export-secret1_1507920427/recording.har new file mode 100644 index 000000000..35bc98383 --- /dev/null +++ b/src/test/mock-recordings/SecretsOps_1659926422/exportSecret_3125031640/1-Export-secret1_1507920427/recording.har @@ -0,0 +1,105 @@ +{ + "log": { + "_recordingName": "SecretsOps/exportSecret()/1: Export secret1", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "ac0b75815a6305b4ad5740b134b13b1a", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/2.0.0-45" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "accept-api-version", + "value": "protocol=1.0,resource=1.0" + }, + { + "name": "authorization", + "value": "Bearer eyJ0eXAiOiJKV1QiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiYWxnIjoiZGlyIn0..EtbaSNSwmBfRS6W04O0dZg.ZTJBQGW-GAFyuST9aewFu8BsckmZ-Ht8_PhOV5mMituOcC1461rlFY131RmFLs4_CXoNUFHCNEIrK3sVa5I6bl3sRdprqGhHS49YXa46OqylMVn29ZUTXKIUV8RBAPMEj2igA0N4Dwz4K-zvgz4LjjOsccE5aOCXKXTkvTdsf9FkiKt0dUTpwWfQ7GZWO8RCurVVSTdJQ-HHmGCFc8XAdu2U913RomSglJvkizuttAiQW5fCinXLg4iV_Z-_Ln4G7kyteNG12bVj8BfSpIG_o16XomVoGYiOQE1kX4rwWh92XrwnDO5nUjX3gDANgnrNAvga7Lu2u7j3MWKzY0KQzMM1YLNJ6lGtuFrl8LiKD2Ng42oTXrO9JDUPwPBt_EkdUn_UCmIRZefB1QB96_hTOCtmtXtV_66REMuuoOLJhaSbn-uEcwSi-tnkywGoV-fNI8KFLwYBY7ROYqQkKhs7_hHMpnugeeGpbr0dzVCMGPO_vLgFuTMXAkEdsCKm8ugosqv8vMmPOq6IMbjYs7joBFTV_Q21lL4gtOBARVAuxiDoleJDjwuW8n3XxeS_2CO15YSDlW1WGFApIURxRLkr_g_qSS7MmyXTt5345eDmuRHzp3tvaVQ50iV0EcYMZcImbFzUTLlh3Ob9VFIyHB2gL1aTZhznjIM_Xfqz87j0pSOWtwvFWNorbgeer_180e9W9QuLPxRFk6UznMnZu3SZ5IB_SL6B-DF9owcFF3WxSMRQEeJwQVUoEE45nNlOPKJ78-DvW8D-0mpPI1mutdPKUEa7XRHDM2cA6eovBZHxXuPByzp0SEewkDDZ9m-1KnZHTMdUIeYNmqcewHsgjcdcb2V2e-iEPwCnhIBypJspVxE6c4p0zZhaIBCAClF7lbHyDjyvlSrWVii4ehVvsXLbuFkEs9fo9Zt5xW-IQ9alZYl86prShzzQeTlHzhNtQ8KSITd2f_nygeNHgi2-WwvTaHVohWkfK7yE7vaa_kBitOugcFADOrCUzQK_2Kmsl_2_akMAap_OzdjhLjPpQWDCpqG1XE1eNBiRnFXk4Ad4co0.Nug7EPkkF16OW9rpWRv3dw" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1509, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://openam-frodo-dev.forgeblocks.com/environment/secrets/esv-frodo-test-secret-1" + }, + "response": { + "bodySize": 262, + "content": { + "mimeType": "application/json", + "size": 262, + "text": "{\"_id\":\"esv-frodo-test-secret-1\",\"activeVersion\":\"1\",\"description\":\"description1\",\"encoding\":\"generic\",\"lastChangeDate\":\"2023-10-24T15:31:53.340Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":false,\"loadedVersion\":\"\",\"useInPlaceholders\":true}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "date", + "value": "Tue, 24 Oct 2023 15:31:56 GMT" + }, + { + "name": "content-length", + "value": "262" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 240, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2023-10-24T15:31:56.614Z", + "time": 209, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 209 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/src/test/mock-recordings/SecretsOps_1659926422/exportSecret_3125031640/2-Export-secret2_3129275343/recording.har b/src/test/mock-recordings/SecretsOps_1659926422/exportSecret_3125031640/2-Export-secret2_3129275343/recording.har new file mode 100644 index 000000000..b1ae8442d --- /dev/null +++ b/src/test/mock-recordings/SecretsOps_1659926422/exportSecret_3125031640/2-Export-secret2_3129275343/recording.har @@ -0,0 +1,105 @@ +{ + "log": { + "_recordingName": "SecretsOps/exportSecret()/2: Export secret2", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "60e7fd918145cfd79397752e40c8b6b2", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/2.0.0-45" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "accept-api-version", + "value": "protocol=1.0,resource=1.0" + }, + { + "name": "authorization", + "value": "Bearer eyJ0eXAiOiJKV1QiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiYWxnIjoiZGlyIn0..EtbaSNSwmBfRS6W04O0dZg.ZTJBQGW-GAFyuST9aewFu8BsckmZ-Ht8_PhOV5mMituOcC1461rlFY131RmFLs4_CXoNUFHCNEIrK3sVa5I6bl3sRdprqGhHS49YXa46OqylMVn29ZUTXKIUV8RBAPMEj2igA0N4Dwz4K-zvgz4LjjOsccE5aOCXKXTkvTdsf9FkiKt0dUTpwWfQ7GZWO8RCurVVSTdJQ-HHmGCFc8XAdu2U913RomSglJvkizuttAiQW5fCinXLg4iV_Z-_Ln4G7kyteNG12bVj8BfSpIG_o16XomVoGYiOQE1kX4rwWh92XrwnDO5nUjX3gDANgnrNAvga7Lu2u7j3MWKzY0KQzMM1YLNJ6lGtuFrl8LiKD2Ng42oTXrO9JDUPwPBt_EkdUn_UCmIRZefB1QB96_hTOCtmtXtV_66REMuuoOLJhaSbn-uEcwSi-tnkywGoV-fNI8KFLwYBY7ROYqQkKhs7_hHMpnugeeGpbr0dzVCMGPO_vLgFuTMXAkEdsCKm8ugosqv8vMmPOq6IMbjYs7joBFTV_Q21lL4gtOBARVAuxiDoleJDjwuW8n3XxeS_2CO15YSDlW1WGFApIURxRLkr_g_qSS7MmyXTt5345eDmuRHzp3tvaVQ50iV0EcYMZcImbFzUTLlh3Ob9VFIyHB2gL1aTZhznjIM_Xfqz87j0pSOWtwvFWNorbgeer_180e9W9QuLPxRFk6UznMnZu3SZ5IB_SL6B-DF9owcFF3WxSMRQEeJwQVUoEE45nNlOPKJ78-DvW8D-0mpPI1mutdPKUEa7XRHDM2cA6eovBZHxXuPByzp0SEewkDDZ9m-1KnZHTMdUIeYNmqcewHsgjcdcb2V2e-iEPwCnhIBypJspVxE6c4p0zZhaIBCAClF7lbHyDjyvlSrWVii4ehVvsXLbuFkEs9fo9Zt5xW-IQ9alZYl86prShzzQeTlHzhNtQ8KSITd2f_nygeNHgi2-WwvTaHVohWkfK7yE7vaa_kBitOugcFADOrCUzQK_2Kmsl_2_akMAap_OzdjhLjPpQWDCpqG1XE1eNBiRnFXk4Ad4co0.Nug7EPkkF16OW9rpWRv3dw" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1509, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://openam-frodo-dev.forgeblocks.com/environment/secrets/esv-frodo-test-secret-2" + }, + "response": { + "bodySize": 263, + "content": { + "mimeType": "application/json", + "size": 263, + "text": "{\"_id\":\"esv-frodo-test-secret-2\",\"activeVersion\":\"1\",\"description\":\"description2\",\"encoding\":\"generic\",\"lastChangeDate\":\"2023-10-24T15:31:54.872Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"loadedVersion\":\"1\",\"useInPlaceholders\":false}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "date", + "value": "Tue, 24 Oct 2023 15:31:57 GMT" + }, + { + "name": "content-length", + "value": "263" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 240, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2023-10-24T15:31:56.850Z", + "time": 222, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 222 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/src/test/mock-recordings/SecretsOps_1659926422/exportSecret_3125031640/3-Export-secret3-non-existent_1926490408/recording.har b/src/test/mock-recordings/SecretsOps_1659926422/exportSecret_3125031640/3-Export-secret3-non-existent_1926490408/recording.har new file mode 100644 index 000000000..e17c3e004 --- /dev/null +++ b/src/test/mock-recordings/SecretsOps_1659926422/exportSecret_3125031640/3-Export-secret3-non-existent_1926490408/recording.har @@ -0,0 +1,105 @@ +{ + "log": { + "_recordingName": "SecretsOps/exportSecret()/3: Export secret3 (non-existent)", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "efc6e6ff97916ca6311dcf7a67b61976", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/2.0.0-45" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "accept-api-version", + "value": "protocol=1.0,resource=1.0" + }, + { + "name": "authorization", + "value": "Bearer eyJ0eXAiOiJKV1QiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiYWxnIjoiZGlyIn0..EtbaSNSwmBfRS6W04O0dZg.ZTJBQGW-GAFyuST9aewFu8BsckmZ-Ht8_PhOV5mMituOcC1461rlFY131RmFLs4_CXoNUFHCNEIrK3sVa5I6bl3sRdprqGhHS49YXa46OqylMVn29ZUTXKIUV8RBAPMEj2igA0N4Dwz4K-zvgz4LjjOsccE5aOCXKXTkvTdsf9FkiKt0dUTpwWfQ7GZWO8RCurVVSTdJQ-HHmGCFc8XAdu2U913RomSglJvkizuttAiQW5fCinXLg4iV_Z-_Ln4G7kyteNG12bVj8BfSpIG_o16XomVoGYiOQE1kX4rwWh92XrwnDO5nUjX3gDANgnrNAvga7Lu2u7j3MWKzY0KQzMM1YLNJ6lGtuFrl8LiKD2Ng42oTXrO9JDUPwPBt_EkdUn_UCmIRZefB1QB96_hTOCtmtXtV_66REMuuoOLJhaSbn-uEcwSi-tnkywGoV-fNI8KFLwYBY7ROYqQkKhs7_hHMpnugeeGpbr0dzVCMGPO_vLgFuTMXAkEdsCKm8ugosqv8vMmPOq6IMbjYs7joBFTV_Q21lL4gtOBARVAuxiDoleJDjwuW8n3XxeS_2CO15YSDlW1WGFApIURxRLkr_g_qSS7MmyXTt5345eDmuRHzp3tvaVQ50iV0EcYMZcImbFzUTLlh3Ob9VFIyHB2gL1aTZhznjIM_Xfqz87j0pSOWtwvFWNorbgeer_180e9W9QuLPxRFk6UznMnZu3SZ5IB_SL6B-DF9owcFF3WxSMRQEeJwQVUoEE45nNlOPKJ78-DvW8D-0mpPI1mutdPKUEa7XRHDM2cA6eovBZHxXuPByzp0SEewkDDZ9m-1KnZHTMdUIeYNmqcewHsgjcdcb2V2e-iEPwCnhIBypJspVxE6c4p0zZhaIBCAClF7lbHyDjyvlSrWVii4ehVvsXLbuFkEs9fo9Zt5xW-IQ9alZYl86prShzzQeTlHzhNtQ8KSITd2f_nygeNHgi2-WwvTaHVohWkfK7yE7vaa_kBitOugcFADOrCUzQK_2Kmsl_2_akMAap_OzdjhLjPpQWDCpqG1XE1eNBiRnFXk4Ad4co0.Nug7EPkkF16OW9rpWRv3dw" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1509, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://openam-frodo-dev.forgeblocks.com/environment/secrets/esv-frodo-test-secret-3" + }, + "response": { + "bodySize": 78, + "content": { + "mimeType": "application/json", + "size": 78, + "text": "{\"code\":404,\"message\":\"The secret does not exist or does not have a version\"}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "date", + "value": "Tue, 24 Oct 2023 15:31:57 GMT" + }, + { + "name": "content-length", + "value": "78" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 239, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2023-10-24T15:31:57.106Z", + "time": 273, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 273 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/src/test/mock-recordings/SecretsOps_1659926422/exportSecrets_1740019107/1-Export-all-secrets_2478425198/recording.har b/src/test/mock-recordings/SecretsOps_1659926422/exportSecrets_1740019107/1-Export-all-secrets_2478425198/recording.har new file mode 100644 index 000000000..9994e310b --- /dev/null +++ b/src/test/mock-recordings/SecretsOps_1659926422/exportSecrets_1740019107/1-Export-all-secrets_2478425198/recording.har @@ -0,0 +1,105 @@ +{ + "log": { + "_recordingName": "SecretsOps/exportSecrets()/1: Export all secrets", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "554e50b0a97fed943f123c01f0fa6760", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/2.0.0-45" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "accept-api-version", + "value": "protocol=1.0,resource=1.0" + }, + { + "name": "authorization", + "value": "Bearer eyJ0eXAiOiJKV1QiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiYWxnIjoiZGlyIn0..EtbaSNSwmBfRS6W04O0dZg.ZTJBQGW-GAFyuST9aewFu8BsckmZ-Ht8_PhOV5mMituOcC1461rlFY131RmFLs4_CXoNUFHCNEIrK3sVa5I6bl3sRdprqGhHS49YXa46OqylMVn29ZUTXKIUV8RBAPMEj2igA0N4Dwz4K-zvgz4LjjOsccE5aOCXKXTkvTdsf9FkiKt0dUTpwWfQ7GZWO8RCurVVSTdJQ-HHmGCFc8XAdu2U913RomSglJvkizuttAiQW5fCinXLg4iV_Z-_Ln4G7kyteNG12bVj8BfSpIG_o16XomVoGYiOQE1kX4rwWh92XrwnDO5nUjX3gDANgnrNAvga7Lu2u7j3MWKzY0KQzMM1YLNJ6lGtuFrl8LiKD2Ng42oTXrO9JDUPwPBt_EkdUn_UCmIRZefB1QB96_hTOCtmtXtV_66REMuuoOLJhaSbn-uEcwSi-tnkywGoV-fNI8KFLwYBY7ROYqQkKhs7_hHMpnugeeGpbr0dzVCMGPO_vLgFuTMXAkEdsCKm8ugosqv8vMmPOq6IMbjYs7joBFTV_Q21lL4gtOBARVAuxiDoleJDjwuW8n3XxeS_2CO15YSDlW1WGFApIURxRLkr_g_qSS7MmyXTt5345eDmuRHzp3tvaVQ50iV0EcYMZcImbFzUTLlh3Ob9VFIyHB2gL1aTZhznjIM_Xfqz87j0pSOWtwvFWNorbgeer_180e9W9QuLPxRFk6UznMnZu3SZ5IB_SL6B-DF9owcFF3WxSMRQEeJwQVUoEE45nNlOPKJ78-DvW8D-0mpPI1mutdPKUEa7XRHDM2cA6eovBZHxXuPByzp0SEewkDDZ9m-1KnZHTMdUIeYNmqcewHsgjcdcb2V2e-iEPwCnhIBypJspVxE6c4p0zZhaIBCAClF7lbHyDjyvlSrWVii4ehVvsXLbuFkEs9fo9Zt5xW-IQ9alZYl86prShzzQeTlHzhNtQ8KSITd2f_nygeNHgi2-WwvTaHVohWkfK7yE7vaa_kBitOugcFADOrCUzQK_2Kmsl_2_akMAap_OzdjhLjPpQWDCpqG1XE1eNBiRnFXk4Ad4co0.Nug7EPkkF16OW9rpWRv3dw" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1485, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://openam-frodo-dev.forgeblocks.com/environment/secrets" + }, + "response": { + "bodySize": 2330, + "content": { + "mimeType": "application/json", + "size": 2330, + "text": "{\"pagedResultsCookie\":null,\"remainingPagedResults\":-1,\"result\":[{\"_id\":\"esv-admin-token\",\"activeVersion\":\"1\",\"description\":\"Long-lived admin token\",\"encoding\":\"generic\",\"lastChangeDate\":\"2022-08-11T22:32:38.056Z\",\"lastChangedBy\":\"8efaa5b6-8c98-4489-9b21-ee41f5589ab7\",\"loaded\":true,\"loadedVersion\":\"1\",\"useInPlaceholders\":true},{\"_id\":\"esv-admin-token-1999386457729\",\"activeVersion\":\"1\",\"description\":\"Long-lived admin token\",\"encoding\":\"generic\",\"lastChangeDate\":\"2023-05-14T01:07:41.970Z\",\"lastChangedBy\":\"8d9723a9-a439-4cbf-beb4-30e52811789d\",\"loaded\":true,\"loadedVersion\":\"1\",\"useInPlaceholders\":true},{\"_id\":\"esv-frodo-test-secret-1\",\"activeVersion\":\"1\",\"description\":\"description1\",\"encoding\":\"generic\",\"lastChangeDate\":\"2023-10-24T15:31:53.340Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":false,\"loadedVersion\":\"\",\"useInPlaceholders\":true},{\"_id\":\"esv-frodo-test-secret-2\",\"activeVersion\":\"1\",\"description\":\"description2\",\"encoding\":\"generic\",\"lastChangeDate\":\"2023-10-24T15:31:54.872Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"loadedVersion\":\"1\",\"useInPlaceholders\":false},{\"_id\":\"esv-test-secret\",\"activeVersion\":\"2\",\"description\":\"Secret Value for testing\",\"encoding\":\"generic\",\"lastChangeDate\":\"2023-08-09T19:00:01.501Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"loadedVersion\":\"2\",\"useInPlaceholders\":true},{\"_id\":\"esv-test-secret-1\",\"activeVersion\":\"1\",\"description\":\"test secret one\",\"encoding\":\"generic\",\"lastChangeDate\":\"2023-08-06T03:53:17.716Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"loadedVersion\":\"1\",\"useInPlaceholders\":true},{\"_id\":\"esv-test-secret-pi-generic\",\"activeVersion\":\"1\",\"description\":\"This is a test secret containing the value pi.\",\"encoding\":\"generic\",\"lastChangeDate\":\"2023-10-17T22:37:13.115Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"loadedVersion\":\"1\",\"useInPlaceholders\":true},{\"_id\":\"esv-test-secret-pi-generic2\",\"activeVersion\":\"1\",\"description\":\"This is a test secret containing the value pi.\",\"encoding\":\"generic\",\"lastChangeDate\":\"2023-10-18T21:45:46.571Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"loadedVersion\":\"1\",\"useInPlaceholders\":false}],\"resultCount\":8,\"totalPagedResults\":-1,\"totalPagedResultsPolicy\":\"NONE\"}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "date", + "value": "Tue, 24 Oct 2023 15:31:56 GMT" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 247, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2023-10-24T15:31:55.723Z", + "time": 858, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 858 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/src/test/mock-recordings/VariablesOps_1746822178/exportVariable_1902345524/1-Export-variable1_1287514759/recording.har b/src/test/mock-recordings/VariablesOps_1746822178/exportVariable_1902345524/1-Export-variable1_1287514759/recording.har new file mode 100644 index 000000000..854459973 --- /dev/null +++ b/src/test/mock-recordings/VariablesOps_1746822178/exportVariable_1902345524/1-Export-variable1_1287514759/recording.har @@ -0,0 +1,105 @@ +{ + "log": { + "_recordingName": "VariablesOps/exportVariable()/1: Export variable1", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "08d2dea99990c33037034cf27a34b5ad", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/2.0.0-45" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "accept-api-version", + "value": "protocol=1.0,resource=1.0" + }, + { + "name": "authorization", + "value": "Bearer eyJ0eXAiOiJKV1QiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiYWxnIjoiZGlyIn0..jGQHIoYDHbORCMlQVBkjmw.00qB-Dn-5KWwpkWJCW5Ywz9MD2VTydyxEPxMDws1PNVBSeF1UZF4GL7Dmi70bdG5KVFovb1PO6iQGr-AXphS6QYLMJW6HKtpUQYIMws63xse490MNOQ8k_RS8JxHX_iJdmfWTp9Agsbx5wEANdXX7txEHe8czpU-g_6QCYlEdfjDfHkw-XNHX927JNWE0_Uz9jYqWWFIzgl_Xi3SGjW2PNrXjdyJ5MfYhNMw7PqD-6ysDNsyHQBxxQDhVZx8t1KaD6jIamkUiddn438ffezX_hX4WfUnYmcxMUxRi98KDDdSyGb1SKoqR-JtWqJKPsqv2hlE4GJo0pRrLZB_PEKAR0aZjwv4FVbOnQ832-9Byr8WpHvb79v5cW6aTdGCfmsTa8RoR6BbcsrH5rfSBEBnv2V9elFj8L4NM725RSk8lwzQbvpZ292J7VgfaNgdlG8PMytPGMEqHECAjcX63VyrKY_47wNkeop1sJudzq7_jRUQo5Cq85aSbIU-jD-IFTop0i6JUKp2MSLdQzUdJ9fVAVfzuyyqlhnAoP5FUJOmuWjZNGWdYaja1x_4otth0-haaIyCZzuKbJ5eTS5fjf6sqwXBCNadMhSyMQetb89PkJ3OYU_pQ5wSdOsabg7p5-brTZ0Fnb52WYQSODAvEAVl48ILu0tFfg1radXf42glEyAm83tVTRxUg_8PeOeMhA3-EWZvz5d4_CJnicKjSf__ne7Q0Gih0z-yJXHjQKKHdaN-9VmIZcPOXkJl6ndrC96Ze2Nm4XfqFaSf6grunL5n3THtcAx6K_hYVrLLHNjeDZx54SIgze_yZIM9nzQppRnOm8svqzo-hI7ArhyGjgGutdrRVYRA49Jta1Ts5O7cCXu1BOd9EXdvDmjAqjTkz6kik0kO2HoG2e8x5pclgedKs-a2gsCLP_iXRu0_z3IJwwtbvJHhbHySUZDYlzcRVQXpbx6zxD2llYZgJOJMBRawtzT-AUhWCum6n4UrHcyj8F0frFt1ndqvuU1vZPLRZtO0wLxsYb0Xolyss-9wFWHTF2IX7PM4rNmD8VLxRqIANXk.Hs4xNJI9FAdKfZXxFwAAKw" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1513, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://openam-frodo-dev.forgeblocks.com/environment/variables/esv-frodo-test-variable-1" + }, + "response": { + "bodySize": 230, + "content": { + "mimeType": "application/json", + "size": 230, + "text": "{\"_id\":\"esv-frodo-test-variable-1\",\"description\":\"description1\",\"expressionType\":\"string\",\"lastChangeDate\":\"2023-10-24T17:40:50.223Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":false,\"valueBase64\":\"dmFsdWUx\"}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "date", + "value": "Tue, 24 Oct 2023 17:41:03 GMT" + }, + { + "name": "content-length", + "value": "230" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 240, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2023-10-24T17:41:03.016Z", + "time": 346, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 346 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/src/test/mock-recordings/VariablesOps_1746822178/exportVariable_1902345524/2-Export-variable2-without-decoding_3456660472/recording.har b/src/test/mock-recordings/VariablesOps_1746822178/exportVariable_1902345524/2-Export-variable2-without-decoding_3456660472/recording.har new file mode 100644 index 000000000..d16e9e2f9 --- /dev/null +++ b/src/test/mock-recordings/VariablesOps_1746822178/exportVariable_1902345524/2-Export-variable2-without-decoding_3456660472/recording.har @@ -0,0 +1,105 @@ +{ + "log": { + "_recordingName": "VariablesOps/exportVariable()/2: Export variable2 without decoding", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "004d2665b8752e3b0f64040d71694d79", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/2.0.0-45" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "accept-api-version", + "value": "protocol=1.0,resource=1.0" + }, + { + "name": "authorization", + "value": "Bearer eyJ0eXAiOiJKV1QiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiYWxnIjoiZGlyIn0..jGQHIoYDHbORCMlQVBkjmw.00qB-Dn-5KWwpkWJCW5Ywz9MD2VTydyxEPxMDws1PNVBSeF1UZF4GL7Dmi70bdG5KVFovb1PO6iQGr-AXphS6QYLMJW6HKtpUQYIMws63xse490MNOQ8k_RS8JxHX_iJdmfWTp9Agsbx5wEANdXX7txEHe8czpU-g_6QCYlEdfjDfHkw-XNHX927JNWE0_Uz9jYqWWFIzgl_Xi3SGjW2PNrXjdyJ5MfYhNMw7PqD-6ysDNsyHQBxxQDhVZx8t1KaD6jIamkUiddn438ffezX_hX4WfUnYmcxMUxRi98KDDdSyGb1SKoqR-JtWqJKPsqv2hlE4GJo0pRrLZB_PEKAR0aZjwv4FVbOnQ832-9Byr8WpHvb79v5cW6aTdGCfmsTa8RoR6BbcsrH5rfSBEBnv2V9elFj8L4NM725RSk8lwzQbvpZ292J7VgfaNgdlG8PMytPGMEqHECAjcX63VyrKY_47wNkeop1sJudzq7_jRUQo5Cq85aSbIU-jD-IFTop0i6JUKp2MSLdQzUdJ9fVAVfzuyyqlhnAoP5FUJOmuWjZNGWdYaja1x_4otth0-haaIyCZzuKbJ5eTS5fjf6sqwXBCNadMhSyMQetb89PkJ3OYU_pQ5wSdOsabg7p5-brTZ0Fnb52WYQSODAvEAVl48ILu0tFfg1radXf42glEyAm83tVTRxUg_8PeOeMhA3-EWZvz5d4_CJnicKjSf__ne7Q0Gih0z-yJXHjQKKHdaN-9VmIZcPOXkJl6ndrC96Ze2Nm4XfqFaSf6grunL5n3THtcAx6K_hYVrLLHNjeDZx54SIgze_yZIM9nzQppRnOm8svqzo-hI7ArhyGjgGutdrRVYRA49Jta1Ts5O7cCXu1BOd9EXdvDmjAqjTkz6kik0kO2HoG2e8x5pclgedKs-a2gsCLP_iXRu0_z3IJwwtbvJHhbHySUZDYlzcRVQXpbx6zxD2llYZgJOJMBRawtzT-AUhWCum6n4UrHcyj8F0frFt1ndqvuU1vZPLRZtO0wLxsYb0Xolyss-9wFWHTF2IX7PM4rNmD8VLxRqIANXk.Hs4xNJI9FAdKfZXxFwAAKw" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1513, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://openam-frodo-dev.forgeblocks.com/environment/variables/esv-frodo-test-variable-2" + }, + "response": { + "bodySize": 223, + "content": { + "mimeType": "application/json", + "size": 223, + "text": "{\"_id\":\"esv-frodo-test-variable-2\",\"description\":\"description2\",\"expressionType\":\"int\",\"lastChangeDate\":\"2023-10-24T17:40:54.286Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":false,\"valueBase64\":\"NDI=\"}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "date", + "value": "Tue, 24 Oct 2023 17:41:03 GMT" + }, + { + "name": "content-length", + "value": "223" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 240, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2023-10-24T17:41:03.437Z", + "time": 471, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 471 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/src/test/mock-recordings/VariablesOps_1746822178/exportVariable_1902345524/2-Export-variable2_2192552259/recording.har b/src/test/mock-recordings/VariablesOps_1746822178/exportVariable_1902345524/2-Export-variable2_2192552259/recording.har new file mode 100644 index 000000000..3b2a9134e --- /dev/null +++ b/src/test/mock-recordings/VariablesOps_1746822178/exportVariable_1902345524/2-Export-variable2_2192552259/recording.har @@ -0,0 +1,105 @@ +{ + "log": { + "_recordingName": "VariablesOps/exportVariable()/2: Export variable2", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "004d2665b8752e3b0f64040d71694d79", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/2.0.0-45" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "accept-api-version", + "value": "protocol=1.0,resource=1.0" + }, + { + "name": "authorization", + "value": "Bearer eyJ0eXAiOiJKV1QiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiYWxnIjoiZGlyIn0..U9Sec1wxs_mIS75866NCWQ.5EzKBs7I4jK7xGZ6wMZF_iQ7zJMWlGcIfVX4WAJxkMtn1Q3ehp9UWnwNY7jzvk2NQ7fDRfZklpxJ1dzYCG1EH_sQqFGeG8lKo8Wej0JdFJoMCDxVP5dXaS-QyLcpgC-k-tTrBK4qSFx96oZlhGBLDvygT3GO3daK6DH3duxTKhDe6XEngmksHfe6y2A_1RiwHQ4Aur1dB0MdFmhWwYbL0YpApFgRH4a9RaEPTSD_mDNHJ6P_AS7ynkjlJ8NpEEOfnsoq3IUIXJ20Oqvrpn5hrbBMOXVssUENJhjxeSH63zmYdZYE6ME4VJBFBV-jAThQ12l-tkkuuZC_qTYqu4PjrnW7tV7Evj5gXFQdsnoIP7mgNkeR-q779bHBxMnebazRXbmYqSeS8Fbx167mO2XhXWYS60Btf4w3XPL81eFp9QXPjVEg10WIjrJZ13R7sW4RexZFNEfXp7CeyT_rFg53E7MMDiYos97xpfJFU-Ytat9oQB6UxY8Jhe33fCtVF-sbjjqYIwVGPbhrt5uhMbx17d4ih-ygZZTC3iJS-Mu--u-iLD-A5mdERUJKjkAmz6beD9iUgccaSjuWOjp0RtvRLliFsRY1EdqF2gMLHz_melbTYF_DOUwiF4UE41q1JRL5vW5oa8jv0f-XlxdfCy1qoyCtA0xUkGadkmlXeIuSzTqcSu5RrzrqhxwNQ_CkfhS4bnSvE1ZDdl9-y-wWP1ZNqZQ7JjZj_rHgUzpQ_EBrYqPdqZrzD0AGLRRAnkDIEfMZdRmZUp0DA4uiDcEQu8Zf5QsnQCiW279qeGoUXEFDi8c4_DgnweXFWevnRxV8js9uGb_DhztBP6qwVhnpliaza8jOCEcuRXrw8vTTPlFsvarvL1z75CWqYvhDF2NYGrbiieogtQMq9TccL1ApnY9608eZ5_IQqfmtdzIufdi2bouZQRxkCgBl3ZYeHSop70luzv5XAb20GcrHMpLZS9KvgDjE6TgGAtxZIcHVJx0b3XhEHoyOWPzDUhpq4zxYcjmYRcWSb3pYnnymo-YdqqU5iQg12Dt2GjXmXV-AOUG8Df4.tT-4K20vO0idEl_pB_K7_A" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1513, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://openam-frodo-dev.forgeblocks.com/environment/variables/esv-frodo-test-variable-2" + }, + "response": { + "bodySize": 223, + "content": { + "mimeType": "application/json", + "size": 223, + "text": "{\"_id\":\"esv-frodo-test-variable-2\",\"description\":\"description2\",\"expressionType\":\"int\",\"lastChangeDate\":\"2023-10-24T17:37:40.825Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":false,\"valueBase64\":\"NDI=\"}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "date", + "value": "Tue, 24 Oct 2023 17:37:49 GMT" + }, + { + "name": "content-length", + "value": "223" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 240, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2023-10-24T17:37:48.660Z", + "time": 473, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 473 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/src/test/mock-recordings/VariablesOps_1746822178/exportVariable_1902345524/3-Export-variable3-non-existent_4175820452/recording.har b/src/test/mock-recordings/VariablesOps_1746822178/exportVariable_1902345524/3-Export-variable3-non-existent_4175820452/recording.har new file mode 100644 index 000000000..fbcd2b2b0 --- /dev/null +++ b/src/test/mock-recordings/VariablesOps_1746822178/exportVariable_1902345524/3-Export-variable3-non-existent_4175820452/recording.har @@ -0,0 +1,105 @@ +{ + "log": { + "_recordingName": "VariablesOps/exportVariable()/3: Export variable3 (non-existent)", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "9875b020397c53e92bd855c668fe55d1", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/2.0.0-45" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "accept-api-version", + "value": "protocol=1.0,resource=1.0" + }, + { + "name": "authorization", + "value": "Bearer eyJ0eXAiOiJKV1QiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiYWxnIjoiZGlyIn0..jGQHIoYDHbORCMlQVBkjmw.00qB-Dn-5KWwpkWJCW5Ywz9MD2VTydyxEPxMDws1PNVBSeF1UZF4GL7Dmi70bdG5KVFovb1PO6iQGr-AXphS6QYLMJW6HKtpUQYIMws63xse490MNOQ8k_RS8JxHX_iJdmfWTp9Agsbx5wEANdXX7txEHe8czpU-g_6QCYlEdfjDfHkw-XNHX927JNWE0_Uz9jYqWWFIzgl_Xi3SGjW2PNrXjdyJ5MfYhNMw7PqD-6ysDNsyHQBxxQDhVZx8t1KaD6jIamkUiddn438ffezX_hX4WfUnYmcxMUxRi98KDDdSyGb1SKoqR-JtWqJKPsqv2hlE4GJo0pRrLZB_PEKAR0aZjwv4FVbOnQ832-9Byr8WpHvb79v5cW6aTdGCfmsTa8RoR6BbcsrH5rfSBEBnv2V9elFj8L4NM725RSk8lwzQbvpZ292J7VgfaNgdlG8PMytPGMEqHECAjcX63VyrKY_47wNkeop1sJudzq7_jRUQo5Cq85aSbIU-jD-IFTop0i6JUKp2MSLdQzUdJ9fVAVfzuyyqlhnAoP5FUJOmuWjZNGWdYaja1x_4otth0-haaIyCZzuKbJ5eTS5fjf6sqwXBCNadMhSyMQetb89PkJ3OYU_pQ5wSdOsabg7p5-brTZ0Fnb52WYQSODAvEAVl48ILu0tFfg1radXf42glEyAm83tVTRxUg_8PeOeMhA3-EWZvz5d4_CJnicKjSf__ne7Q0Gih0z-yJXHjQKKHdaN-9VmIZcPOXkJl6ndrC96Ze2Nm4XfqFaSf6grunL5n3THtcAx6K_hYVrLLHNjeDZx54SIgze_yZIM9nzQppRnOm8svqzo-hI7ArhyGjgGutdrRVYRA49Jta1Ts5O7cCXu1BOd9EXdvDmjAqjTkz6kik0kO2HoG2e8x5pclgedKs-a2gsCLP_iXRu0_z3IJwwtbvJHhbHySUZDYlzcRVQXpbx6zxD2llYZgJOJMBRawtzT-AUhWCum6n4UrHcyj8F0frFt1ndqvuU1vZPLRZtO0wLxsYb0Xolyss-9wFWHTF2IX7PM4rNmD8VLxRqIANXk.Hs4xNJI9FAdKfZXxFwAAKw" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1513, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://openam-frodo-dev.forgeblocks.com/environment/variables/esv-frodo-test-variable-3" + }, + "response": { + "bodySize": 53, + "content": { + "mimeType": "application/json", + "size": 53, + "text": "{\"code\":404,\"message\":\"The variable does not exist\"}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "date", + "value": "Tue, 24 Oct 2023 17:41:04 GMT" + }, + { + "name": "content-length", + "value": "53" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 239, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2023-10-24T17:41:03.922Z", + "time": 225, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 225 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/src/test/mock-recordings/VariablesOps_1746822178/exportVariables_2500480215/1-Export-all-variables_3817480522/recording.har b/src/test/mock-recordings/VariablesOps_1746822178/exportVariables_2500480215/1-Export-all-variables_3817480522/recording.har new file mode 100644 index 000000000..eb3a7fd3a --- /dev/null +++ b/src/test/mock-recordings/VariablesOps_1746822178/exportVariables_2500480215/1-Export-all-variables_3817480522/recording.har @@ -0,0 +1,105 @@ +{ + "log": { + "_recordingName": "VariablesOps/exportVariables()/1: Export all variables", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "49c64431f90c263c4e22873dcf498dcb", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/2.0.0-45" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "accept-api-version", + "value": "protocol=1.0,resource=1.0" + }, + { + "name": "authorization", + "value": "Bearer eyJ0eXAiOiJKV1QiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiYWxnIjoiZGlyIn0..jGQHIoYDHbORCMlQVBkjmw.00qB-Dn-5KWwpkWJCW5Ywz9MD2VTydyxEPxMDws1PNVBSeF1UZF4GL7Dmi70bdG5KVFovb1PO6iQGr-AXphS6QYLMJW6HKtpUQYIMws63xse490MNOQ8k_RS8JxHX_iJdmfWTp9Agsbx5wEANdXX7txEHe8czpU-g_6QCYlEdfjDfHkw-XNHX927JNWE0_Uz9jYqWWFIzgl_Xi3SGjW2PNrXjdyJ5MfYhNMw7PqD-6ysDNsyHQBxxQDhVZx8t1KaD6jIamkUiddn438ffezX_hX4WfUnYmcxMUxRi98KDDdSyGb1SKoqR-JtWqJKPsqv2hlE4GJo0pRrLZB_PEKAR0aZjwv4FVbOnQ832-9Byr8WpHvb79v5cW6aTdGCfmsTa8RoR6BbcsrH5rfSBEBnv2V9elFj8L4NM725RSk8lwzQbvpZ292J7VgfaNgdlG8PMytPGMEqHECAjcX63VyrKY_47wNkeop1sJudzq7_jRUQo5Cq85aSbIU-jD-IFTop0i6JUKp2MSLdQzUdJ9fVAVfzuyyqlhnAoP5FUJOmuWjZNGWdYaja1x_4otth0-haaIyCZzuKbJ5eTS5fjf6sqwXBCNadMhSyMQetb89PkJ3OYU_pQ5wSdOsabg7p5-brTZ0Fnb52WYQSODAvEAVl48ILu0tFfg1radXf42glEyAm83tVTRxUg_8PeOeMhA3-EWZvz5d4_CJnicKjSf__ne7Q0Gih0z-yJXHjQKKHdaN-9VmIZcPOXkJl6ndrC96Ze2Nm4XfqFaSf6grunL5n3THtcAx6K_hYVrLLHNjeDZx54SIgze_yZIM9nzQppRnOm8svqzo-hI7ArhyGjgGutdrRVYRA49Jta1Ts5O7cCXu1BOd9EXdvDmjAqjTkz6kik0kO2HoG2e8x5pclgedKs-a2gsCLP_iXRu0_z3IJwwtbvJHhbHySUZDYlzcRVQXpbx6zxD2llYZgJOJMBRawtzT-AUhWCum6n4UrHcyj8F0frFt1ndqvuU1vZPLRZtO0wLxsYb0Xolyss-9wFWHTF2IX7PM4rNmD8VLxRqIANXk.Hs4xNJI9FAdKfZXxFwAAKw" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1487, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://openam-frodo-dev.forgeblocks.com/environment/variables" + }, + "response": { + "bodySize": 4274, + "content": { + "mimeType": "application/json", + "size": 4274, + "text": "{\"pagedResultsCookie\":null,\"remainingPagedResults\":-1,\"result\":[{\"_id\":\"esv-blue-piller\",\"description\":\"Zion membership criteria.\",\"expressionType\":\"bool\",\"lastChangeDate\":\"2023-07-18T22:21:38.640Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"valueBase64\":\"ZmFsc2U=\"},{\"_id\":\"esv-frodo-test-variable-1\",\"description\":\"description1\",\"expressionType\":\"string\",\"lastChangeDate\":\"2023-10-24T17:40:50.223Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":false,\"valueBase64\":\"dmFsdWUx\"},{\"_id\":\"esv-frodo-test-variable-2\",\"description\":\"description2\",\"expressionType\":\"int\",\"lastChangeDate\":\"2023-10-24T17:40:54.286Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":false,\"valueBase64\":\"NDI=\"},{\"_id\":\"esv-ipv4-cidr-access-rules\",\"description\":\"IPv4 CIDR access rules:\\n{\\n \\\"allow\\\": [\\n \\\"address/mask\\\"\\n ]\\n}\",\"expressionType\":\"\",\"lastChangeDate\":\"2022-08-25T22:54:28.551Z\",\"lastChangedBy\":\"8efaa5b6-8c98-4489-9b21-ee41f5589ab7\",\"loaded\":true,\"valueBase64\":\"eyAgImFsbG93IjogWyAgICAiMTUwLjEyOC4wLjAvMTYiLCAgICAiMTM5LjM1LjAuMC8xNiIsICAgICIxMDEuMjE2LjAuMC8xNiIsICAgICI5OS43Mi4yOC4xODIvMzIiICBdfQ==\"},{\"_id\":\"esv-nebuchadnezzar-crew\",\"description\":\"The crew of the Nebuchadnezzar hovercraft.\",\"expressionType\":\"array\",\"lastChangeDate\":\"2023-07-18T21:59:58.974Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"valueBase64\":\"WyJNb3JwaGV1cyIsIlRyaW5pdHkiLCJMaW5rIiwiVGFuayIsIkRvemVyIiwiQXBvYyIsIkN5cGhlciIsIk1vdXNlIiwiTmVvIiwiU3dpdGNoIl0=\"},{\"_id\":\"esv-nebuchadnezzar-crew-structure\",\"description\":\"The structure of the crew of the Nebuchadnezzar hovercraft.\",\"expressionType\":\"object\",\"lastChangeDate\":\"2023-07-18T22:09:54.630Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"valueBase64\":\"eyJDYXB0YWluIjoiTW9ycGhldXMiLCJGaXJzdE1hdGUiOiJUcmluaXR5IiwiT3BlcmF0b3IiOlsiTGluayIsIlRhbmsiXSwiTWVkaWMiOiJEb3plciIsIkNyZXdtZW4iOlsiQXBvYyIsIkN5cGhlciIsIk1vdXNlIiwiTmVvIiwiU3dpdGNoIl19\"},{\"_id\":\"esv-neo-age\",\"description\":\"Neo's age in the matrix.\",\"expressionType\":\"int\",\"lastChangeDate\":\"2023-07-18T22:21:23.578Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"valueBase64\":\"Mjg=\"},{\"_id\":\"esv-test-var\",\"description\":\"this is a test description\",\"expressionType\":\"\",\"lastChangeDate\":\"2022-09-02T04:23:56.075Z\",\"lastChangedBy\":\"8efaa5b6-8c98-4489-9b21-ee41f5589ab7\",\"loaded\":true,\"valueBase64\":\"dGhpcyBpcyBhIHRlc3QgdmFyaWFibGU=\"},{\"_id\":\"esv-test-var-1\",\"description\":\"test var one\",\"expressionType\":\"string\",\"lastChangeDate\":\"2023-08-09T17:42:41.684Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"valueBase64\":\"dGVzdCB2YXIgMSB2YWx1ZTI=\"},{\"_id\":\"esv-test-var-2\",\"description\":\"A temporary test variable\",\"expressionType\":\"string\",\"lastChangeDate\":\"2023-08-02T21:09:01.847Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"valueBase64\":\"dGVzdHZhbA==\"},{\"_id\":\"esv-test-var-3\",\"description\":\"This is a test variable\",\"expressionType\":\"int\",\"lastChangeDate\":\"2023-10-17T22:22:52.023Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"valueBase64\":\"NDI=\"},{\"_id\":\"esv-test-var-pi\",\"description\":\"This is another test variable.\",\"expressionType\":\"number\",\"lastChangeDate\":\"2023-10-17T22:28:44.529Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"valueBase64\":\"My4xNDE1OTI2\"},{\"_id\":\"esv-test-var-pi-string\",\"description\":\"This is another test variable.\",\"expressionType\":\"string\",\"lastChangeDate\":\"2023-10-18T22:05:30.300Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"valueBase64\":\"My4xNDE1OTI2\"},{\"_id\":\"esv-trinity-phone\",\"description\":\"In the opening of The Matrix (1999), the phone number Trinity is calling from is traced to (312)-555-0690\",\"expressionType\":\"string\",\"lastChangeDate\":\"2023-07-18T20:33:28.922Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"valueBase64\":\"KDMxMiktNTU1LTA2OTA=\"},{\"_id\":\"esv-volkerstestvariable1\",\"description\":\"variable created for api testing\",\"expressionType\":\"\",\"lastChangeDate\":\"2022-11-30T00:13:52.478Z\",\"lastChangedBy\":\"10ecab02-f357-4522-bc17-dfcc64744064\",\"loaded\":true,\"valueBase64\":\"Zm9yIGplc3Q=\"}],\"resultCount\":15,\"totalPagedResults\":-1,\"totalPagedResultsPolicy\":\"NONE\"}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "date", + "value": "Tue, 24 Oct 2023 17:41:00 GMT" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 247, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2023-10-24T17:40:57.810Z", + "time": 2646, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 2646 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/src/test/mock-recordings/VariablesOps_1746822178/exportVariables_2500480215/2-Export-all-variables-without-decoding_841441648/recording.har b/src/test/mock-recordings/VariablesOps_1746822178/exportVariables_2500480215/2-Export-all-variables-without-decoding_841441648/recording.har new file mode 100644 index 000000000..7c85f7a12 --- /dev/null +++ b/src/test/mock-recordings/VariablesOps_1746822178/exportVariables_2500480215/2-Export-all-variables-without-decoding_841441648/recording.har @@ -0,0 +1,105 @@ +{ + "log": { + "_recordingName": "VariablesOps/exportVariables()/2: Export all variables without decoding", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.6" + }, + "entries": [ + { + "_id": "49c64431f90c263c4e22873dcf498dcb", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "name": "accept", + "value": "application/json, text/plain, */*" + }, + { + "name": "user-agent", + "value": "@rockcarver/frodo-lib/2.0.0-45" + }, + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "accept-api-version", + "value": "protocol=1.0,resource=1.0" + }, + { + "name": "authorization", + "value": "Bearer eyJ0eXAiOiJKV1QiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiYWxnIjoiZGlyIn0..jGQHIoYDHbORCMlQVBkjmw.00qB-Dn-5KWwpkWJCW5Ywz9MD2VTydyxEPxMDws1PNVBSeF1UZF4GL7Dmi70bdG5KVFovb1PO6iQGr-AXphS6QYLMJW6HKtpUQYIMws63xse490MNOQ8k_RS8JxHX_iJdmfWTp9Agsbx5wEANdXX7txEHe8czpU-g_6QCYlEdfjDfHkw-XNHX927JNWE0_Uz9jYqWWFIzgl_Xi3SGjW2PNrXjdyJ5MfYhNMw7PqD-6ysDNsyHQBxxQDhVZx8t1KaD6jIamkUiddn438ffezX_hX4WfUnYmcxMUxRi98KDDdSyGb1SKoqR-JtWqJKPsqv2hlE4GJo0pRrLZB_PEKAR0aZjwv4FVbOnQ832-9Byr8WpHvb79v5cW6aTdGCfmsTa8RoR6BbcsrH5rfSBEBnv2V9elFj8L4NM725RSk8lwzQbvpZ292J7VgfaNgdlG8PMytPGMEqHECAjcX63VyrKY_47wNkeop1sJudzq7_jRUQo5Cq85aSbIU-jD-IFTop0i6JUKp2MSLdQzUdJ9fVAVfzuyyqlhnAoP5FUJOmuWjZNGWdYaja1x_4otth0-haaIyCZzuKbJ5eTS5fjf6sqwXBCNadMhSyMQetb89PkJ3OYU_pQ5wSdOsabg7p5-brTZ0Fnb52WYQSODAvEAVl48ILu0tFfg1radXf42glEyAm83tVTRxUg_8PeOeMhA3-EWZvz5d4_CJnicKjSf__ne7Q0Gih0z-yJXHjQKKHdaN-9VmIZcPOXkJl6ndrC96Ze2Nm4XfqFaSf6grunL5n3THtcAx6K_hYVrLLHNjeDZx54SIgze_yZIM9nzQppRnOm8svqzo-hI7ArhyGjgGutdrRVYRA49Jta1Ts5O7cCXu1BOd9EXdvDmjAqjTkz6kik0kO2HoG2e8x5pclgedKs-a2gsCLP_iXRu0_z3IJwwtbvJHhbHySUZDYlzcRVQXpbx6zxD2llYZgJOJMBRawtzT-AUhWCum6n4UrHcyj8F0frFt1ndqvuU1vZPLRZtO0wLxsYb0Xolyss-9wFWHTF2IX7PM4rNmD8VLxRqIANXk.Hs4xNJI9FAdKfZXxFwAAKw" + }, + { + "name": "host", + "value": "openam-frodo-dev.forgeblocks.com" + } + ], + "headersSize": 1487, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://openam-frodo-dev.forgeblocks.com/environment/variables" + }, + "response": { + "bodySize": 4274, + "content": { + "mimeType": "application/json", + "size": 4274, + "text": "{\"pagedResultsCookie\":null,\"remainingPagedResults\":-1,\"result\":[{\"_id\":\"esv-blue-piller\",\"description\":\"Zion membership criteria.\",\"expressionType\":\"bool\",\"lastChangeDate\":\"2023-07-18T22:21:38.640Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"valueBase64\":\"ZmFsc2U=\"},{\"_id\":\"esv-frodo-test-variable-1\",\"description\":\"description1\",\"expressionType\":\"string\",\"lastChangeDate\":\"2023-10-24T17:40:50.223Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":false,\"valueBase64\":\"dmFsdWUx\"},{\"_id\":\"esv-frodo-test-variable-2\",\"description\":\"description2\",\"expressionType\":\"int\",\"lastChangeDate\":\"2023-10-24T17:40:54.286Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":false,\"valueBase64\":\"NDI=\"},{\"_id\":\"esv-ipv4-cidr-access-rules\",\"description\":\"IPv4 CIDR access rules:\\n{\\n \\\"allow\\\": [\\n \\\"address/mask\\\"\\n ]\\n}\",\"expressionType\":\"\",\"lastChangeDate\":\"2022-08-25T22:54:28.551Z\",\"lastChangedBy\":\"8efaa5b6-8c98-4489-9b21-ee41f5589ab7\",\"loaded\":true,\"valueBase64\":\"eyAgImFsbG93IjogWyAgICAiMTUwLjEyOC4wLjAvMTYiLCAgICAiMTM5LjM1LjAuMC8xNiIsICAgICIxMDEuMjE2LjAuMC8xNiIsICAgICI5OS43Mi4yOC4xODIvMzIiICBdfQ==\"},{\"_id\":\"esv-nebuchadnezzar-crew\",\"description\":\"The crew of the Nebuchadnezzar hovercraft.\",\"expressionType\":\"array\",\"lastChangeDate\":\"2023-07-18T21:59:58.974Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"valueBase64\":\"WyJNb3JwaGV1cyIsIlRyaW5pdHkiLCJMaW5rIiwiVGFuayIsIkRvemVyIiwiQXBvYyIsIkN5cGhlciIsIk1vdXNlIiwiTmVvIiwiU3dpdGNoIl0=\"},{\"_id\":\"esv-nebuchadnezzar-crew-structure\",\"description\":\"The structure of the crew of the Nebuchadnezzar hovercraft.\",\"expressionType\":\"object\",\"lastChangeDate\":\"2023-07-18T22:09:54.630Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"valueBase64\":\"eyJDYXB0YWluIjoiTW9ycGhldXMiLCJGaXJzdE1hdGUiOiJUcmluaXR5IiwiT3BlcmF0b3IiOlsiTGluayIsIlRhbmsiXSwiTWVkaWMiOiJEb3plciIsIkNyZXdtZW4iOlsiQXBvYyIsIkN5cGhlciIsIk1vdXNlIiwiTmVvIiwiU3dpdGNoIl19\"},{\"_id\":\"esv-neo-age\",\"description\":\"Neo's age in the matrix.\",\"expressionType\":\"int\",\"lastChangeDate\":\"2023-07-18T22:21:23.578Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"valueBase64\":\"Mjg=\"},{\"_id\":\"esv-test-var\",\"description\":\"this is a test description\",\"expressionType\":\"\",\"lastChangeDate\":\"2022-09-02T04:23:56.075Z\",\"lastChangedBy\":\"8efaa5b6-8c98-4489-9b21-ee41f5589ab7\",\"loaded\":true,\"valueBase64\":\"dGhpcyBpcyBhIHRlc3QgdmFyaWFibGU=\"},{\"_id\":\"esv-test-var-1\",\"description\":\"test var one\",\"expressionType\":\"string\",\"lastChangeDate\":\"2023-08-09T17:42:41.684Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"valueBase64\":\"dGVzdCB2YXIgMSB2YWx1ZTI=\"},{\"_id\":\"esv-test-var-2\",\"description\":\"A temporary test variable\",\"expressionType\":\"string\",\"lastChangeDate\":\"2023-08-02T21:09:01.847Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"valueBase64\":\"dGVzdHZhbA==\"},{\"_id\":\"esv-test-var-3\",\"description\":\"This is a test variable\",\"expressionType\":\"int\",\"lastChangeDate\":\"2023-10-17T22:22:52.023Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"valueBase64\":\"NDI=\"},{\"_id\":\"esv-test-var-pi\",\"description\":\"This is another test variable.\",\"expressionType\":\"number\",\"lastChangeDate\":\"2023-10-17T22:28:44.529Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"valueBase64\":\"My4xNDE1OTI2\"},{\"_id\":\"esv-test-var-pi-string\",\"description\":\"This is another test variable.\",\"expressionType\":\"string\",\"lastChangeDate\":\"2023-10-18T22:05:30.300Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"valueBase64\":\"My4xNDE1OTI2\"},{\"_id\":\"esv-trinity-phone\",\"description\":\"In the opening of The Matrix (1999), the phone number Trinity is calling from is traced to (312)-555-0690\",\"expressionType\":\"string\",\"lastChangeDate\":\"2023-07-18T20:33:28.922Z\",\"lastChangedBy\":\"b672336b-41ef-428d-ae4a-e0c082875377\",\"loaded\":true,\"valueBase64\":\"KDMxMiktNTU1LTA2OTA=\"},{\"_id\":\"esv-volkerstestvariable1\",\"description\":\"variable created for api testing\",\"expressionType\":\"\",\"lastChangeDate\":\"2022-11-30T00:13:52.478Z\",\"lastChangedBy\":\"10ecab02-f357-4522-bc17-dfcc64744064\",\"loaded\":true,\"valueBase64\":\"Zm9yIGplc3Q=\"}],\"resultCount\":15,\"totalPagedResults\":-1,\"totalPagedResultsPolicy\":\"NONE\"}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + }, + { + "name": "date", + "value": "Tue, 24 Oct 2023 17:41:02 GMT" + }, + { + "name": "transfer-encoding", + "value": "chunked" + }, + { + "name": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains; preload;" + }, + { + "name": "via", + "value": "1.1 google" + }, + { + "name": "alt-svc", + "value": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000" + } + ], + "headersSize": 247, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2023-10-24T17:41:00.513Z", + "time": 2481, + "timings": { + "blocked": -1, + "connect": -1, + "dns": -1, + "receive": 0, + "send": 0, + "ssl": -1, + "wait": 2481 + } + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/src/test/snapshots/ops/cloud/SecretsOps.test.js.snap b/src/test/snapshots/ops/cloud/SecretsOps.test.js.snap new file mode 100644 index 000000000..f58822fc4 --- /dev/null +++ b/src/test/snapshots/ops/cloud/SecretsOps.test.js.snap @@ -0,0 +1,135 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`SecretsOps exportSecret() 1: Export secret1 1`] = ` +{ + "meta": Any, + "secrets": { + "esv-frodo-test-secret-1": { + "_id": "esv-frodo-test-secret-1", + "activeVersion": "1", + "description": "description1", + "encoding": "generic", + "lastChangeDate": "2023-10-24T15:31:53.340Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": false, + "loadedVersion": "", + "useInPlaceholders": true, + }, + }, +} +`; + +exports[`SecretsOps exportSecret() 2: Export secret2 1`] = ` +{ + "meta": Any, + "secrets": { + "esv-frodo-test-secret-2": { + "_id": "esv-frodo-test-secret-2", + "activeVersion": "1", + "description": "description2", + "encoding": "generic", + "lastChangeDate": "2023-10-24T15:31:54.872Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "loadedVersion": "1", + "useInPlaceholders": false, + }, + }, +} +`; + +exports[`SecretsOps exportSecrets() 1: Export all secrets 1`] = ` +{ + "meta": Any, + "secrets": { + "esv-admin-token": { + "_id": "esv-admin-token", + "activeVersion": "1", + "description": "Long-lived admin token", + "encoding": "generic", + "lastChangeDate": "2022-08-11T22:32:38.056Z", + "lastChangedBy": "8efaa5b6-8c98-4489-9b21-ee41f5589ab7", + "loaded": true, + "loadedVersion": "1", + "useInPlaceholders": true, + }, + "esv-admin-token-1999386457729": { + "_id": "esv-admin-token-1999386457729", + "activeVersion": "1", + "description": "Long-lived admin token", + "encoding": "generic", + "lastChangeDate": "2023-05-14T01:07:41.970Z", + "lastChangedBy": "8d9723a9-a439-4cbf-beb4-30e52811789d", + "loaded": true, + "loadedVersion": "1", + "useInPlaceholders": true, + }, + "esv-frodo-test-secret-1": { + "_id": "esv-frodo-test-secret-1", + "activeVersion": "1", + "description": "description1", + "encoding": "generic", + "lastChangeDate": "2023-10-24T15:31:53.340Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": false, + "loadedVersion": "", + "useInPlaceholders": true, + }, + "esv-frodo-test-secret-2": { + "_id": "esv-frodo-test-secret-2", + "activeVersion": "1", + "description": "description2", + "encoding": "generic", + "lastChangeDate": "2023-10-24T15:31:54.872Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "loadedVersion": "1", + "useInPlaceholders": false, + }, + "esv-test-secret": { + "_id": "esv-test-secret", + "activeVersion": "2", + "description": "Secret Value for testing", + "encoding": "generic", + "lastChangeDate": "2023-08-09T19:00:01.501Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "loadedVersion": "2", + "useInPlaceholders": true, + }, + "esv-test-secret-1": { + "_id": "esv-test-secret-1", + "activeVersion": "1", + "description": "test secret one", + "encoding": "generic", + "lastChangeDate": "2023-08-06T03:53:17.716Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "loadedVersion": "1", + "useInPlaceholders": true, + }, + "esv-test-secret-pi-generic": { + "_id": "esv-test-secret-pi-generic", + "activeVersion": "1", + "description": "This is a test secret containing the value pi.", + "encoding": "generic", + "lastChangeDate": "2023-10-17T22:37:13.115Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "loadedVersion": "1", + "useInPlaceholders": true, + }, + "esv-test-secret-pi-generic2": { + "_id": "esv-test-secret-pi-generic2", + "activeVersion": "1", + "description": "This is a test secret containing the value pi.", + "encoding": "generic", + "lastChangeDate": "2023-10-18T21:45:46.571Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "loadedVersion": "1", + "useInPlaceholders": false, + }, + }, +} +`; diff --git a/src/test/snapshots/ops/cloud/VariablesOps.test.js.snap b/src/test/snapshots/ops/cloud/VariablesOps.test.js.snap new file mode 100644 index 000000000..9e783139f --- /dev/null +++ b/src/test/snapshots/ops/cloud/VariablesOps.test.js.snap @@ -0,0 +1,347 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`VariablesOps exportVariable() 1: Export variable1 1`] = ` +{ + "meta": Any, + "variables": { + "esv-frodo-test-variable-1": { + "_id": "esv-frodo-test-variable-1", + "description": "description1", + "expressionType": "string", + "lastChangeDate": "2023-10-24T17:40:50.223Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": false, + "value": "value1", + "valueBase64": "dmFsdWUx", + }, + }, +} +`; + +exports[`VariablesOps exportVariable() 2: Export variable2 without decoding 1`] = ` +{ + "meta": Any, + "variables": { + "esv-frodo-test-variable-2": { + "_id": "esv-frodo-test-variable-2", + "description": "description2", + "expressionType": "int", + "lastChangeDate": "2023-10-24T17:40:54.286Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": false, + "valueBase64": "NDI=", + }, + }, +} +`; + +exports[`VariablesOps exportVariables() 1: Export all variables 1`] = ` +{ + "meta": Any, + "variables": { + "esv-blue-piller": { + "_id": "esv-blue-piller", + "description": "Zion membership criteria.", + "expressionType": "bool", + "lastChangeDate": "2023-07-18T22:21:38.640Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "value": "false", + "valueBase64": "ZmFsc2U=", + }, + "esv-frodo-test-variable-1": { + "_id": "esv-frodo-test-variable-1", + "description": "description1", + "expressionType": "string", + "lastChangeDate": "2023-10-24T17:40:50.223Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": false, + "value": "value1", + "valueBase64": "dmFsdWUx", + }, + "esv-frodo-test-variable-2": { + "_id": "esv-frodo-test-variable-2", + "description": "description2", + "expressionType": "int", + "lastChangeDate": "2023-10-24T17:40:54.286Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": false, + "value": "42", + "valueBase64": "NDI=", + }, + "esv-ipv4-cidr-access-rules": { + "_id": "esv-ipv4-cidr-access-rules", + "description": "IPv4 CIDR access rules: +{ + "allow": [ + "address/mask" + ] +}", + "expressionType": "", + "lastChangeDate": "2022-08-25T22:54:28.551Z", + "lastChangedBy": "8efaa5b6-8c98-4489-9b21-ee41f5589ab7", + "loaded": true, + "value": "{ "allow": [ "150.128.0.0/16", "139.35.0.0/16", "101.216.0.0/16", "99.72.28.182/32" ]}", + "valueBase64": "eyAgImFsbG93IjogWyAgICAiMTUwLjEyOC4wLjAvMTYiLCAgICAiMTM5LjM1LjAuMC8xNiIsICAgICIxMDEuMjE2LjAuMC8xNiIsICAgICI5OS43Mi4yOC4xODIvMzIiICBdfQ==", + }, + "esv-nebuchadnezzar-crew": { + "_id": "esv-nebuchadnezzar-crew", + "description": "The crew of the Nebuchadnezzar hovercraft.", + "expressionType": "array", + "lastChangeDate": "2023-07-18T21:59:58.974Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "value": "["Morpheus","Trinity","Link","Tank","Dozer","Apoc","Cypher","Mouse","Neo","Switch"]", + "valueBase64": "WyJNb3JwaGV1cyIsIlRyaW5pdHkiLCJMaW5rIiwiVGFuayIsIkRvemVyIiwiQXBvYyIsIkN5cGhlciIsIk1vdXNlIiwiTmVvIiwiU3dpdGNoIl0=", + }, + "esv-nebuchadnezzar-crew-structure": { + "_id": "esv-nebuchadnezzar-crew-structure", + "description": "The structure of the crew of the Nebuchadnezzar hovercraft.", + "expressionType": "object", + "lastChangeDate": "2023-07-18T22:09:54.630Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "value": "{"Captain":"Morpheus","FirstMate":"Trinity","Operator":["Link","Tank"],"Medic":"Dozer","Crewmen":["Apoc","Cypher","Mouse","Neo","Switch"]}", + "valueBase64": "eyJDYXB0YWluIjoiTW9ycGhldXMiLCJGaXJzdE1hdGUiOiJUcmluaXR5IiwiT3BlcmF0b3IiOlsiTGluayIsIlRhbmsiXSwiTWVkaWMiOiJEb3plciIsIkNyZXdtZW4iOlsiQXBvYyIsIkN5cGhlciIsIk1vdXNlIiwiTmVvIiwiU3dpdGNoIl19", + }, + "esv-neo-age": { + "_id": "esv-neo-age", + "description": "Neo's age in the matrix.", + "expressionType": "int", + "lastChangeDate": "2023-07-18T22:21:23.578Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "value": "28", + "valueBase64": "Mjg=", + }, + "esv-test-var": { + "_id": "esv-test-var", + "description": "this is a test description", + "expressionType": "", + "lastChangeDate": "2022-09-02T04:23:56.075Z", + "lastChangedBy": "8efaa5b6-8c98-4489-9b21-ee41f5589ab7", + "loaded": true, + "value": "this is a test variable", + "valueBase64": "dGhpcyBpcyBhIHRlc3QgdmFyaWFibGU=", + }, + "esv-test-var-1": { + "_id": "esv-test-var-1", + "description": "test var one", + "expressionType": "string", + "lastChangeDate": "2023-08-09T17:42:41.684Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "value": "test var 1 value2", + "valueBase64": "dGVzdCB2YXIgMSB2YWx1ZTI=", + }, + "esv-test-var-2": { + "_id": "esv-test-var-2", + "description": "A temporary test variable", + "expressionType": "string", + "lastChangeDate": "2023-08-02T21:09:01.847Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "value": "testval", + "valueBase64": "dGVzdHZhbA==", + }, + "esv-test-var-3": { + "_id": "esv-test-var-3", + "description": "This is a test variable", + "expressionType": "int", + "lastChangeDate": "2023-10-17T22:22:52.023Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "value": "42", + "valueBase64": "NDI=", + }, + "esv-test-var-pi": { + "_id": "esv-test-var-pi", + "description": "This is another test variable.", + "expressionType": "number", + "lastChangeDate": "2023-10-17T22:28:44.529Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "value": "3.1415926", + "valueBase64": "My4xNDE1OTI2", + }, + "esv-test-var-pi-string": { + "_id": "esv-test-var-pi-string", + "description": "This is another test variable.", + "expressionType": "string", + "lastChangeDate": "2023-10-18T22:05:30.300Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "value": "3.1415926", + "valueBase64": "My4xNDE1OTI2", + }, + "esv-trinity-phone": { + "_id": "esv-trinity-phone", + "description": "In the opening of The Matrix (1999), the phone number Trinity is calling from is traced to (312)-555-0690", + "expressionType": "string", + "lastChangeDate": "2023-07-18T20:33:28.922Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "value": "(312)-555-0690", + "valueBase64": "KDMxMiktNTU1LTA2OTA=", + }, + "esv-volkerstestvariable1": { + "_id": "esv-volkerstestvariable1", + "description": "variable created for api testing", + "expressionType": "", + "lastChangeDate": "2022-11-30T00:13:52.478Z", + "lastChangedBy": "10ecab02-f357-4522-bc17-dfcc64744064", + "loaded": true, + "value": "for jest", + "valueBase64": "Zm9yIGplc3Q=", + }, + }, +} +`; + +exports[`VariablesOps exportVariables() 2: Export all variables without decoding 1`] = ` +{ + "meta": Any, + "variables": { + "esv-blue-piller": { + "_id": "esv-blue-piller", + "description": "Zion membership criteria.", + "expressionType": "bool", + "lastChangeDate": "2023-07-18T22:21:38.640Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "valueBase64": "ZmFsc2U=", + }, + "esv-frodo-test-variable-1": { + "_id": "esv-frodo-test-variable-1", + "description": "description1", + "expressionType": "string", + "lastChangeDate": "2023-10-24T17:40:50.223Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": false, + "valueBase64": "dmFsdWUx", + }, + "esv-frodo-test-variable-2": { + "_id": "esv-frodo-test-variable-2", + "description": "description2", + "expressionType": "int", + "lastChangeDate": "2023-10-24T17:40:54.286Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": false, + "valueBase64": "NDI=", + }, + "esv-ipv4-cidr-access-rules": { + "_id": "esv-ipv4-cidr-access-rules", + "description": "IPv4 CIDR access rules: +{ + "allow": [ + "address/mask" + ] +}", + "expressionType": "", + "lastChangeDate": "2022-08-25T22:54:28.551Z", + "lastChangedBy": "8efaa5b6-8c98-4489-9b21-ee41f5589ab7", + "loaded": true, + "valueBase64": "eyAgImFsbG93IjogWyAgICAiMTUwLjEyOC4wLjAvMTYiLCAgICAiMTM5LjM1LjAuMC8xNiIsICAgICIxMDEuMjE2LjAuMC8xNiIsICAgICI5OS43Mi4yOC4xODIvMzIiICBdfQ==", + }, + "esv-nebuchadnezzar-crew": { + "_id": "esv-nebuchadnezzar-crew", + "description": "The crew of the Nebuchadnezzar hovercraft.", + "expressionType": "array", + "lastChangeDate": "2023-07-18T21:59:58.974Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "valueBase64": "WyJNb3JwaGV1cyIsIlRyaW5pdHkiLCJMaW5rIiwiVGFuayIsIkRvemVyIiwiQXBvYyIsIkN5cGhlciIsIk1vdXNlIiwiTmVvIiwiU3dpdGNoIl0=", + }, + "esv-nebuchadnezzar-crew-structure": { + "_id": "esv-nebuchadnezzar-crew-structure", + "description": "The structure of the crew of the Nebuchadnezzar hovercraft.", + "expressionType": "object", + "lastChangeDate": "2023-07-18T22:09:54.630Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "valueBase64": "eyJDYXB0YWluIjoiTW9ycGhldXMiLCJGaXJzdE1hdGUiOiJUcmluaXR5IiwiT3BlcmF0b3IiOlsiTGluayIsIlRhbmsiXSwiTWVkaWMiOiJEb3plciIsIkNyZXdtZW4iOlsiQXBvYyIsIkN5cGhlciIsIk1vdXNlIiwiTmVvIiwiU3dpdGNoIl19", + }, + "esv-neo-age": { + "_id": "esv-neo-age", + "description": "Neo's age in the matrix.", + "expressionType": "int", + "lastChangeDate": "2023-07-18T22:21:23.578Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "valueBase64": "Mjg=", + }, + "esv-test-var": { + "_id": "esv-test-var", + "description": "this is a test description", + "expressionType": "", + "lastChangeDate": "2022-09-02T04:23:56.075Z", + "lastChangedBy": "8efaa5b6-8c98-4489-9b21-ee41f5589ab7", + "loaded": true, + "valueBase64": "dGhpcyBpcyBhIHRlc3QgdmFyaWFibGU=", + }, + "esv-test-var-1": { + "_id": "esv-test-var-1", + "description": "test var one", + "expressionType": "string", + "lastChangeDate": "2023-08-09T17:42:41.684Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "valueBase64": "dGVzdCB2YXIgMSB2YWx1ZTI=", + }, + "esv-test-var-2": { + "_id": "esv-test-var-2", + "description": "A temporary test variable", + "expressionType": "string", + "lastChangeDate": "2023-08-02T21:09:01.847Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "valueBase64": "dGVzdHZhbA==", + }, + "esv-test-var-3": { + "_id": "esv-test-var-3", + "description": "This is a test variable", + "expressionType": "int", + "lastChangeDate": "2023-10-17T22:22:52.023Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "valueBase64": "NDI=", + }, + "esv-test-var-pi": { + "_id": "esv-test-var-pi", + "description": "This is another test variable.", + "expressionType": "number", + "lastChangeDate": "2023-10-17T22:28:44.529Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "valueBase64": "My4xNDE1OTI2", + }, + "esv-test-var-pi-string": { + "_id": "esv-test-var-pi-string", + "description": "This is another test variable.", + "expressionType": "string", + "lastChangeDate": "2023-10-18T22:05:30.300Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "valueBase64": "My4xNDE1OTI2", + }, + "esv-trinity-phone": { + "_id": "esv-trinity-phone", + "description": "In the opening of The Matrix (1999), the phone number Trinity is calling from is traced to (312)-555-0690", + "expressionType": "string", + "lastChangeDate": "2023-07-18T20:33:28.922Z", + "lastChangedBy": "b672336b-41ef-428d-ae4a-e0c082875377", + "loaded": true, + "valueBase64": "KDMxMiktNTU1LTA2OTA=", + }, + "esv-volkerstestvariable1": { + "_id": "esv-volkerstestvariable1", + "description": "variable created for api testing", + "expressionType": "", + "lastChangeDate": "2022-11-30T00:13:52.478Z", + "lastChangedBy": "10ecab02-f357-4522-bc17-dfcc64744064", + "loaded": true, + "valueBase64": "Zm9yIGplc3Q=", + }, + }, +} +`;