Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
]
},
"devDependencies": {
"@rockcarver/frodo-lib": "4.0.0-3",
"@rockcarver/frodo-lib": "4.0.0-4",
"@types/colors": "^1.2.1",
"@types/fs-extra": "^11.0.1",
"@types/jest": "^29.2.3",
Expand Down
3 changes: 2 additions & 1 deletion src/cli/conn/conn-describe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Option } from 'commander';

import { describeConnectionProfile } from '../../ops/ConnectionProfileOps';
import { FrodoCommand } from '../FrodoCommand';
import { printMessage } from '../../utils/Console';

export default function setup() {
const program = new FrodoCommand('frodo conn describe', [
Expand All @@ -20,7 +21,7 @@ export default function setup() {
// implement command logic inside action handler
async (host, options, command) => {
command.handleDefaultArgsAndOpts(host, options, command);
describeConnectionProfile(host, options.showSecrets);
await describeConnectionProfile(host, options.showSecrets);
}
// end command logic inside action handler
);
Expand Down
26 changes: 17 additions & 9 deletions test/e2e/__snapshots__/conn-describe.e2e.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,22 @@ Amster Private Key │[present]
`;

exports[`frodo conn describe "frodo conn describe https://openam-frodo-dev.forgeblocks.com/am": should describe the connection 1`] = `
"Host │https://openam-frodo-dev.forgeblocks.com/am
Deployment Type │cloud
Username │volker.scheuber@forgerock.com
Password │[present]
Log API Key │2e3e7162c6861fdc50a10b6353ada65a
Log API Secret │[present]
Service Account Name│Frodo-SA-1687293271764
Service Account Id │b672336b-41ef-428d-ae4a-e0c082875377
Service Account JWK │[present]
"Host │https://openam-frodo-dev.forgeblocks.com/am
Deployment Type │cloud
Service Account Name │Frodo-SA-1758728043147
Service Account Id │912dcd07-421b-4ba9-b019-edbfe66a89be
Service Account JWK │[present]
Service Account Scope│fr:am:*
│fr:autoaccess:*
│fr:idc:analytics:*
│fr:idc:certificate:*
│fr:idc:content-security-policy:*
│fr:idc:cookie-domain:*
│fr:idc:custom-domain:*
│fr:idc:esv:*
│fr:idc:promotion:*
│fr:idc:release:*
│fr:idc:sso-cookie:*
│fr:idm:*
"
`;
18 changes: 9 additions & 9 deletions test/e2e/conn-describe.e2e.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* In mock mode, run the command you want to test with the same arguments
* and parameters exactly as you want to test it, for example:
*
* $ FRODO_MOCK=1 FRODO_CONNECTION_PROFILES_PATH=./test/e2e/env/Connections.json FRODO_MASTER_KEY='<master key>' frodo conn describe https://openam-frodo-dev.forgeblocks.com/am
* $ FRODO_MOCK=1 FRODO_CONNECTION_PROFILES_PATH=./test/e2e/env/Connections.json FRODO_MASTER_KEY_PATH=./test/e2e/env/masterkey.key frodo conn describe https://openam-frodo-dev.forgeblocks.com/am
*
* If your command completes without errors and with the expected results,
* all the required mocks already exist and you are good to write your
Expand All @@ -20,7 +20,7 @@
* In mock record mode, run the command you want to test with the same arguments
* and parameters exactly as you want to test it, for example:
*
* $ FRODO_MOCK=record FRODO_CONNECTION_PROFILES_PATH=./test/e2e/env/Connections.json FRODO_MASTER_KEY='<master key>' frodo conn describe https://openam-frodo-dev.forgeblocks.com/am
* $ FRODO_MOCK=record FRODO_CONNECTION_PROFILES_PATH=./test/e2e/env/Connections.json FRODO_MASTER_KEY_PATH=./test/e2e/env/masterkey.key frodo conn describe https://openam-frodo-dev.forgeblocks.com/am
*
* Wait until you see all the Polly instances (mock recording adapters) have
* shutdown before you try to run step #1 again.
Expand All @@ -38,20 +38,20 @@
* 3. Validate your freshly recorded mock responses are complete and working.
* Re-run the exact command you want to test in mock mode (see step #1).
*
* $ FRODO_MOCK=1 FRODO_CONNECTION_PROFILES_PATH=./test/e2e/env/Connections.json FRODO_MASTER_KEY='<master key>' frodo conn describe https://openam-frodo-dev.forgeblocks.com/am
* $ FRODO_MOCK=1 FRODO_CONNECTION_PROFILES_PATH=./test/e2e/env/Connections.json FRODO_MASTER_KEY_PATH=./test/e2e/env/masterkey.key frodo conn describe https://openam-frodo-dev.forgeblocks.com/am
*
* 4. Write your test.
* Make sure to use the exact command including number of arguments and params.
*
* 5. Create snapshots.
* To create snapshots for your tests, run the tests in update snapshot mode:
*
* $ FRODO_CONNECTION_PROFILES_PATH=./test/e2e/env/Connections.json FRODO_MASTER_KEY='<master key>' npm run test:update conn-describe
* $ FRODO_CONNECTION_PROFILES_PATH=./test/e2e/env/Connections.json FRODO_MASTER_KEY_PATH=./test/e2e/env/masterkey.key npm run test:update conn-describe
*
* 6. Test you tests and recordings and snapshots.
* To test the whole package of tests, recordings, and snapshots, run the tests:
*
* $ FRODO_CONNECTION_PROFILES_PATH=./test/e2e/env/Connections.json FRODO_MASTER_KEY='<master key>' npm run test conn-describe
* $ FRODO_CONNECTION_PROFILES_PATH=./test/e2e/env/Connections.json FRODO_MASTER_KEY_PATH=./test/e2e/env/masterkey.key npm run test conn-describe
*
* 7. Commit your test, your recordings, and snapshots to the repository.
*/
Expand All @@ -68,7 +68,7 @@ process.env['FRODO_CONNECTION_PROFILES_PATH'] =
const env = getEnv();

describe('frodo conn describe', () => {
testif(process.env['FRODO_MASTER_KEY'])(
testif(process.env['FRODO_MASTER_KEY'] || process.env['FRODO_MASTER_KEY_PATH'])(
`"frodo conn describe ${c.host}": should describe the connection`,
async () => {
const CMD = `frodo conn describe ${c.host}`;
Expand All @@ -77,7 +77,7 @@ describe('frodo conn describe', () => {
}
);

testif(process.env['FRODO_MASTER_KEY'])(
testif(process.env['FRODO_MASTER_KEY'] || process.env['FRODO_MASTER_KEY_PATH'])(
`"frodo conn describe ${cc.host}": should describe the classic connection`,
async () => {
const CMD = `frodo conn describe ${cc.host}`;
Expand All @@ -86,7 +86,7 @@ describe('frodo conn describe', () => {
}
);

testif(process.env['FRODO_MASTER_KEY'])(
testif(process.env['FRODO_MASTER_KEY'] || process.env['FRODO_MASTER_KEY_PATH'])(
`"frodo conn describe --show-secrets ${c.host}": should describe the connection and show the associated secrets`,
async () => {
const CMD = `frodo conn describe --show-secrets ${c.host}`;
Expand All @@ -96,7 +96,7 @@ describe('frodo conn describe', () => {
}
);

testif(process.env['FRODO_MASTER_KEY'])(
testif(process.env['FRODO_MASTER_KEY'] || process.env['FRODO_MASTER_KEY_PATH'])(
`"frodo conn describe --show-secrets ${cc.host}": should describe the classic connection and show the associated secrets`,
async () => {
const CMD = `frodo conn describe --show-secrets ${cc.host}`;
Expand Down
Loading
Loading