[+]
This commit is contained in:
@@ -25,6 +25,11 @@ import lombok.extern.slf4j.Slf4j;
|
||||
@Slf4j
|
||||
public class SecurityInterceptor extends InterceptorAdapter {
|
||||
|
||||
/**
|
||||
* Basic认证
|
||||
*/
|
||||
private static final String BASIC = "Basic";
|
||||
|
||||
private AntPathMatcher matcher = new AntPathMatcher();
|
||||
|
||||
@Autowired
|
||||
@@ -89,10 +94,10 @@ public class SecurityInterceptor extends InterceptorAdapter {
|
||||
if(StringUtils.isEmpty(authorization)) {
|
||||
return false;
|
||||
}
|
||||
if(!StringUtils.startsWithIgnoreCase(authorization, SecurityProperties.BASIC)) {
|
||||
if(!StringUtils.startsWithIgnoreCase(authorization, BASIC)) {
|
||||
return false;
|
||||
}
|
||||
authorization = authorization.substring(SecurityProperties.BASIC.length()).strip();
|
||||
authorization = authorization.substring(BASIC.length()).strip();
|
||||
authorization = new String(Base64.getDecoder().decode(authorization));
|
||||
final int index = authorization.indexOf(':');
|
||||
if(index < 0) {
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.springframework.context.annotation.ComponentScan;
|
||||
public class TaoyaoApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.getProperties().setProperty("jdk.internal.httpclient.disableHostnameVerification", Boolean.TRUE.toString());
|
||||
SpringApplication.run(TaoyaoApplication.class, args);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
taoyao:
|
||||
webrtc:
|
||||
mediasoup-list:
|
||||
- name: mediasoup-local-a
|
||||
enabled: true
|
||||
host: 192.168.8.110
|
||||
port: 4443
|
||||
schema: wss
|
||||
username: taoyao
|
||||
password: taoyao
|
||||
security:
|
||||
permit: /v3/api-docs/**,/swagger-ui/**,/swagger-ui.html,/,/error,/index.html,/favicon.ico
|
||||
|
||||
permit: /v3/api-docs/**,/swagger-ui/**,/swagger-ui.html,/,/error,/index.html,/favicon.ico
|
||||
@@ -111,19 +111,17 @@ taoyao:
|
||||
# 媒体配置
|
||||
mediasoup-list:
|
||||
- name: mediasoup-local-a
|
||||
enabled: true
|
||||
host: localhost
|
||||
#host: 192.168.8.110
|
||||
port: 4443
|
||||
schema: wss
|
||||
websocket: /websocket.signal
|
||||
username: taoyao
|
||||
password: taoyao
|
||||
- name: mediasoup-local-z
|
||||
enabled: true
|
||||
host: localhost
|
||||
#host: 192.168.8.110
|
||||
port: 4443
|
||||
schema: wss
|
||||
websocket: /websocket.signal
|
||||
username: taoyao
|
||||
password: taoyao
|
||||
# 安全配置
|
||||
@@ -135,7 +133,7 @@ taoyao:
|
||||
password: taoyao
|
||||
# 定时任务
|
||||
scheduled:
|
||||
session: 0 * * * * ?
|
||||
client: 0 * * * * ?
|
||||
# 集群配置
|
||||
node:
|
||||
enabled: false
|
||||
|
||||
Reference in New Issue
Block a user