Closed dylanninin closed 8 years ago
https://github.com/qiniu/ruby-sdk/blob/master/lib/qiniu/auth.rb 中,在初始化 PutPolicy 时,只能传递 bucket, key, expires_in, deadline 等4个参数:
bucket
key
expires_in
deadline
class PutPolicy private def initialize(bucket, key = nil, expires_in = DEFAULT_AUTH_SECONDS, deadline = nil) ....
若有其他的 policy(如 mimeLimit),则须使用如下方式进行设置:
@put_policy = Qiniu::Auth::PutPolicy.new(bucket.name, nil, bucket.expires_in) @put_policy.mime_limit = Settings.qiniu.policy.mimeLimit
实际使用时可能有很多policy,这样逐一赋值很麻烦,是否考虑 PutPolicy 可以接收更多的参数呢?
参考:
收到,我们考虑下
https://github.com/qiniu/ruby-sdk/blob/master/lib/qiniu/auth.rb 中,在初始化 PutPolicy 时,只能传递
bucket
,key
,expires_in
,deadline
等4个参数:若有其他的 policy(如 mimeLimit),则须使用如下方式进行设置:
实际使用时可能有很多policy,这样逐一赋值很麻烦,是否考虑 PutPolicy 可以接收更多的参数呢?
参考: