yangys
2024-04-04 ed4a5236bab800094be4a8378f5098eebe3de6ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package com.qianwen.core.context.props;
 
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.springframework.boot.context.properties.ConfigurationProperties;
 
@ConfigurationProperties(BladeContextProperties.PREFIX)
/* loaded from: blade-core-context-9.3.0.0-SNAPSHOT.jar:org/springblade/core/context/props/BladeContextProperties.class */
public class BladeContextProperties {
    public static final String PREFIX = "blade.context";
    private Headers headers = new Headers();
 
    public void setHeaders(final Headers headers) {
        this.headers = headers;
    }
 
    public Headers getHeaders() {
        return this.headers;
    }
 
    /* loaded from: blade-core-context-9.3.0.0-SNAPSHOT.jar:org/springblade/core/context/props/BladeContextProperties$Headers.class */
    public static class Headers {
        private String requestId = "Blade-RequestId";
        private String accountId = "Blade-AccountId";
        private String tenantId = "Blade-TenantId";
        private List<String> allowed = Arrays.asList("X-Real-IP", "x-forwarded-for", "authorization", "Authorization", "Accept-Language", "accept-language", "Blade-Auth".toLowerCase(), "Blade-Auth");
 
        public void setRequestId(final String requestId) {
            this.requestId = requestId;
        }
 
        public void setAccountId(final String accountId) {
            this.accountId = accountId;
        }
 
        public void setTenantId(final String tenantId) {
            this.tenantId = tenantId;
        }
 
        public void setAllowed(final List<String> allowed) {
            this.allowed = allowed;
        }
 
        public String getRequestId() {
            return this.requestId;
        }
 
        public String getAccountId() {
            return this.accountId;
        }
 
        public String getTenantId() {
            return this.tenantId;
        }
 
        public List<String> getAllowed() {
            return this.allowed;
        }
    }
 
    public List<String> getCrossHeaders() {
        List<String> headerList = new ArrayList<>();
        headerList.add(this.headers.getRequestId());
        headerList.add(this.headers.getAccountId());
        headerList.add(this.headers.getTenantId());
        headerList.addAll(this.headers.getAllowed());
        return headerList;
    }
}