Skip to content

Commit

Permalink
v1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cgw committed Nov 28, 2023
1 parent ba9b4b7 commit 5adee5b
Show file tree
Hide file tree
Showing 14 changed files with 55 additions and 67 deletions.
2 changes: 1 addition & 1 deletion dhorse-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.dhorse</groupId>
<artifactId>dhorse-parent</artifactId>
<version>1.4.2</version>
<version>1.5.0</version>
<relativePath>..</relativePath>
</parent>
<artifactId>dhorse-agent</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion dhorse-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.dhorse</groupId>
<artifactId>dhorse-parent</artifactId>
<version>1.4.2</version>
<version>1.5.0</version>
<relativePath>..</relativePath>
</parent>
<artifactId>dhorse-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion dhorse-application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.dhorse</groupId>
<artifactId>dhorse-parent</artifactId>
<version>1.4.2</version>
<version>1.5.0</version>
<relativePath>..</relativePath>
</parent>
<artifactId>dhorse-application</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion dhorse-infrastructure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.dhorse</groupId>
<artifactId>dhorse-parent</artifactId>
<version>1.4.2</version>
<version>1.5.0</version>
<relativePath>..</relativePath>
</parent>
<artifactId>dhorse-infrastructure</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>org.dhorse</groupId>
<artifactId>app-node-pnpm</artifactId>
<packaging>pom</packaging>
<version>1.4.2</version>
<version>1.5.0</version>

<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>org.dhorse</groupId>
<artifactId>app-node</artifactId>
<packaging>pom</packaging>
<version>1.4.2</version>
<version>1.5.0</version>

<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>org.dhorse</groupId>
<artifactId>app-node-yarn</artifactId>
<packaging>pom</packaging>
<version>1.4.2</version>
<version>1.5.0</version>

<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.dhorse</groupId>
<artifactId>app-tmp</artifactId>
<version>1.4.2</version>
<version>1.5.0</version>

<parent>
<groupId>org.springframework.boot</groupId>
Expand Down
2 changes: 1 addition & 1 deletion dhorse-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.dhorse</groupId>
<artifactId>dhorse-parent</artifactId>
<version>1.4.2</version>
<version>1.5.0</version>
<relativePath>..</relativePath>
</parent>
<artifactId>dhorse-rest</artifactId>
Expand Down
92 changes: 40 additions & 52 deletions dhorse-rest/src/main/java/org/dhorse/rest/component/CasConfig.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
package org.dhorse.rest.component;

