Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#Changelog
# Changelog

## 7.1.3 (2017-06-05)
### 修正
* cdn功能中获取域名日志列表的参数错误

## 7.1.2 (2017-03-24)
### 增加
Expand Down
29 changes: 0 additions & 29 deletions examples/pfop_ vframe.py

This file was deleted.

32 changes: 0 additions & 32 deletions examples/pfop_ watermark.py

This file was deleted.

2 changes: 1 addition & 1 deletion qiniu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# flake8: noqa

__version__ = '7.1.2'
__version__ = '7.1.3'

from .auth import Auth, QiniuMacAuth

Expand Down
14 changes: 3 additions & 11 deletions qiniu/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


# 上传策略,参数规格详见
# http://developer.qiniu.com/docs/v6/api/reference/security/put-policy.html
# https://developer.qiniu.com/kodo/manual/1206/put-policy
_policy_fields = set([
'callbackUrl', # 回调URL
'callbackBody', # 回调Body
Expand All @@ -37,19 +37,14 @@
'deleteAfterDays', # 文件多少天后自动删除
])

_deprecated_policy_fields = set([
'asyncOps'
])


class Auth(object):
"""七牛安全机制类

该类主要内容是七牛上传凭证、下载凭证、管理凭证三种凭证的签名接口的实现,以及回调验证。

Attributes:
__access_key: 账号密钥对中的accessKey,详见 https://portal.qiniu.com/setting/key
__secret_key: 账号密钥对重的secretKey,详见 https://portal.qiniu.com/setting/key
__access_key: 账号密钥对中的accessKey,详见 https://portal.qiniu.com/user/key
__secret_key: 账号密钥对重的secretKey,详见 https://portal.qiniu.com/user/key
"""

def __init__(self, access_key, secret_key):
Expand Down Expand Up @@ -178,8 +173,6 @@ def verify_callback(self, origin_authorization, url, body, content_type='applica
@staticmethod
def __copy_policy(policy, to, strict_policy):
for k, v in policy.items():
if k in _deprecated_policy_fields:
raise ValueError(k + ' has deprecated')
if (not strict_policy) or k in _policy_fields:
to[k] = v

Expand All @@ -189,7 +182,6 @@ def __init__(self, auth):
self.auth = auth

def __call__(self, r):
token = None
if r.body is not None and r.headers['Content-Type'] == 'application/x-www-form-urlencoded':
token = self.auth.token_of_request(r.url, r.body, 'application/x-www-form-urlencoded')
else:
Expand Down