spring boot init
spring boot init
@@ -0,0 +1,19 @@
|
||||
package org.maxkey;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
|
||||
@SpringBootApplication
|
||||
public class MaxKeyApplication extends SpringBootServletInitializer {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(MaxKeyApplication.class, args);
|
||||
}
|
||||
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||
return application.sources(MaxKeyApplication.class);
|
||||
}
|
||||
|
||||
}
|
||||
10
maxkey-web-maxkey/src/main/java/org/maxkey/MaxKeyConfig.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package org.maxkey;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.ImportResource;
|
||||
|
||||
@Configuration
|
||||
@ImportResource(locations={"classpath:spring/maxkey.xml"})
|
||||
public class MaxKeyConfig {
|
||||
|
||||
}
|
||||
@@ -79,11 +79,6 @@ public class AppListController{
|
||||
WebContext.setAttribute(app.getId(), app.getIcon());
|
||||
}
|
||||
|
||||
if(appList.size()%5>0){
|
||||
for(int i=0;i<=appList.size()%5;i++){
|
||||
appList.add(new UserApplications());
|
||||
}
|
||||
}
|
||||
return appList;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ public class OneTimePasswordController {
|
||||
|
||||
@RequestMapping(value={"/timebased"})
|
||||
public ModelAndView timebased(){
|
||||
ModelAndView modelAndView=new ModelAndView("otp/timeBased");
|
||||
ModelAndView modelAndView=new ModelAndView("safe/timeBased");
|
||||
UserInfo userInfo=WebContext.getUserInfo();
|
||||
String sharedSecret=passwordReciprocal.decoder(userInfo.getSharedSecret());
|
||||
timeBasedKeyUriFormat.setSecret(sharedSecret);
|
||||
@@ -84,7 +84,7 @@ public class OneTimePasswordController {
|
||||
|
||||
@RequestMapping(value={"/counterbased"})
|
||||
public ModelAndView counterbased(){
|
||||
ModelAndView modelAndView=new ModelAndView("otp/counterBased");
|
||||
ModelAndView modelAndView=new ModelAndView("safe/counterBased");
|
||||
UserInfo userInfo=WebContext.getUserInfo();
|
||||
String sharedSecret=passwordReciprocal.decoder(userInfo.getSharedSecret());
|
||||
counterBasedKeyUriFormat.setSecret(sharedSecret);
|
||||
@@ -117,7 +117,7 @@ public class OneTimePasswordController {
|
||||
|
||||
@RequestMapping(value={"/hotp"})
|
||||
public ModelAndView hotp(){
|
||||
ModelAndView modelAndView=new ModelAndView("otp/hotp");
|
||||
ModelAndView modelAndView=new ModelAndView("safe/hotp");
|
||||
UserInfo userInfo=WebContext.getUserInfo();
|
||||
String sharedSecret=passwordReciprocal.decoder(userInfo.getSharedSecret());
|
||||
hotpKeyUriFormat.setSecret(sharedSecret);
|
||||
|
||||
@@ -67,9 +67,9 @@ public class LoginEndpoint {
|
||||
@Qualifier("userInfoService")
|
||||
UserInfoService userInfoService;
|
||||
|
||||
@Autowired
|
||||
/*@Autowired
|
||||
@Qualifier("wsFederationService")
|
||||
WsFederationService wsFederationService;
|
||||
WsFederationService wsFederationService;*/
|
||||
|
||||
@Autowired
|
||||
@Qualifier("authenticationProvider")
|
||||
@@ -117,7 +117,7 @@ public class LoginEndpoint {
|
||||
if(applicationConfig.getLoginConfig().isWsFederation()&&
|
||||
StringUtils.isNotEmpty(wsFederationWA) &&
|
||||
wsFederationWA.equalsIgnoreCase(WsFederationConstants.WSIGNIN)){
|
||||
isAuthenticated=wsFederationService.login(wsFederationWA,wsFederationWResult,request);
|
||||
//isAuthenticated=wsFederationService.login(wsFederationWA,wsFederationWResult,request);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
22
maxkey-web-maxkey/src/main/resources/application.properties
Normal file
@@ -0,0 +1,22 @@
|
||||
#server config
|
||||
#spring.profiles.active=dev
|
||||
#server port
|
||||
server.port=80
|
||||
#web app context path
|
||||
server.servlet.context-path=/maxkey
|
||||
|
||||
#for freemarker
|
||||
spring.freemarker.template-loader-path=classpath:/templates/views
|
||||
spring.freemarker.cache=false
|
||||
spring.freemarker.charset=UTF-8
|
||||
spring.freemarker.check-template-location=true
|
||||
spring.freemarker.content-type=text/html
|
||||
spring.freemarker.expose-request-attributes=false
|
||||
spring.freemarker.expose-session-attributes=false
|
||||
spring.freemarker.request-context-attribute=request
|
||||
spring.freemarker.suffix=.ftl
|
||||
|
||||
#static resources
|
||||
spring.mvc.static-path-pattern=/static/**
|
||||
|
||||
spring.main.allow-bean-definition-overriding=true
|
||||
@@ -5,22 +5,16 @@
|
||||
<Console name="consolePrint" target="SYSTEM_OUT">
|
||||
<PatternLayout pattern="%d{YYYY-MM-dd HH:mm:ss,SSS} [%t] %-5level %logger{36} - %msg%n" />
|
||||
</Console>
|
||||
<!--
|
||||
<File name="File" fileName="logs/PipeLineRunner.log">
|
||||
<PatternLayout pattern="%d{YYYY-MM-dd HH:mm:ss,SSS} [%t] %-5level %logger{36} - %msg%n" />
|
||||
</File>
|
||||
-->
|
||||
|
||||
<!-- 输出到文件,按天或者超过80MB分割 -->
|
||||
<RollingFile name="RollingFile" fileName="${catalina.home}/logs/maxkey.log" filePattern="${catalina.home}/logs/$${date:yyyy-MM}/maxkey-%d{yyyy-MM-dd}-%i.log.gz">
|
||||
<!-- 输出到文件,按天或者超过250MB分割 每天进行归档yyyy-MM-dd -->
|
||||
<RollingFile name="RollingFile" fileName="${catalina.home}/logs/maxkey.log" filePattern="${catalina.home}/logs/$${date:yyyy-MM-dd}/maxkey-%d{yyyy-MM-dd}-%i.log.gz">
|
||||
<!-- 需要记录的级别 -->
|
||||
<!-- <ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY" /> -->
|
||||
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss,SSS}:%4p %t (%F:%L) - %m%n" />
|
||||
<Policies>
|
||||
<OnStartupTriggeringPolicy />
|
||||
<TimeBasedTriggeringPolicy />
|
||||
<SizeBasedTriggeringPolicy size="512 MB" />
|
||||
<!-- <SizeBasedTriggeringPolicy size="80 MB" /> -->
|
||||
<SizeBasedTriggeringPolicy size="250 MB" />
|
||||
</Policies>
|
||||
</RollingFile>
|
||||
</appenders>
|
||||
|
||||
@@ -26,11 +26,10 @@
|
||||
<import resource="maxkey-support-kerberos.xml"/>
|
||||
|
||||
<import resource="maxkey-support-social.xml"/>
|
||||
|
||||
<import resource="maxkey-support-wsfederation.xml"/>
|
||||
|
||||
<import resource="maxkey-support-cas.xml"/>
|
||||
<!--
|
||||
<import resource="maxkey-support-wsfederation.xml"/>
|
||||
|
||||
|
||||
<import resource="maxkey-support-jwt.xml"/>
|
||||
-->
|
||||
|
||||
@@ -108,9 +108,9 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- View Resolver -->
|
||||
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/WEB-INF/views/" p:suffix=".jsp" p:order="2" />
|
||||
|
||||
<!-- View Resolver
|
||||
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/templates/" p:suffix=".jsp" p:order="2" />
|
||||
-->
|
||||
<!-- upload file support -->
|
||||
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
|
||||
<property name="maxUploadSize" value="4194304" />
|
||||
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 413 B After Width: | Height: | Size: 413 B |
|
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 207 B |
|
Before Width: | Height: | Size: 220 B After Width: | Height: | Size: 220 B |
|
Before Width: | Height: | Size: 208 B After Width: | Height: | Size: 208 B |
|
Before Width: | Height: | Size: 208 B After Width: | Height: | Size: 208 B |
|
Before Width: | Height: | Size: 340 B After Width: | Height: | Size: 340 B |
|
Before Width: | Height: | Size: 252 B After Width: | Height: | Size: 252 B |
|
Before Width: | Height: | Size: 251 B After Width: | Height: | Size: 251 B |
|
Before Width: | Height: | Size: 322 B After Width: | Height: | Size: 322 B |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 212 B After Width: | Height: | Size: 212 B |
|
Before Width: | Height: | Size: 220 B After Width: | Height: | Size: 220 B |
|
Before Width: | Height: | Size: 208 B After Width: | Height: | Size: 208 B |
|
Before Width: | Height: | Size: 208 B After Width: | Height: | Size: 208 B |
|
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 207 B |
|
Before Width: | Height: | Size: 277 B After Width: | Height: | Size: 277 B |
|
Before Width: | Height: | Size: 338 B After Width: | Height: | Size: 338 B |
|
Before Width: | Height: | Size: 280 B After Width: | Height: | Size: 280 B |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 418 B After Width: | Height: | Size: 418 B |
|
Before Width: | Height: | Size: 312 B After Width: | Height: | Size: 312 B |
|
Before Width: | Height: | Size: 205 B After Width: | Height: | Size: 205 B |
|
Before Width: | Height: | Size: 262 B After Width: | Height: | Size: 262 B |
|
Before Width: | Height: | Size: 348 B After Width: | Height: | Size: 348 B |
|
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 207 B |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 278 B After Width: | Height: | Size: 278 B |
|
Before Width: | Height: | Size: 328 B After Width: | Height: | Size: 328 B |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 406 B After Width: | Height: | Size: 406 B |
|
Before Width: | Height: | Size: 404 B After Width: | Height: | Size: 404 B |
|
Before Width: | Height: | Size: 407 B After Width: | Height: | Size: 407 B |