Skip to content

Commit

Permalink
Expose ciphers
Browse files Browse the repository at this point in the history
  • Loading branch information
cstamas committed Sep 28, 2024
1 parent e2c3d06 commit b080ef6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ public interface SecDispatcher {
*/
Set<String> availableDispatchers();

/**
* Returns the set of available ciphers, never {@code null}.
*/
Set<String> availableCiphers();

/**
* encrypt given plaintext string
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ public Set<String> availableDispatchers() {
return Set.copyOf(dispatchers.keySet());
}

@Override
public Set<String> availableCiphers() {
return cipher.availableCiphers();
}

@Override
public String encrypt(String str, Map<String, String> attr) throws SecDispatcherException {
if (isEncryptedString(str)) return str;
Expand Down
12 changes: 10 additions & 2 deletions src/main/mdo/settings-security.mdo
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright (c) 2008 Sonatype, Inc. All rights reserved.
Expand All @@ -12,9 +13,11 @@
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
*/
-->
<model xmlns="http://codehaus-plexus.github.io/MODELLO/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://codehaus-plexus.github.io/MODELLO/2.0.0 https://codehaus-plexus.github.io/modello/xsd/modello-2.0.0.xsd"
xml.namespace="http://codehaus-plexus.github.io/plexus-sec-dispatcher/${version}"
xml.schemaLocation="https://codehaus-plexus.github.io/xsd/plexus-sec-dispatcher-${version}.xsd">

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

<name>SecurityConfiguration</name>
Expand Down Expand Up @@ -45,34 +48,39 @@
<name>modelVersion</name>
<version>3.0.0+</version>
<type>String</type>
<required>true</required>
<description>The version of the model</description>
</field>

<field>
<name>masterSource</name>
<version>3.0.0+</version>
<type>String</type>
<required>true</required>
<description>The URI describing the source of the master password</description>
</field>

<field>
<name>masterCipher</name>
<version>3.0.0+</version>
<type>String</type>
<required>true</required>
<description>The Cipher to be used</description>
</field>

<field>
<name>relocation</name>
<version>1.0.0+</version>
<type>String</type>
<required>false</required>
<description>reference to the location of the security file</description>
</field>

<field>
<name>configurations</name>
<version>1.0.0+</version>
<description>named configurations</description>
<required>false</required>
<association>
<type>Config</type>
<multiplicity>*</multiplicity>
Expand Down

0 comments on commit b080ef6

Please # to comment.