Commit 5b71f719 by linxu

Throw exception after License expired

parent 7510b97d
......@@ -61,7 +61,7 @@
<resource>
<directory>src/main/resources</directory>
<excludes>
<!-- <exclude>bootstrap.yml</exclude>-->
<exclude>bootstrap.yml</exclude>
<exclude>license.dat</exclude>
</excludes>
</resource>
......@@ -69,6 +69,16 @@
<plugins>
<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>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
......
package com.keymobile.sso.conf;
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.IllegalBlockSizeException;
......@@ -35,7 +33,7 @@ public class LicenseMgr {
}
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);
check(licenseText);
}
......
......@@ -3,6 +3,7 @@ package com.keymobile.sso.conf;
import com.keymobile.sso.logging.LogConstants;
import com.keymobile.sso.logging.LogManager;
import jakarta.servlet.ServletException;
import jakarta.servlet.UnavailableException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -43,7 +44,7 @@ public class RESTAuthenticationSuccessHandler extends SimpleUrlAuthenticationSuc
}
LogManager.logInfo(LogConstants.CTX_AUDIT, "License checked.");
} 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