From 0bd8c07fb73dd764103273e1f5cdffcedcb2e6fb Mon Sep 17 00:00:00 2001 From: Cameron Rodriguez Date: Wed, 5 Apr 2023 18:50:01 -0400 Subject: [PATCH] [ELY-2496] Add missing hash-charset option to FileSystemEncryptRealmCommand --- .../org/wildfly/security/tool/Command.java | 1 + .../security/tool/ElytronToolMessages.java | 7 ++- .../tool/FileSystemEncryptRealmCommand.java | 53 +++++++++++++++++-- .../FileSystemEncryptRealmCommandTest.java | 8 ++- .../resources/bulk-encryption-conversion-desc | 3 +- .../fsRealmCharset/a/l/alice-MFWGSY3F.xml | 8 +++ .../fsRealmCharset/b/o/bob-MJXWE.xml | 6 +++ .../c/a/cameron-MNQW2ZLSN5XA.xml | 11 ++++ .../hashcharset/b/o/boy4-MJXXSNA.xml | 10 ---- .../hashcharset/e/a/eap8-MVQXAOA.xml | 10 ---- .../hashcharset/g/i/girl5-M5UXE3BV.xml | 11 ---- .../i/d/identity3-NFSGK3TUNF2HSMY.xml | 9 ---- .../hashcharset/j/b/jboss6-NJRG643TGY.xml | 9 ---- .../hashcharset/p/e/person2-OBSXE43PNYZA.xml | 9 ---- .../hashcharset/u/s/user1-OVZWK4RR.xml | 9 ---- .../w/i/wildfly7-O5UWYZDGNR4TO.xml | 9 ---- 16 files changed, 87 insertions(+), 86 deletions(-) create mode 100644 tool/src/test/resources/filesystem-encrypt/fs-unencrypted-realms/fsRealmCharset/a/l/alice-MFWGSY3F.xml create mode 100644 tool/src/test/resources/filesystem-encrypt/fs-unencrypted-realms/fsRealmCharset/b/o/bob-MJXWE.xml create mode 100644 tool/src/test/resources/filesystem-encrypt/fs-unencrypted-realms/fsRealmCharset/c/a/cameron-MNQW2ZLSN5XA.xml delete mode 100644 tool/src/test/resources/filesystem-encrypt/fs-unencrypted-realms/hashcharset/b/o/boy4-MJXXSNA.xml delete mode 100644 tool/src/test/resources/filesystem-encrypt/fs-unencrypted-realms/hashcharset/e/a/eap8-MVQXAOA.xml delete mode 100644 tool/src/test/resources/filesystem-encrypt/fs-unencrypted-realms/hashcharset/g/i/girl5-M5UXE3BV.xml delete mode 100644 tool/src/test/resources/filesystem-encrypt/fs-unencrypted-realms/hashcharset/i/d/identity3-NFSGK3TUNF2HSMY.xml delete mode 100644 tool/src/test/resources/filesystem-encrypt/fs-unencrypted-realms/hashcharset/j/b/jboss6-NJRG643TGY.xml delete mode 100644 tool/src/test/resources/filesystem-encrypt/fs-unencrypted-realms/hashcharset/p/e/person2-OBSXE43PNYZA.xml delete mode 100644 tool/src/test/resources/filesystem-encrypt/fs-unencrypted-realms/hashcharset/u/s/user1-OVZWK4RR.xml delete mode 100644 tool/src/test/resources/filesystem-encrypt/fs-unencrypted-realms/hashcharset/w/i/wildfly7-O5UWYZDGNR4TO.xml diff --git a/tool/src/main/java/org/wildfly/security/tool/Command.java b/tool/src/main/java/org/wildfly/security/tool/Command.java index 81720e1b07b..0659183dcd6 100644 --- a/tool/src/main/java/org/wildfly/security/tool/Command.java +++ b/tool/src/main/java/org/wildfly/security/tool/Command.java @@ -378,6 +378,7 @@ class Params { static final String FILE_PARAM = "file"; static final String DEBUG_PARAM = "debug"; static final String DIRECTORY_PARAM = "directory"; + static final String HASH_CHARSET_PARAM = "hash-charset"; static final String HASH_ENCODING_PARAM = "hash-encoding"; static final String HELP_PARAM = "help"; static final String IMPLEMENTATION_PROPERTIES_PARAM = "properties"; diff --git a/tool/src/main/java/org/wildfly/security/tool/ElytronToolMessages.java b/tool/src/main/java/org/wildfly/security/tool/ElytronToolMessages.java index 572b96901ff..cc3d1531150 100644 --- a/tool/src/main/java/org/wildfly/security/tool/ElytronToolMessages.java +++ b/tool/src/main/java/org/wildfly/security/tool/ElytronToolMessages.java @@ -473,9 +473,9 @@ public interface ElytronToolMessages extends BasicLogger { String cmdFileSystemRealmBulkConvertDesc(); @Message(id = NONE, value = "Bulk conversion with options listed in description file. Optional options have default values, required options do not. (Action) %n" + - "The options realm-name, hash-encoding, levels, secret-key, create, and populate are optional. %n" + + "The options realm-name, hash-encoding, hash-charset, levels, secret-key, create, populate, keystore, type, password, password-env, and key-pair are optional. %n" + "Values are required for the following options: input-location, output-location, and credential-store. %n" + - "The default values of realm-name, hash-encoding, levels, secret-key, create, and populate are encrypted-filesystem-realm, BASE64, 2, key, true, and true respectively. %n" + + "The default values of realm-name, hash-encoding, hash-charset, levels, secret-key, create, and populate are encrypted-filesystem-realm, BASE64, UTF-8, 2, key, true, and true respectively. %n" + "If one or more these required values are not set, the corresponding block is skipped. %n" + "Each option must be specified in the following format: