Skip to content

Commit 9bd08d3

Browse files
author
liyan.90210
committed
feat auto update sdk
1 parent 4c2b03f commit 9bd08d3

151 files changed

Lines changed: 6345 additions & 260 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Changelog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Change log
22

3+
2026-05-28 Bumped to version v1.0.272
4+
- Updated apis for cdn/tls/vikingDB
5+
36
2026-05-21 Bumped to version v1.0.271
47
- Updated apis for sdk
58

volc-sdk-java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.volcengine</groupId>
7-
<version>1.0.271</version>
7+
<version>1.0.272</version>
88
<artifactId>volc-sdk-java</artifactId>
99

1010
<name>volc-sdk-java</name>

volc-sdk-java/src/main/java/com/volcengine/http/HttpClientFactory.java

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
import org.apache.http.client.config.RequestConfig;
99
import org.apache.http.client.protocol.HttpClientContext;
1010
import org.apache.http.conn.ConnectionKeepAliveStrategy;
11+
import org.apache.http.conn.HttpClientConnectionManager;
1112
import org.apache.http.impl.client.HttpClients;
13+
import org.apache.http.impl.client.HttpClientBuilder;
1214
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
1315
import org.apache.http.message.BasicHeaderElementIterator;
1416
import org.apache.http.protocol.HTTP;
@@ -51,21 +53,33 @@ public static ClientInstance create(ClientConfiguration configuration, HttpHost
5153
int maxConPerRoute = configuration.getMaxConPerRoute();
5254
connectionManager.setMaxTotal(maxCon);
5355
connectionManager.setDefaultMaxPerRoute(maxConPerRoute);
56+
return create(configuration, proxy, connectionManager);
57+
}
58+
59+
public static ClientInstance create(ClientConfiguration configuration, HttpHost proxy,
60+
HttpClientConnectionManager connectionManager) {
61+
return create(configuration, proxy, connectionManager, false);
62+
}
5463

