Commit 5b71f719 by linxu

Throw exception after License expired

parent 7510b97d
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<resource> <resource>
<directory>src/main/resources</directory> <directory>src/main/resources</directory>
<excludes> <excludes>
<!-- <exclude>bootstrap.yml</exclude>--> <exclude>bootstrap.yml</exclude>
<exclude>license.dat</exclude> <exclude>license.dat</exclude>
</excludes> </excludes>
</resource> </resource>
...@@ -69,6 +69,16 @@ ...@@ -69,6 +69,16 @@
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<excludes>
<exclude>com/keymobile/sso/conf/LicenseMgr.class</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> </plugin>
......
package com.keymobile.sso.conf; package com.keymobile.sso.conf;
import com.keymobile.crypto.aes.AESUtil; import com.keymobile.crypto.aes.AESUtil;
import com.keymobile.sso.logging.LogConstants;
import com.keymobile.sso.logging.LogManager;
import javax.crypto.BadPaddingException; import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException; import javax.crypto.IllegalBlockSizeException;
...@@ -35,7 +33,7 @@ public class LicenseMgr { ...@@ -35,7 +33,7 @@ public class LicenseMgr {
} }
public static void main(String [] args) throws InvalidAlgorithmParameterException, NoSuchPaddingException, IllegalBlockSizeException, NoSuchAlgorithmException, BadPaddingException, InvalidKeyException { public static void main(String [] args) throws InvalidAlgorithmParameterException, NoSuchPaddingException, IllegalBlockSizeException, NoSuchAlgorithmException, BadPaddingException, InvalidKeyException {
String licenseText = generate("2025-09-01"); String licenseText = generate("2026-05-15");
System.out.println("licenseText:" + licenseText); System.out.println("licenseText:" + licenseText);
check(licenseText); check(licenseText);
} }
......
...@@ -3,6 +3,7 @@ package com.keymobile.sso.conf; ...@@ -3,6 +3,7 @@ package com.keymobile.sso.conf;
import com.keymobile.sso.logging.LogConstants; import com.keymobile.sso.logging.LogConstants;
import com.keymobile.sso.logging.LogManager; import com.keymobile.sso.logging.LogManager;
import jakarta.servlet.ServletException; import jakarta.servlet.ServletException;
import jakarta.servlet.UnavailableException;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -43,7 +44,7 @@ public class RESTAuthenticationSuccessHandler extends SimpleUrlAuthenticationSuc ...@@ -43,7 +44,7 @@ public class RESTAuthenticationSuccessHandler extends SimpleUrlAuthenticationSuc
} }
LogManager.logInfo(LogConstants.CTX_AUDIT, "License checked."); LogManager.logInfo(LogConstants.CTX_AUDIT, "License checked.");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); throw new UnavailableException("License已过期, 请与我们联系。");
} }
} }
......
tEAS/DJglXGdXIq0wZaHfQ==
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment