Skip to content

Commit b080ef6

Browse files
committed
Expose ciphers
1 parent e2c3d06 commit b080ef6

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

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

+5
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ public interface SecDispatcher {
4747
*/
4848
Set<String> availableDispatchers();
4949

50+
/**
51+
* Returns the set of available ciphers, never {@code null}.
52+
*/
53+
Set<String> availableCiphers();
54+
5055
/**
5156
* encrypt given plaintext string
5257
*

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

+5
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ public Set<String> availableDispatchers() {
6262
return Set.copyOf(dispatchers.keySet());
6363
}
6464

65+
@Override
66+
public Set<String> availableCiphers() {
67+
return cipher.availableCiphers();
68+
}
69+
6570
@Override
6671
public String encrypt(String str, Map<String, String> attr) throws SecDispatcherException {
6772
if (isEncryptedString(str)) return str;

src/main/mdo/settings-security.mdo

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
12
<!--
23
/**
34
* Copyright (c) 2008 Sonatype, Inc. All rights reserved.
@@ -12,9 +13,11 @@
1213
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
1314
*/
1415
-->
16+
<model xmlns="http://codehaus-plexus.github.io/MODELLO/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
17+
xsi:schemaLocation="http://codehaus-plexus.github.io/MODELLO/2.0.0 https://codehaus-plexus.github.io/modello/xsd/modello-2.0.0.xsd"
18+
xml.namespace="http://codehaus-plexus.github.io/plexus-sec-dispatcher/${version}"
19+
xml.schemaLocation="https://codehaus-plexus.github.io/xsd/plexus-sec-dispatcher-${version}.xsd">
1520

16-
<model xml.namespace="http://codehaus-plexus.github.io/plexus-sec-dispatcher/${version}"
17-
xml.schemaLocation="https://codehaus-plexus.github.io/xsd/plexus-sec-dispatcher-${version}.xsd">
1821
<id>settings-security</id>
1922

2023
<name>SecurityConfiguration</name>
@@ -45,34 +48,39 @@
4548
<name>modelVersion</name>
4649
<version>3.0.0+</version>
4750
<type>String</type>
51+
<required>true</required>
4852
<description>The version of the model</description>
4953
</field>
5054

5155
<field>
5256
<name>masterSource</name>
5357
<version>3.0.0+</version>
5458
<type>String</type>
59+
<required>true</required>
5560
<description>The URI describing the source of the master password</description>
5661
</field>
5762

5863
<field>
5964
<name>masterCipher</name>
6065
<version>3.0.0+</version>
6166
<type>String</type>
67+
<required>true</required>
6268
<description>The Cipher to be used</description>
6369
</field>
6470

6571
<field>
6672
<name>relocation</name>
6773
<version>1.0.0+</version>
6874
<type>String</type>
75+
<required>false</required>
6976
<description>reference to the location of the security file</description>
7077
</field>
7178

7279
<field>
7380
<name>configurations</name>
7481
<version>1.0.0+</version>
7582
<description>named configurations</description>
83+
<required>false</required>
7684
<association>
7785
<type>Config</type>
7886
<multiplicity>*</multiplicity>

0 commit comments

Comments
 (0)