Skip to content

Commit 67f78ab

Browse files
committed
Tidy up messages
1 parent ac0d93c commit 67f78ab

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

src/main/java/org/codehaus/plexus/components/secdispatcher/internal/DefaultSecDispatcher.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,22 +196,22 @@ public ValidationResponse validateConfiguration() {
196196
.add("No default dispatcher set in configuration");
197197
} else {
198198
report.computeIfAbsent(ValidationResponse.Level.INFO, k -> new ArrayList<>())
199-
.add("Default dispatcher set to " + defaultDispatcher);
199+
.add("Default dispatcher configured");
200200
Dispatcher dispatcher = dispatchers.get(defaultDispatcher);
201201
if (dispatcher == null) {
202202
report.computeIfAbsent(ValidationResponse.Level.ERROR, k -> new ArrayList<>())
203-
.add("Default dispatcher " + defaultDispatcher + " not present in system");
203+
.add("Configured default dispatcher not present in system");
204204
} else {
205205
ValidationResponse dispatcherResponse =
206206
dispatcher.validateConfiguration(prepareDispatcherConfig(defaultDispatcher));
207207
subsystems.add(dispatcherResponse);
208208
if (!dispatcherResponse.isValid()) {
209209
report.computeIfAbsent(ValidationResponse.Level.ERROR, k -> new ArrayList<>())
210-
.add("Default dispatcher " + defaultDispatcher + " configuration is invalid");
210+
.add("Configured default dispatcher configuration is invalid");
211211
} else {
212212
valid = true;
213213
report.computeIfAbsent(ValidationResponse.Level.INFO, k -> new ArrayList<>())
214-
.add("Default dispatcher " + defaultDispatcher + " configuration is valid");
214+
.add("Configured default dispatcher configuration is valid");
215215

216216
// below is legacy check, that does not affect validity of config, is merely informational
217217
Dispatcher legacy = dispatchers.get(LegacyDispatcher.NAME);

src/main/java/org/codehaus/plexus/components/secdispatcher/internal/dispatchers/LegacyDispatcher.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,24 +114,24 @@ public SecDispatcher.ValidationResponse validateConfiguration(Map<String, String
114114
String mpe = getMasterMasterPasswordFromSettingsSecurityXml();
115115
if (mpe == null) {
116116
report.computeIfAbsent(SecDispatcher.ValidationResponse.Level.ERROR, k -> new ArrayList<>())
117-
.add("Legacy configuration not found or does not contain encrypted master password");
117+
.add("Legacy configuration not found or does not contains encrypted master password");
118118
} else {
119119
report.computeIfAbsent(SecDispatcher.ValidationResponse.Level.INFO, k -> new ArrayList<>())
120-
.add("Legacy configuration found and contain encrypted master password");
120+
.add("Legacy configuration found with encrypted master password");
121121

122122
String mp = getMasterPassword();
123123
if (mp == null) {
124124
report.computeIfAbsent(SecDispatcher.ValidationResponse.Level.ERROR, k -> new ArrayList<>())
125-
.add("Master Password not found");
125+
.add("Legacy master password not found");
126126
} else {
127127
report.computeIfAbsent(SecDispatcher.ValidationResponse.Level.INFO, k -> new ArrayList<>())
128-
.add("Master Password successfully decrypted");
128+
.add("Legacy master password successfully decrypted");
129129
valid = true;
130130
}
131131
}
132132
} catch (PlexusCipherException e) {
133133
report.computeIfAbsent(SecDispatcher.ValidationResponse.Level.ERROR, k -> new ArrayList<>())
134-
.add("Master Password decryption failed");
134+
.add("Legacy master password decryption failed");
135135
}
136136
return new SecDispatcher.ValidationResponse(getClass().getSimpleName(), valid, report, List.of());
137137
}

src/main/java/org/codehaus/plexus/components/secdispatcher/internal/dispatchers/MasterDispatcher.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,20 +131,20 @@ public SecDispatcher.ValidationResponse validateConfiguration(Map<String, String
131131
String masterCipher = config.get(CONF_MASTER_CIPHER);
132132
if (masterCipher == null) {
133133
report.computeIfAbsent(SecDispatcher.ValidationResponse.Level.ERROR, k -> new ArrayList<>())
134-
.add("Master Cipher configuration missing");
134+
.add("Cipher configuration missing");
135135
} else {
136136
if (!cipher.availableCiphers().contains(masterCipher)) {
137137
report.computeIfAbsent(SecDispatcher.ValidationResponse.Level.ERROR, k -> new ArrayList<>())
138-
.add("Master Cipher " + masterCipher + " not supported");
138+
.add("Configured Cipher not supported");
139139
} else {
140140
report.computeIfAbsent(SecDispatcher.ValidationResponse.Level.INFO, k -> new ArrayList<>())
141-
.add("Master Cipher " + masterCipher + " supported");
141+
.add("Configured Cipher supported");
142142
}
143143
}
144144
String masterSource = config.get(CONF_MASTER_SOURCE);
145145
if (masterSource == null) {
146146
report.computeIfAbsent(SecDispatcher.ValidationResponse.Level.ERROR, k -> new ArrayList<>())
147-
.add("Master Source configuration missing");
147+
.add("Source configuration missing");
148148
} else {
149149
SecDispatcher.ValidationResponse masterSourceResponse = null;
150150
for (MasterSource masterPasswordSource : masterSources.values()) {
@@ -155,15 +155,15 @@ public SecDispatcher.ValidationResponse validateConfiguration(Map<String, String
155155
}
156156
if (masterSourceResponse == null) {
157157
report.computeIfAbsent(SecDispatcher.ValidationResponse.Level.ERROR, k -> new ArrayList<>())
158-
.add("Master Source configuration `" + masterSource + "` not handled");
158+
.add("Configured Source configuration not handled");
159159
} else {
160160
subsystems.add(masterSourceResponse);
161161
if (!masterSourceResponse.isValid()) {
162162
report.computeIfAbsent(SecDispatcher.ValidationResponse.Level.ERROR, k -> new ArrayList<>())
163-
.add("Master Source configuration `" + masterSource + "` invalid");
163+
.add("Configured Source configuration invalid");
164164
} else {
165165
report.computeIfAbsent(SecDispatcher.ValidationResponse.Level.INFO, k -> new ArrayList<>())
166-
.add("Master Source configuration `" + masterSource + "` valid");
166+
.add("Configured Source configuration valid");
167167
valid = true;
168168
}
169169
}

0 commit comments

Comments
 (0)