提交 b44d409b 编写于 作者: ibizdev's avatar ibizdev

ibizdev提交

上级 a97239af
...@@ -38,6 +38,11 @@ ...@@ -38,6 +38,11 @@
git clone -b master $para2 ibzwf/ git clone -b master $para2 ibzwf/
export NODE_OPTIONS=--max-old-space-size=4096 export NODE_OPTIONS=--max-old-space-size=4096
cd ibzwf/ cd ibzwf/
mvn clean package -Papi
cd ibzwf-provider/ibzwf-provider-api
mvn -Papi docker:build
mvn -Papi docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/ibzwf-provider-api.yaml dev --with-registry-auth
</command> </command>
</hudson.tasks.Shell> </hudson.tasks.Shell>
</builders> </builders>
......
...@@ -20,6 +20,7 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; ...@@ -20,6 +20,7 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.context.annotation.Profile; import org.springframework.context.annotation.Profile;
import org.springframework.beans.factory.annotation.Qualifier;
@Profile("web-prod") @Profile("web-prod")
@Configuration @Configuration
...@@ -30,6 +31,7 @@ public class webSecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -30,6 +31,7 @@ public class webSecurityConfig extends WebSecurityConfigurerAdapter {
private AuthenticationEntryPoint unauthorizedHandler; private AuthenticationEntryPoint unauthorizedHandler;
@Autowired @Autowired
@Qualifier("IBZUAAUserService")
private AuthenticationUserService userDetailsService; private AuthenticationUserService userDetailsService;
/** /**
......
...@@ -19,6 +19,7 @@ import org.springframework.security.config.http.SessionCreationPolicy; ...@@ -19,6 +19,7 @@ import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.beans.factory.annotation.Qualifier;
@Configuration @Configuration
@EnableWebSecurity @EnableWebSecurity
...@@ -29,6 +30,7 @@ public class DevBootSecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -29,6 +30,7 @@ public class DevBootSecurityConfig extends WebSecurityConfigurerAdapter {
private AuthenticationEntryPoint unauthorizedHandler; private AuthenticationEntryPoint unauthorizedHandler;
@Autowired @Autowired
@Qualifier("IBZUAAUserService")
private AuthenticationUserService userDetailsService; private AuthenticationUserService userDetailsService;
/** /**
......
...@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBZ_SLEEP}s..." && \ ...@@ -9,6 +9,6 @@ CMD echo "The application will start in ${IBZ_SLEEP}s..." && \
sleep ${IBZ_SLEEP} && \ sleep ${IBZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzwf-provider-api.jar java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /ibzwf-provider-api.jar
EXPOSE 8081 EXPOSE 40003
ADD ibzwf-provider-api.jar /ibzwf-provider-api.jar ADD ibzwf-provider-api.jar /ibzwf-provider-api.jar
...@@ -3,9 +3,11 @@ services: ...@@ -3,9 +3,11 @@ services:
ibzwf-provider-api: ibzwf-provider-api:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/ibzwf-provider-api:latest image: registry.cn-shanghai.aliyuncs.com/ibizsys/ibzwf-provider-api:latest
ports: ports:
- "8081:8081" - "40003:40003"
networks: networks:
- agent_network - agent_network
environment:
SPRING_CLOUD_NACOS_DISCOVERY_IP: 172.16.180.237
deploy: deploy:
mode: replicated mode: replicated
replicas: 1 replicas: 1
......
...@@ -20,6 +20,7 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; ...@@ -20,6 +20,7 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.context.annotation.Profile; import org.springframework.context.annotation.Profile;
import org.springframework.beans.factory.annotation.Qualifier;
@Profile("api-prod") @Profile("api-prod")
@Configuration @Configuration
...@@ -30,6 +31,7 @@ public class apiSecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -30,6 +31,7 @@ public class apiSecurityConfig extends WebSecurityConfigurerAdapter {
private AuthenticationEntryPoint unauthorizedHandler; private AuthenticationEntryPoint unauthorizedHandler;
@Autowired @Autowired
@Qualifier("IBZUAAUserService")
private AuthenticationUserService userDetailsService; private AuthenticationUserService userDetailsService;
/** /**
......
server: server:
port: 8081 port: 40003
\ No newline at end of file \ No newline at end of file
...@@ -14,6 +14,7 @@ import org.springframework.security.core.context.SecurityContextHolder; ...@@ -14,6 +14,7 @@ import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Qualifier;
@RestController @RestController
@RequestMapping("/") @RequestMapping("/")
...@@ -27,6 +28,7 @@ public class AuthenticationController ...@@ -27,6 +28,7 @@ public class AuthenticationController
private AuthTokenUtil jwtTokenUtil; private AuthTokenUtil jwtTokenUtil;
@Autowired @Autowired
@Qualifier("IBZUAAUserService")
private AuthenticationUserService userDetailsService; private AuthenticationUserService userDetailsService;
@PostMapping(value = "${ibiz.auth.path:v7/login}") @PostMapping(value = "${ibiz.auth.path:v7/login}")
......
...@@ -11,6 +11,7 @@ import org.springframework.security.core.userdetails.UserDetailsService; ...@@ -11,6 +11,7 @@ import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.web.authentication.WebAuthenticationDetailsSource; import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter; import org.springframework.web.filter.OncePerRequestFilter;
import org.springframework.beans.factory.annotation.Qualifier;
import javax.servlet.FilterChain; import javax.servlet.FilterChain;
import javax.servlet.ServletException; import javax.servlet.ServletException;
...@@ -26,7 +27,7 @@ public class AuthorizationTokenFilter extends OncePerRequestFilter { ...@@ -26,7 +27,7 @@ public class AuthorizationTokenFilter extends OncePerRequestFilter {
private final AuthTokenUtil authTokenUtil; private final AuthTokenUtil authTokenUtil;
private final String tokenHeader; private final String tokenHeader;
public AuthorizationTokenFilter(AuthenticationUserService userDetailsService, AuthTokenUtil authTokenUtil, @Value("${ibiz.jwt.header:Authorization}") String tokenHeader) { public AuthorizationTokenFilter(@Qualifier("IBZUAAUserService") AuthenticationUserService userDetailsService, AuthTokenUtil authTokenUtil, @Value("${ibiz.jwt.header:Authorization}") String tokenHeader) {
this.userDetailsService = userDetailsService; this.userDetailsService = userDetailsService;
this.authTokenUtil = authTokenUtil; this.authTokenUtil = authTokenUtil;
this.tokenHeader = tokenHeader; this.tokenHeader = tokenHeader;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册