Skip to content
This repository was archived by the owner on Nov 24, 2024. It is now read-only.

Commit 60529c1

Browse files
committed
Internal
1 parent 9d75fb6 commit 60529c1

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

src/main/java/org/codehaus/plexus/components/cipher/PlexusCipher.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
* @author Oleg Gusakov
1717
*/
1818
public interface PlexusCipher {
19-
String ENCRYPTED_STRING_DECORATION_START = "{";
20-
21-
String ENCRYPTED_STRING_DECORATION_STOP = "}";
22-
2319
/**
2420
* encrypt given string with the given passPhrase and encode it into base64
2521
*

src/main/java/org/codehaus/plexus/components/cipher/DefaultPlexusCipher.java renamed to src/main/java/org/codehaus/plexus/components/cipher/internal/DefaultPlexusCipher.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1111
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
1212
*/
13-
package org.codehaus.plexus.components.cipher;
13+
package org.codehaus.plexus.components.cipher.internal;
1414

1515
import javax.inject.Named;
1616
import javax.inject.Singleton;
@@ -22,6 +22,9 @@
2222
import java.util.regex.Matcher;
2323
import java.util.regex.Pattern;
2424

25+
import org.codehaus.plexus.components.cipher.PlexusCipher;
26+
import org.codehaus.plexus.components.cipher.PlexusCipherException;
27+
2528
/**
2629
* Default implementation of {@link PlexusCipher}. This class is thread safe.
2730
*
@@ -31,6 +34,8 @@
3134
@Named
3235
public class DefaultPlexusCipher implements PlexusCipher {
3336
private static final Pattern ENCRYPTED_STRING_PATTERN = Pattern.compile(".*?[^\\\\]?\\{(.*?[^\\\\])\\}.*");
37+
private static final String ENCRYPTED_STRING_DECORATION_START = "{";
38+
private static final String ENCRYPTED_STRING_DECORATION_STOP = "}";
3439

3540
private final PBECipher _cipher;
3641

src/main/java/org/codehaus/plexus/components/cipher/PBECipher.java renamed to src/main/java/org/codehaus/plexus/components/cipher/internal/PBECipher.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Licensed to the Apache Software Foundation (ASF) under one
1717
under the License.
1818
*/
1919

20-
package org.codehaus.plexus.components.cipher;
20+
package org.codehaus.plexus.components.cipher.internal;
2121

2222
import javax.crypto.Cipher;
2323
import javax.crypto.NoSuchPaddingException;
@@ -36,6 +36,8 @@ Licensed to the Apache Software Foundation (ASF) under one
3636
import java.security.spec.KeySpec;
3737
import java.util.Base64;
3838

39+
import org.codehaus.plexus.components.cipher.PlexusCipherException;
40+
3941
/**
4042
* This class is thread-safe.
4143
*

src/test/java/org/codehaus/plexus/components/cipher/DefaultPlexusCipherTest.java renamed to src/test/java/org/codehaus/plexus/components/cipher/internal/DefaultPlexusCipherTest.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1111
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
1212
*/
13-
package org.codehaus.plexus.components.cipher;
13+
package org.codehaus.plexus.components.cipher.internal;
1414

15+
import org.codehaus.plexus.components.cipher.PlexusCipher;
16+
import org.codehaus.plexus.components.cipher.PlexusCipherException;
1517
import org.junit.jupiter.api.BeforeEach;
1618
import org.junit.jupiter.api.Disabled;
1719
import org.junit.jupiter.api.Test;
@@ -154,18 +156,14 @@ void testDecrypt() {
154156
@Test
155157
void testDecorate() {
156158
String res = pc.decorate("aaa");
157-
assertEquals(
158-
PlexusCipher.ENCRYPTED_STRING_DECORATION_START + "aaa" + PlexusCipher.ENCRYPTED_STRING_DECORATION_STOP,
159-
res,
160-
"Decoration failed");
159+
assertEquals("{aaa}", res, "Decoration failed");
161160
}
162161

163162
// -------------------------------------------------------------
164163

165164
@Test
166165
void testUnDecorate() throws Exception {
167-
String res = pc.unDecorate(
168-
PlexusCipher.ENCRYPTED_STRING_DECORATION_START + "aaa" + PlexusCipher.ENCRYPTED_STRING_DECORATION_STOP);
166+
String res = pc.unDecorate("{aaa}");
169167
assertEquals("aaa", res, "Decoration failed");
170168
}
171169

src/test/java/org/codehaus/plexus/components/cipher/PBECipherTest.java renamed to src/test/java/org/codehaus/plexus/components/cipher/internal/PBECipherTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Licensed to the Apache Software Foundation (ASF) under one
1717
under the License.
1818
*/
1919

20-
package org.codehaus.plexus.components.cipher;
20+
package org.codehaus.plexus.components.cipher.internal;
2121

2222
import org.junit.jupiter.api.BeforeEach;
2323
import org.junit.jupiter.api.Test;

0 commit comments

Comments
 (0)