Skip to content

Commit

Permalink
Merge pull request qiniu#265 from jemygraw/master
Browse files Browse the repository at this point in the history
publish version 7.1.3
  • Loading branch information
jemygraw authored Jun 5, 2017
2 parents fccfbb0 + 1bb4cd7 commit fdf85a8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 74 deletions.
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

0 comments on commit fdf85a8

Please sign in to comment.