Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions framework/fit/java/fit-builtin/plugins/fit-security-simple/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.fitframework.plugin</groupId>
<artifactId>fit-plugin-parent</artifactId>
<version>3.5.0-SNAPSHOT</version>
</parent>

<artifactId>fit-security-simple</artifactId>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.fitframework</groupId>
<artifactId>fit-dependency</artifactId>
<version>${fit.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<!-- FIT core -->
<dependency>
<groupId>org.fitframework</groupId>
<artifactId>fit-api</artifactId>
</dependency>
<dependency>
<groupId>org.fitframework</groupId>
<artifactId>fit-util</artifactId>
</dependency>

<!-- Micro genericables -->
<dependency>
<groupId>org.fitframework.service</groupId>
<artifactId>fit-security</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.fitframework</groupId>
<artifactId>fit-build-maven-plugin</artifactId>
<version>${fit.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven.antrun.version}</version>
<executions>
<execution>
<phase>package</phase>
<configuration>
<target>
<copy file="${project.build.directory}/${project.build.finalName}.jar"
todir="../../../target/plugins"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) 2025 Huawei Technologies Co., Ltd. All rights reserved.
* This file is a part of the ModelEngine Project.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

package modelengine.fit.security.simple;

import modelengine.fit.security.Decryptor;
import modelengine.fit.security.Encryptor;
import modelengine.fitframework.annotation.Component;
import modelengine.fitframework.util.StringUtils;

/**
* 表示 {@link Decryptor} 的简单实现。
*
* @author 季聿阶
* @since 2023-07-31
*/
@Component
public class SimpleCipher implements Encryptor, Decryptor {
@Override
public String encrypt(String decrypted) {
return CIPHER_PREFIX + decrypted + CIPHER_SUFFIX;
}

@Override
public String decrypt(String encrypted) {
if (StringUtils.startsWithIgnoreCase(encrypted, CIPHER_PREFIX) && StringUtils.endsWithIgnoreCase(encrypted, CIPHER_SUFFIX)) {
return encrypted.substring(CIPHER_PREFIX.length(), encrypted.length() - CIPHER_SUFFIX.length());
}
return encrypted;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fit:
beans:
packages:
- 'modelengine.fit.security.simple'
1 change: 1 addition & 0 deletions framework/fit/java/fit-builtin/plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<module>fit-logger</module>
<module>fit-message-serializer-cbor</module>
<module>fit-message-serializer-json-jackson</module>
<module>fit-security-simple</module>
<module>fit-server-http</module>
<module>fit-service-coordination-locator</module>
<module>fit-service-coordination-simple</module>
Expand Down