Skip to content

Commit 69e3c31

Browse files
committed
Do not use single char attributes
Space is not a problem, these passwords are in Maven settings only, so "space saver short attributes" are meaningless.
1 parent 5c1e252 commit 69e3c31

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

src/main/java/org/codehaus/plexus/components/secdispatcher/SecDispatcher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ public interface SecDispatcher {
3131
*
3232
* @see #availableDispatchers()
3333
*/
34-
String DISPATCHER_NAME_ATTR = "n";
34+
String DISPATCHER_NAME_ATTR = "name";
3535

3636
/**
3737
* Attribute for version that dispatcher should use.
3838
*/
39-
String DISPATCHER_VERSION_ATTR = "v";
39+
String DISPATCHER_VERSION_ATTR = "version";
4040

4141
/**
4242
* Returns the set of available dispatcher metadata, never {@code null}.

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
public class MasterDispatcher implements Dispatcher, DispatcherMeta {
4141
public static final String NAME = "master";
4242

43-
private static final String MASTER_CIPHER_ATTR = "c";
4443
private static final String CONF_MASTER_CIPHER = "cipher";
4544
private static final String CONF_MASTER_SOURCE = "source";
45+
private static final String MASTER_CIPHER_ATTR = CONF_MASTER_CIPHER;
4646

4747
private final PlexusCipher cipher;
4848
protected final Map<String, MasterSource> masterSources;
@@ -76,8 +76,7 @@ public Collection<Field> fields() {
7676
Field.Builder b =
7777
Field.builder(e.getKey()).description(m.description());
7878
if (m.configTemplate().isPresent()) {
79-
b = b.defaultValue(
80-
m.configTemplate().get());
79+
b.defaultValue(m.configTemplate().get());
8180
}
8281
return b.build();
8382
} else {

src/test/java/org/codehaus/plexus/components/secdispatcher/internal/DefaultSecDispatcherTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ protected void roundtrip() throws Exception {
117117
// example:
118118
// {[name=master,cipher=AES/GCM/NoPadding,a=b]vvq66pZ7rkvzSPStGTI9q4QDnsmuDwo+LtjraRel2b0XpcGJFdXcYAHAS75HUA6GLpcVtEkmyQ==}
119119
assertTrue(encrypted.startsWith("{") && encrypted.endsWith("}"));
120-
assertTrue(encrypted.contains("n=master"));
121-
assertTrue(encrypted.contains("c=" + AESGCMNoPadding.CIPHER_ALG));
122-
assertTrue(encrypted.contains("v=test"));
120+
assertTrue(encrypted.contains("name=master"));
121+
assertTrue(encrypted.contains("cipher=" + AESGCMNoPadding.CIPHER_ALG));
122+
assertTrue(encrypted.contains("version=test"));
123123
assertTrue(encrypted.contains("a=b"));
124124
String pass = sd.decrypt(encrypted);
125125
assertEquals("supersecret", pass);

0 commit comments

Comments
 (0)