Skip to content

Commit

Permalink
Merge pull request #191 from vscheuber/main
Browse files Browse the repository at this point in the history
MINOR RELEASE
  • Loading branch information
vscheuber authored Jan 25, 2023
2 parents f89e193 + 6c14da1 commit 6a2b1a9
Show file tree
Hide file tree
Showing 39 changed files with 45 additions and 7,567 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- \#52: Added new developer options for `script export` and `script import` commands:
- `frodo script export`:
- `-x`, `--extract`: Extract the script from the exported file, and save it to a separate file. Ignored with `-n` or `-a`.
- `frodo script import`:
- `-w`, `--watch`: Watch for changes to the script files and import the scripts automatically when the file changes. Can only be used with `-A`. (default: false)

***Note:*** This new option only applies if the export was generated with the new `--extract` option!

### Changed

- Updated to frodo-lib 0.18.2

### Fixed

- \#190: Frodo now properly imports previously exported saml providers.

## [0.20.2-0] - 2023-01-24

## [0.20.1] - 2023-01-20
Expand Down
14 changes: 7 additions & 7 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 @@ -104,7 +104,7 @@
]
},
"dependencies": {
"@rockcarver/frodo-lib": "0.18.2-0",
"@rockcarver/frodo-lib": "0.18.2",
"chokidar": "^3.5.3",
"cli-progress": "^3.11.2",
"cli-table3": "^0.6.3",
Expand Down
3 changes: 2 additions & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import realm from './cli/realm/realm';
import saml from './cli/saml/saml';
import script from './cli/script/script';
import service from './cli/service/service';
import something from './cli/_template/something';
// enable sample command template.
// import something from './cli/_template/something';
import theme from './cli/theme/theme';
import { printMessage } from './utils/Console';
import { getVersions } from './utils/Version';
Expand Down
40 changes: 17 additions & 23 deletions src/ops/Saml2Ops.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from 'fs';
import path from 'path';
import { Saml2ProviderSkeleton } from '@rockcarver/frodo-lib/types/api/ApiTypes';
import { Saml2, ExportImportUtils } from '@rockcarver/frodo-lib';
import { Saml2, ExportImportUtils, Base64 } from '@rockcarver/frodo-lib';
import {
MultiOpStatusInterface,
Saml2ExportInterface,
Expand All @@ -11,10 +11,11 @@ import {
createProgressBar,
createTable,
debugMessage,
failSpinner,
printMessage,
showSpinner,
stopProgressBar,
stopSpinner,
succeedSpinner,
updateProgressBar,
} from '../utils/Console';
import { saveTextToFile } from '../utils/ExportImportUtils';
Expand Down Expand Up @@ -250,16 +251,12 @@ export async function importSaml2ProviderFromFile(
fs.readFile(file, 'utf8', async (err, data) => {
if (err) throw err;
const fileData = JSON.parse(data);
if (validateImport(fileData.meta)) {
showSpinner(`Importing ${entityId}...`);
try {
await importSaml2Provider(entityId, fileData);
stopSpinner(`Imported ${entityId}.`);
} catch (error) {
stopSpinner(`Error importing ${entityId}: ${error.message}`);
}
} else {
printMessage('Import validation failed...', 'error');
showSpinner(`Importing ${entityId}...`);
try {
await importSaml2Provider(entityId, fileData);
succeedSpinner(`Imported ${entityId}.`);
} catch (error) {
failSpinner(`Error importing ${entityId}: ${error.message}`);
}
});
}
Expand All @@ -273,19 +270,16 @@ export async function importFirstSaml2ProviderFromFile(file: string) {
if (err) throw err;
const fileData = JSON.parse(data) as Saml2ExportInterface;
// pick the first provider and run with it
const entityId =
const entityId64 =
Object.keys(fileData.saml.remote)[0] ||
Object.keys(fileData.saml.hosted)[0];
if (validateImport(fileData.meta)) {
showSpinner(`Importing ${entityId}...`);
try {
await importSaml2Provider(entityId, fileData);
stopSpinner(`Imported ${entityId}.`);
} catch (error) {
stopSpinner(`Error importing ${entityId}: ${error.message}`);
}
} else {
printMessage('Import validation failed...', 'error');
const entityId = Base64.decode(entityId64);
showSpinner(`Importing ${entityId}...`);
try {
await importSaml2Provider(entityId, fileData);
succeedSpinner(`Imported ${entityId}.`);
} catch (error) {
failSpinner(`Error importing ${entityId}: ${error.message}`);
}
});
}
Expand Down
216 changes: 0 additions & 216 deletions test/e2e/journey/baseline/ForgottenUsername.journey.json

This file was deleted.

Loading

0 comments on commit 6a2b1a9

Please sign in to comment.