import java.util.Arrays;
import java.util.EventListener;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.dhorse.api.enums.YesOrNoEnum;
import org.dhorse.api.response.model.GlobalConfigAgg.CAS;
import org.dhorse.application.service.GlobalConfigApplicationService;
import org.jasig.cas.client.authentication.AuthenticationFilter;
import org.jasig.cas.client.session.SingleSignOutHttpSessionListener;
import org.jasig.cas.client.validation.AbstractTicketValidationFilter;
import org.jasig.cas.client.validation.Cas30ProxyReceivingTicketValidationFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -25,46 +13,46 @@
@Configuration
public class CasConfig {

private static final List<String> URL_PATTERNS = Arrays.asList("/cas", "/page/sys_user/cas_login.html");

@Autowired
private GlobalConfigApplicationService globalConfigApplicationService;

@Bean
public FilterRegistrationBean<AuthenticationFilter> authFilterRegistration() {
CAS cas = globalConfigApplicationService.queryCas();
FilterRegistrationBean<AuthenticationFilter> fr = new FilterRegistrationBean<>();
Map<String, String> initParameters = new HashMap<String, String>();
if (cas != null && YesOrNoEnum.YES.getCode().equals(cas.getEnable())) {
initParameters.put("casServerLoginUrl", cas.getServerLoginUrl());
initParameters.put("serverName", cas.getClientHostUrl());
} else {
fr.setEnabled(false);
}
fr.setFilter(new AuthenticationFilter());
fr.setInitParameters(initParameters);
fr.setUrlPatterns(URL_PATTERNS);
fr.setOrder(2);
return fr;
}

@Bean
public FilterRegistrationBean<AbstractTicketValidationFilter> validFilterRegistration() {
CAS cas = globalConfigApplicationService.queryCas();
FilterRegistrationBean<AbstractTicketValidationFilter> fr = new FilterRegistrationBean<>();
Map<String, String> initParameters = new HashMap<String, String>();
if (cas != null && YesOrNoEnum.YES.getCode().equals(cas.getEnable())) {
initParameters.put("casServerUrlPrefix", cas.getServerUrlPrefix());
initParameters.put("serverName", cas.getClientHostUrl());
} else {
fr.setEnabled(false);
}
fr.setFilter(new Cas30ProxyReceivingTicketValidationFilter());
fr.setInitParameters(initParameters);
fr.setUrlPatterns(URL_PATTERNS);
fr.setOrder(1);
return fr;
}
// private static final List<String> URL_PATTERNS = Arrays.asList("/cas", "/page/sys_user/cas_login.html");
//
// @Autowired
// private GlobalConfigApplicationService globalConfigApplicationService;
//
// @Bean
// public FilterRegistrationBean<AuthenticationFilter> authFilterRegistration() {
// CAS cas = globalConfigApplicationService.queryCas();
// FilterRegistrationBean<AuthenticationFilter> fr = new FilterRegistrationBean<>();
// Map<String, String> initParameters = new HashMap<String, String>();
// if (cas != null && YesOrNoEnum.YES.getCode().equals(cas.getEnable())) {
// initParameters.put("casServerLoginUrl", cas.getServerLoginUrl());
// initParameters.put("serverName", cas.getClientHostUrl());
// } else {
// fr.setEnabled(false);
// }
// fr.setFilter(new AuthenticationFilter());
// fr.setInitParameters(initParameters);
// fr.setUrlPatterns(URL_PATTERNS);
// fr.setOrder(2);
// return fr;
// }
//
// @Bean
// public FilterRegistrationBean<AbstractTicketValidationFilter> validFilterRegistration() {
// CAS cas = globalConfigApplicationService.queryCas();
// FilterRegistrationBean<AbstractTicketValidationFilter> fr = new FilterRegistrationBean<>();
// Map<String, String> initParameters = new HashMap<String, String>();
// if (cas != null && YesOrNoEnum.YES.getCode().equals(cas.getEnable())) {
// initParameters.put("casServerUrlPrefix", cas.getServerUrlPrefix());
// initParameters.put("serverName", cas.getClientHostUrl());
// } else {
// fr.setEnabled(false);
// }
// fr.setFilter(new Cas30ProxyReceivingTicketValidationFilter());
// fr.setInitParameters(initParameters);
// fr.setUrlPatterns(URL_PATTERNS);
// fr.setOrder(1);
// return fr;
// }

@Bean
public ServletListenerRegistrationBean<EventListener> singleSignOutListenerRegistration() {
Expand Down
2 changes: 1 addition & 1 deletion dhorse-rest/src/main/resources/application-private.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 1.4.2
version: 1.5.0
spring.jackson.default-property-inclusion: non_null
spring.jackson.date-format: yyyy-MM-dd HH:mm:ss
spring.jackson.serialization.FAIL_ON_EMPTY_BEANS: false
Expand Down
2 changes: 1 addition & 1 deletion dhorse-rest/src/main/resources/banner.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
| | | | __ |/ _ \| '__/ __|/ _ \
| |__| | | | | (_) | | \__ \ __/
|_____/|_| |_|\___/|_| |___/\___|
:: DHorse :: (v1.4.2)
:: DHorse :: (v1.5.0)
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>org.dhorse</groupId>
<artifactId>dhorse-parent</artifactId>
<packaging>pom</packaging>
<version>1.4.2</version>
<version>1.5.0</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -16,7 +16,7 @@
<java.version>1.8</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<project.version>1.4.2</project.version>
<project.version>1.5.0</project.version>
<spring.version>5.3.30</spring.version>
<springboot.version>2.7.17</springboot.version>
</properties>
Expand Down
4 changes: 2 additions & 2 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<link rel="stylesheet" href="css/public.css" media="all">
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.5.0/respond.min.js"></script>
<![endif]-->
<style id="layuimini-bg-color">
#app-select-div .layui-col-md6 {
Expand Down Expand Up @@ -107,7 +107,7 @@

<div class="layui-body">
<div class="layuimini-content-page"></div>
<div style="text-align: center; height:60px; line-height:60px; color: #9c9da0">v1.4.2</div>
<div style="text-align: center; height:60px; line-height:60px; color: #9c9da0">v1.5.0</div>
</div>

</div>
Expand Down

0 comments on commit 5adee5b

Please sign in to comment.