64+
public static ClientInstance create(ClientConfiguration configuration, HttpHost proxy,
65+
HttpClientConnectionManager connectionManager,
66+
boolean disableContentCompression) {
5567
ConnectionKeepAliveStrategy strategy;
5668
if (connectionKeepAliveStrategy != null) {
5769
strategy = connectionKeepAliveStrategy;
5870
} else {
5971
strategy = getConnectionKeepAliveStrategy();
6072
}
61-
HttpClient httpClient;
62-
httpClient = HttpClients.custom()
73+
HttpClientBuilder builder = HttpClients.custom()
6374
.setConnectionManager(connectionManager)
6475
.setKeepAliveStrategy(strategy)
6576
.setRetryHandler(httpRequestRetryHandler)
6677
.setDefaultRequestConfig(RequestConfig.custom().setStaleConnectionCheckEnabled(true).build())
67-
.setProxy(proxy)
68-
.build();
78+
.setProxy(proxy);
79+
if (disableContentCompression) {
80+
builder.disableContentCompression();
81+
}
82+
HttpClient httpClient = builder.build();
6983

7084
IdleConnectionMonitorThread daemonThread = new IdleConnectionMonitorThread(connectionManager);
7185
daemonThread.setDaemon(true);

volc-sdk-java/src/main/java/com/volcengine/model/beans/livesaas/RuleResult.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ public class RuleResult {
1313

1414
@JSONField(name = "Reason")
1515
String reason;
16+
17+
@JSONField(name = "ViolationAnnotatedURL")
18+
String ViolationAnnotatedURL;
1619
}

volc-sdk-java/src/main/java/com/volcengine/model/livesaas/request/ListActivityLibAPIRequest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,6 @@ public class ListActivityLibAPIRequest {
2626
Long FolderId;
2727
@JSONField(name = "IncludeSubFolder")
2828
Boolean IncludeSubFolder;
29+
@JSONField(name = "IsCloseDated")
30+
Boolean IsCloseDated;
2931
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.volcengine.model.tls;
2+
3+
import com.alibaba.fastjson.annotation.JSONField;
4+
import lombok.Data;
5+
import lombok.NoArgsConstructor;
6+
7+
import static com.volcengine.model.tls.Const.*;
8+
9+
@Data
10+
@NoArgsConstructor
11+
public class AppInstanceInfo {
12+
@JSONField(name = APP_INSTANCE_ID)
13+
private String instanceId;
14+
@JSONField(name = APP_INSTANCE_NAME)
15+
private String instanceName;
16+
@JSONField(name = APP_INSTANCE_TYPE)
17+
private String instanceType;
18+
@JSONField(name = DESCRIPTION)
19+
private String description;
20+
@JSONField(name = CREATE_TIME)
21+
private String createTime;
22+
@JSONField(name = UPDATE_TIME)
23+
private String updateTime;
24+
}
Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
package com.volcengine.model.tls;
2+
3+
import com.alibaba.fastjson.annotation.JSONField;
4+
import lombok.Data;
5+
import lombok.NoArgsConstructor;
6+
7+
import java.util.List;
8+
9+
import static com.volcengine.model.tls.Const.*;
10+
11+
/**
12+
* AppSceneMeta 相关的请求/响应内嵌结构聚合文件。
13+
*/
14+
public class AppSceneMetaInfo {
15+
16+
@Data
17+
@NoArgsConstructor
18+
public static class ClusterStoreMeta {
19+
@JSONField(name = CLUSTER_STORE_NAME)
20+
private String clusterStoreName;
21+
@JSONField(name = DESCRIPTION)
22+
private String description;
23+
}
24+
25+
@Data
26+
@NoArgsConstructor
27+
public static class ClusterInfo {
28+
@JSONField(name = CLUSTER_ID)
29+
private String clusterId;
30+
@JSONField(name = CLUSTER_PATTERN)
31+
private String clusterPattern;
32+
@JSONField(name = TAGS)
33+
private Object tags;
34+
}
35+
36+
@Data
37+
@NoArgsConstructor
38+
public static class FeedBackMeta {
39+
@JSONField(name = SESSION_ID)
40+
private String sessionId;
41+
@JSONField(name = MESSAGE_ID)
42+
private String messageId;
43+
@JSONField(name = FEED_BACK_TYPE)
44+
private String feedBackType;
45+
@JSONField(name = AI_ASSISTANT_FEATURE)
46+
private Integer aiAssistantFeature;
47+
}
48+
49+
@Data
50+
@NoArgsConstructor
51+
public static class KnowledgeBindingMeta {
52+
@JSONField(name = KNOWLEDGE_RESOURCE_ID)
53+
private String knowledgeResourceId;
54+
@JSONField(name = KNOWLEDGE_NAME)
55+
private String knowledgeName;
56+
@JSONField(name = PROJECT_FIELD)
57+
private String project;
58+
@JSONField(name = ENDPOINT)
59+
private String endpoint;
60+
}
61+
62+
@Data
63+
@NoArgsConstructor
64+
public static class MetaRecord {
65+
@JSONField(name = CLUSTER_STORE_META)
66+
private ClusterStoreMeta clusterStoreMeta;
67+
@JSONField(name = CLUSTERS_INFOS)
68+
private List<ClusterInfo> clustersInfos;
69+
@JSONField(name = FEED_BACK_META)
70+
private FeedBackMeta feedBackMeta;
71+
@JSONField(name = KNOWLEDGE_BINDING_META)
72+
private KnowledgeBindingMeta knowledgeBindingMeta;
73+
}
74+
75+
@Data
76+
@NoArgsConstructor
77+
public static class DescribeClusterStoreMeta {
78+
@JSONField(name = CLUSTER_STORE_ID)
79+
private String clusterStoreId;
80+
@JSONField(name = CLUSTER_STORE_NAME)
81+
private String clusterStoreName;
82+
@JSONField(name = DESCRIPTION)
83+
private String description;
84+
@JSONField(name = CREATE_TIME)
85+
private String createTime;
86+
@JSONField(name = MATCH_JOB_NUMS)
87+
private long matchJobNums;
88+
@JSONField(name = TOPIC_NAME)
89+
private String topicName;
90+
@JSONField(name = TOPIC_ID)
91+
private String topicId;
92+
@JSONField(name = PROJECT_NAME)
93+
private String projectName;
94+
@JSONField(name = PROJECT_ID)
95+
private String projectId;
96+
}
97+
98+
@Data
99+
@NoArgsConstructor
100+
public static class DescribeClusterMeta {
101+
@JSONField(name = CLUSTER_ID)
102+
private String clusterId;
103+
@JSONField(name = PATTERN)
104+
private String pattern;
105+
@JSONField(name = TAGS)
106+
private Object tags;
107+
@JSONField(name = SOURCE)
108+
private String source;
109+
@JSONField(name = JOB_NAME)
110+
private String jobName;
111+
@JSONField(name = JOB_ID)
112+
private String jobId;
113+
}
114+
115+
@Data
116+
@NoArgsConstructor
117+
public static class DescribeSessionMeta {
118+
@JSONField(name = SESSION_ID)
119+
private String sessionId;
120+
@JSONField(name = TITLE)
121+
private String title;
122+
@JSONField(name = CREATE_TIME)
123+
private String createTime;
124+
@JSONField(name = UPDATE_TIME)
125+
private String updateTime;
126+
}
127+
128+
@Data
129+
@NoArgsConstructor
130+
public static class DescribeKnowledgeBinding {
131+
@JSONField(name = BINDING_ID)
132+
private String bindingId;
133+
@JSONField(name = KNOWLEDGE_RESOURCE_ID)
134+
private String knowledgeResourceId;
135+
@JSONField(name = KNOWLEDGE_NAME)
136+
private String knowledgeName;
137+
@JSONField(name = PROJECT_FIELD)
138+
private String project;
139+
@JSONField(name = ENDPOINT)
140+
private String endpoint;
141+
@JSONField(name = CREATE_TIME)
142+
private String createTime;
143+
@JSONField(name = UPDATE_TIME)
144+
private String updateTime;
145+
}
146+
147+
@Data
148+
@NoArgsConstructor
149+
public static class MultiMessagePart {
150+
@JSONField(name = TYPE)
151+
private Integer type;
152+
@JSONField(name = TEXT)
153+
private String text;
154+
@JSONField(name = SHORT_NAME)
155+
private String shortName;
156+
@JSONField(name = TEXT_URI)
157+
private String textURI;
158+
}
159+
160+
@Data
161+
@NoArgsConstructor
162+
public static class DescribeSessionMessage {
163+
@JSONField(name = MESSAGE_ID)
164+
private String messageId;
165+
@JSONField(name = CREATED_TIME_STAMP)
166+
private String createdTimeStamp;
167+
@JSONField(name = SESSION_MESSAGE_TYPE)
168+
private String sessionMessageType;
169+
@JSONField(name = MSG_STATUS)
170+
private String msgStatus;
171+
@JSONField(name = MESSAGES)
172+
private List<String> messages;
173+
@JSONField(name = PASS_DETECT)
174+
private boolean passDetect;
175+
@JSONField(name = REASONING_CONTENT)
176+
private String reasoningContent;
177+
@JSONField(name = MULTI_CONTENT)
178+
private List<MultiMessagePart> multiContent;
179+
@JSONField(name = CONVERSATION_MESSAGE_TYPE)
180+
private String conversationMessageType;
181+
}
182+
183+
@Data
184+
@NoArgsConstructor
185+
public static class DescribeAppSceneMetasRes {
186+
@JSONField(name = DESCRIBE_CLUSTER_STORE_META)
187+
private DescribeClusterStoreMeta describeClusterStoreMeta;
188+
@JSONField(name = DESCRIBE_CLUSTER_META)
189+
private DescribeClusterMeta describeClusterMeta;
190+
@JSONField(name = DESCRIBE_SESSION_META)
191+
private DescribeSessionMeta describeSessionMeta;
192+
@JSONField(name = DESCRIBE_SESSION_MESSAGE)
193+
private List<DescribeSessionMessage> describeSessionMessage;
194+
@JSONField(name = DESCRIBE_SESSION_SUGGESTION)
195+
private String describeSessionSuggestion;
196+
@JSONField(name = DESCRIBE_KNOWLEDGE_BINDING)
197+
private DescribeKnowledgeBinding describeKnowledgeBinding;
198+
}
199+
}

volc-sdk-java/src/main/java/com/volcengine/model/tls/ClientBuilder.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.volcengine.service.tls.TLSHttpUtil;
66
import com.volcengine.service.tls.TLSLogClient;
77
import com.volcengine.service.tls.TLSLogClientImpl;
8+
import com.volcengine.service.tls.TLSUtil;
89
import org.apache.commons.lang3.StringUtils;
910
import org.apache.commons.logging.Log;
1011
import org.apache.commons.logging.LogFactory;
@@ -82,8 +83,12 @@ public static TLSLogClient newClient(ClientConfig config) throws LogException {
8283
tlsHttpUtil.setApiKey(config.getApiKey());
8384
tlsHttpUtil.setSocketTimeout(SOCKET_TIMEOUT_MS);
8485
tlsHttpUtil.setConnectionTimeout(CONNECTION_TIMEOUT_MS);
86+
if (config.isVerifySsl()) {
87+
tlsHttpUtil.setHttpClientConnectionManager(TLSUtil.createHttpClientConnectionManager(true));
88+
}
8589

86-
return new TLSLogClientImpl(tlsHttpUtil, config);
90+
TLSLogClientImpl client = new TLSLogClientImpl(tlsHttpUtil, config);
91+
return client;
8792
}
8893

8994
}

volc-sdk-java/src/main/java/com/volcengine/model/tls/ClientConfig.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ public class ClientConfig {
2525
RetryPolicy retryPolicy;
2626
RetryDecider retryDecider;
2727
boolean localValidationOnly;
28+
/**
29+
* HTTPS 证书校验开关,默认 {@code false}(保持 Producer/Consumer 自定义连接池的 trust-all 兼容入口)。
30+
*
31+
* <p><b>安全提示</b>:Producer/Consumer 会将该开关传给 {@code TLSUtil};公网 / 生产环境必须显式
32+
* {@code setVerifySsl(true)},启用 JDK 默认安全栈进行证书与主机名校验,防御中间人攻击。
33+
*
34+
* <p>L4-D2:TLSUtil 原默认行为接受任意证书 / 跳过主机名校验,违反 CWE-295 / CWE-297;
35+
* 收紧默认会影响存量自签 / 私有 CA 用户,故本次修复仅暴露开关,由调用方显式 opt-in。
36+
*/
37+
private boolean verifySsl = false;
2838

2939
public ClientConfig(String endPoint, String region, String accessKeyId, String accessKeySecret,
3040
String securityToken) {

0 commit comments

Comments
 (0)