Skip to content

Commit e74cf70

Browse files
committed
Merge branch '3.5.x'
2 parents c7c93fe + 8e8bd17 commit e74cf70

File tree

4 files changed

+111
-0
lines changed

4 files changed

+111
-0
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<parent>
7+
<groupId>org.fitframework.plugin</groupId>
8+
<artifactId>fit-plugin-parent</artifactId>
9+
<version>3.5.0-SNAPSHOT</version>
10+
</parent>
11+
12+
<artifactId>fit-security-simple</artifactId>
13+
14+
<dependencyManagement>
15+
<dependencies>
16+
<dependency>
17+
<groupId>org.fitframework</groupId>
18+
<artifactId>fit-dependency</artifactId>
19+
<version>${fit.version}</version>
20+
<type>pom</type>
21+
<scope>import</scope>
22+
</dependency>
23+
</dependencies>
24+
</dependencyManagement>
25+
26+
<dependencies>
27+
<!-- FIT core -->
28+
<dependency>
29+
<groupId>org.fitframework</groupId>
30+
<artifactId>fit-api</artifactId>
31+
</dependency>
32+
<dependency>
33+
<groupId>org.fitframework</groupId>
34+
<artifactId>fit-util</artifactId>
35+
</dependency>
36+
37+
<!-- Micro genericables -->
38+
<dependency>
39+
<groupId>org.fitframework.service</groupId>
40+
<artifactId>fit-security</artifactId>
41+
</dependency>
42+
</dependencies>
43+
44+
<build>
45+
<plugins>
46+
<plugin>
47+
<groupId>org.fitframework</groupId>
48+
<artifactId>fit-build-maven-plugin</artifactId>
49+
<version>${fit.version}</version>
50+
</plugin>
51+
<plugin>
52+
<groupId>org.apache.maven.plugins</groupId>
53+
<artifactId>maven-antrun-plugin</artifactId>
54+
<version>${maven.antrun.version}</version>
55+
<executions>
56+
<execution>
57+
<phase>package</phase>
58+
<configuration>
59+
<target>
60+
<copy file="${project.build.directory}/${project.build.finalName}.jar"
61+
todir="../../../target/plugins"/>
62+
</target>
63+
</configuration>
64+
<goals>
65+
<goal>run</goal>
66+
</goals>
67+
</execution>
68+
</executions>
69+
</plugin>
70+
</plugins>
71+
</build>
72+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) 2025 Huawei Technologies Co., Ltd. All rights reserved.
3+
* This file is a part of the ModelEngine Project.
4+
* Licensed under the MIT License. See License.txt in the project root for license information.
5+
*--------------------------------------------------------------------------------------------*/
6+
7+
package modelengine.fit.security.simple;
8+
9+
import modelengine.fit.security.Decryptor;
10+
import modelengine.fit.security.Encryptor;
11+
import modelengine.fitframework.annotation.Component;
12+
import modelengine.fitframework.util.StringUtils;
13+
14+
/**
15+
* 表示 {@link Decryptor} 的简单实现。
16+
*
17+
* @author 季聿阶
18+
* @since 2023-07-31
19+
*/
20+
@Component
21+
public class SimpleCipher implements Encryptor, Decryptor {
22+
@Override
23+
public String encrypt(String decrypted) {
24+
return CIPHER_PREFIX + decrypted + CIPHER_SUFFIX;
25+
}
26+
27+
@Override
28+
public String decrypt(String encrypted) {
29+
if (StringUtils.startsWithIgnoreCase(encrypted, CIPHER_PREFIX) && StringUtils.endsWithIgnoreCase(encrypted, CIPHER_SUFFIX)) {
30+
return encrypted.substring(CIPHER_PREFIX.length(), encrypted.length() - CIPHER_SUFFIX.length());
31+
}
32+
return encrypted;
33+
}
34+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fit:
2+
beans:
3+
packages:
4+
- 'modelengine.fit.security.simple'

framework/fit/java/fit-builtin/plugins/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<module>fit-logger</module>
2727
<module>fit-message-serializer-cbor</module>
2828
<module>fit-message-serializer-json-jackson</module>
29+
<module>fit-security-simple</module>
2930
<module>fit-server-http</module>
3031
<module>fit-service-coordination-locator</module>
3132
<module>fit-service-coordination-simple</module>

0 commit comments

Comments
 (0)