|
@@ -1,7 +1,5 @@
|
|
|
package com.yonge.cooleshow.admin.config;
|
|
|
|
|
|
-import com.yonge.cooleshow.common.security.BaseAccessDeniedHandler;
|
|
|
-import com.yonge.cooleshow.common.security.BaseAuthenticationEntryPoint;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
|
@@ -10,6 +8,9 @@ import org.springframework.security.oauth2.config.annotation.web.configuration.E
|
|
|
import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
|
|
|
import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer;
|
|
|
|
|
|
+import com.yonge.cooleshow.common.security.BaseAccessDeniedHandler;
|
|
|
+import com.yonge.cooleshow.common.security.BaseAuthenticationEntryPoint;
|
|
|
+
|
|
|
@Configuration
|
|
|
@EnableResourceServer
|
|
|
@EnableGlobalMethodSecurity(prePostEnabled = true)
|
|
@@ -23,14 +24,10 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
|
|
|
|
|
|
@Override
|
|
|
public void configure(HttpSecurity http) throws Exception {
|
|
|
- http.csrf()
|
|
|
- .disable()
|
|
|
- .exceptionHandling()
|
|
|
- .accessDeniedHandler(baseAccessDeniedHandler)
|
|
|
- .authenticationEntryPoint(baseAuthenticationEntryPoint)
|
|
|
- .and()
|
|
|
- .authorizeRequests()
|
|
|
- .antMatchers("/v2/api-docs", "/code/*").permitAll().anyRequest().authenticated().and().httpBasic();
|
|
|
+ http.csrf().disable().exceptionHandling().accessDeniedHandler(baseAccessDeniedHandler).authenticationEntryPoint(baseAuthenticationEntryPoint).and()
|
|
|
+ .authorizeRequests().antMatchers("/task/**").hasIpAddress("0.0.0.0/0")
|
|
|
+ .antMatchers("/v2/api-docs", "/code/*", "/api/*", "/appVersionInfo/queryByPlatform", "/uploadFile").permitAll().anyRequest().authenticated()
|
|
|
+ .and().httpBasic();
|
|
|
}
|
|
|
|
|
|
@Override
|