| 27 | using org::apache::nifi::minifi::encrypt_config::CommandException; |
| 28 | |
| 29 | int main(int argc, char* argv[]) try { |
| 30 | Arguments args = Arguments::parse(argc, argv); |
| 31 | EncryptConfig encrypt_config{args.get("-m").value()}; |
| 32 | EncryptConfig::EncryptionType type = encrypt_config.encryptSensitiveProperties(); |
| 33 | if (args.isSet("--encrypt-flow-config")) { |
| 34 | encrypt_config.encryptFlowConfig(); |
| 35 | } else if (type == EncryptConfig::EncryptionType::RE_ENCRYPT) { |
| 36 | std::cout << "WARNING: you did not request the flow config to be updated, " |
| 37 | << "if it is currently encrypted and the old key is removed, " |
| 38 | << "you won't be able to recover the flow config.\n"; |
| 39 | } |
| 40 | return 0; |
| 41 | } catch (const CommandException& c_ex) { |
| 42 | std::cerr << c_ex.what() << "\n"; |
| 43 | std::cerr << Arguments::getHelp() << "\n"; |
| 44 | return 1; |
| 45 | } catch (const std::exception& ex) { |
| 46 | std::cerr << ex.what() << "\n(" << typeid(ex).name() << ")\n"; |
| 47 | return 2; |
| 48 | } catch (...) { |
| 49 | std::cerr << "Unknown error\n"; |
| 50 | return 3; |
| 51 | } |
nothing calls this directly
no test coverage detected