pub fn build_put_policy(
bucket: &str,
region: &str,
object_key: &str,
max_bytes: u64,
) -> ApiResult<Policy>Expand description
构建 PutObject 权限策略
限定仅允许对指定对象执行 PUT 上传,且文件大小不超过 max_bytes。
§参数
bucket: COS 存储桶名(含 appId)region: COS 区域,如"ap-guangzhou"object_key: 对象 Key(上传路径)max_bytes: 允许的最大文件字节数
§返回值
返回 COS 策略对象,可直接传入 get_federation_token。