fix(push): keep OPPO master secret server-side
这个提交包含在:
父节点
7de609a6b8
当前提交
37a34aad11
@ -85,13 +85,19 @@ public class SdkConfigController {
|
|||||||
JsonNode pushConfig;
|
JsonNode pushConfig;
|
||||||
if (rawPushConfig.has("vendors") && rawPushConfig.path("vendors").isObject()) {
|
if (rawPushConfig.has("vendors") && rawPushConfig.path("vendors").isObject()) {
|
||||||
com.fasterxml.jackson.databind.node.ObjectNode flat = objectMapper.createObjectNode();
|
com.fasterxml.jackson.databind.node.ObjectNode flat = objectMapper.createObjectNode();
|
||||||
rawPushConfig.path("vendors").fields().forEachRemaining(e -> flat.set(e.getKey(), e.getValue()));
|
rawPushConfig.path("vendors").fields().forEachRemaining(e -> flat.set(e.getKey(), e.getValue().deepCopy()));
|
||||||
if (rawPushConfig.has("profiles")) {
|
if (rawPushConfig.has("profiles")) {
|
||||||
flat.set("profiles", rawPushConfig.get("profiles"));
|
flat.set("profiles", rawPushConfig.get("profiles"));
|
||||||
}
|
}
|
||||||
pushConfig = flat;
|
pushConfig = flat;
|
||||||
} else {
|
} else {
|
||||||
pushConfig = rawPushConfig;
|
pushConfig = rawPushConfig.deepCopy();
|
||||||
|
}
|
||||||
|
// This endpoint is public and consumed by client SDKs. OPPO masterSecret is
|
||||||
|
// exclusively a server-side API credential; the Android SDK only needs appSecret.
|
||||||
|
if (pushConfig.isObject() && pushConfig.path("oppo").isObject()) {
|
||||||
|
((com.fasterxml.jackson.databind.node.ObjectNode) pushConfig.path("oppo"))
|
||||||
|
.remove("masterSecret");
|
||||||
}
|
}
|
||||||
boolean updateEnabled = deployProps.isEnableUpdate() && featureServiceRepository
|
boolean updateEnabled = deployProps.isEnableUpdate() && featureServiceRepository
|
||||||
.findByAppKeyAndPlatformAndServiceType(app.getAppKey(), platform, FeatureServiceEntity.ServiceType.UPDATE)
|
.findByAppKeyAndPlatformAndServiceType(app.getAppKey(), platform, FeatureServiceEntity.ServiceType.UPDATE)
|
||||||
|
|||||||
正在加载...
在新工单中引用
屏蔽一个用户