Skip to content

自定义返回获取token时forceSaveKey参数不生效 #469

Open
@guanghuishan

Description

@guanghuishan

自定义返回获取token时使用函数Auth.uploadToken时forceSaveKey参数不生效
public String uploadToken(String bucket, String key, long expires, StringMap policy) {
return uploadToken(bucket, key, expires, policy, true);
}
因为最终调用的函数copyPolicy会过滤掉部分参数,forceSaveKey就回不生效。字段「白名单」policyFields并不包含该参数
private static void copyPolicy(final StringMap policy, StringMap originPolicy, final boolean strict) {
if (originPolicy == null) {
return;
}
originPolicy.forEach(new StringMap.Consumer() {
@OverRide
public void accept(String key, Object value) {
if (StringUtils.inStringArray(key, deprecatedPolicyFields)) {
throw new IllegalArgumentException(key + " is deprecated!");
}
if (!strict || StringUtils.inStringArray(key, policyFields)) {
policy.put(key, value);
}
}
});
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    no-action-neededThe issue is either fixed, addressed better by other issues, or just out of product scope.waiting-for-infoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions