[Python-modules-commits] [flask-security] 02/09: Import Debian changes 1.7.5-1~1
Christoph Berg
myon at debian.org
Wed Nov 29 15:01:26 UTC 2017
This is an automated email from the git hooks/post-receive script.
myon pushed a commit to branch debian/master
in repository flask-security.
commit 25208c1a21f7bbaa56e564fb375b8040f4af3849
Author: Adrian Vondendriesch <adrian.vondendriesch at credativ.de>
Date: Wed May 31 10:43:39 2017 +0200
Import Debian changes 1.7.5-1~1
flask-security (1.7.5-1~1) unstable; urgency=low
* Initial package version.
---
debian/.git-dpm | 11 ++++
debian/changelog | 5 ++
debian/compat | 1 +
debian/control | 56 ++++++++++++++++
debian/copyright | 13 ++++
...oken-loader-with-request-loader-to-fix-81.patch | 75 ++++++++++++++++++++++
debian/patches/series | 1 +
debian/rules | 8 +++
debian/source/format | 1 +
debian/watch | 4 ++
10 files changed, 175 insertions(+)
diff --git a/debian/.git-dpm b/debian/.git-dpm
new file mode 100644
index 0000000..7a8ff39
--- /dev/null
+++ b/debian/.git-dpm
@@ -0,0 +1,11 @@
+# see git-dpm(1) from git-dpm package
+5287a8bcf7faca6f16ba895f5118bf0684e9346d
+5287a8bcf7faca6f16ba895f5118bf0684e9346d
+ec79ed2fb47523be76693caebbd86d5e9e942bc3
+ec79ed2fb47523be76693caebbd86d5e9e942bc3
+flask-security_1.7.5.orig.tar.gz
+7962f133fa471e9c6b9e7af9cdead4407eb1ba57
+42261
+debianTag="debian/%e%v"
+patchedTag="patched/%e%v"
+upstreamTag="upstream/%e%u"
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..9b391d1
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+flask-security (1.7.5-1~1) unstable; urgency=low
+
+ * Initial package version.
+
+ -- Adrian Vondendriesch <adrian.vondendriesch at credativ.de> Wed, 31 May 2017 10:43:39 +0200
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..9415bf1
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,56 @@
+Source: flask-security
+Maintainer: Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>
+Uploaders: Adrian Vondendriesch <adrian.vondendriesch at credativ.de>
+Section: python
+Priority: optional
+Build-Depends: debhelper (>= 9),
+ dh-python,
+ python-setuptools (>= 0.6b3),
+ python3-all,
+ python3-bcrypt,
+ python3-flask-login,
+ python3-flask-mail,
+ python3-flask-mongoengine,
+ python3-flask-peewee,
+ python3-flask-principal,
+ python3-flask-sqlalchemy,
+ python3-flaskext.wtf,
+ python3-passlib,
+ python3-peewee,
+ python3-pymongo,
+ python3-pytest,
+ python3-pytest-cov,
+ python3-pytest-pep8,
+ python3-setuptools,
+ tox,
+ mongodb
+Standards-Version: 3.9.8
+Homepage: https://github.com/mattupstate/flask-security
+
+Package: python3-flask-security
+Architecture: all
+Depends: python3-flask,
+ python3-flask-login,
+ python3-flask-mail,
+ python3-flask-principal,
+ python3-flaskext.wtf,
+ python3-itsdangerous,
+ python3-passlib,
+ ${misc:Depends},
+ ${python3:Depends}
+Description: Simple security for Flask apps (Python 3)
+ Flask-Security allows you to quickly add common security mechanisms
+ to your Flask application. They include:
+ .
+ * Session based authentication
+ * Role management
+ * Password encryption
+ * Basic HTTP authentication
+ * Token based authentication
+ * Token based account activation (optional)
+ * Token based password recovery / resetting (optional)
+ * User registration (optional)
+ * Login tracking (optional)
+ * JSON/Ajax Support
+ .
+ This is the Python 3 version of the package.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..221082f
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,13 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: Flask-Security
+Upstream-Contact: Matt Wright <matt+github at nobien.net>
+Source: https://github.com/mattupstate/flask-security
+
+Files: *
+Copyright: 2012 Matt Wright <matt+github at nobien.net>
+License: UNKNOWN
+ FIXME
+
+Files: debian/*
+Copyright: 2017
+License: UNKNOWN
diff --git a/debian/patches/0001-replace-token-loader-with-request-loader-to-fix-81.patch b/debian/patches/0001-replace-token-loader-with-request-loader-to-fix-81.patch
new file mode 100644
index 0000000..919cbb3
--- /dev/null
+++ b/debian/patches/0001-replace-token-loader-with-request-loader-to-fix-81.patch
@@ -0,0 +1,75 @@
+From 5287a8bcf7faca6f16ba895f5118bf0684e9346d Mon Sep 17 00:00:00 2001
+From: Alan Hamlett <alan.hamlett at gmail.com>
+Date: Thu, 27 Oct 2016 15:04:07 +0200
+Subject: replace token loader with request loader to fix #81
+
+---
+ flask_security/core.py | 12 ++++++++++--
+ flask_security/decorators.py | 10 +---------
+ tests/test_common.py | 2 +-
+ 3 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/flask_security/core.py b/flask_security/core.py
+index eec3092..398f647 100644
+--- a/flask_security/core.py
++++ b/flask_security/core.py
+@@ -191,7 +191,15 @@ def _user_loader(user_id):
+ return _security.datastore.find_user(id=user_id)
+
+
+-def _token_loader(token):
++def _request_loader(request):
++ header_key = _security.token_authentication_header
++ args_key = _security.token_authentication_key
++ header_token = request.headers.get(header_key, None)
++ token = request.args.get(args_key, header_token)
++ if request.get_json(silent=True):
++ if not isinstance(request.json, list):
++ token = request.json.get(args_key, token)
++
+ try:
+ data = _security.remember_token_serializer.loads(token, max_age=_security.token_max_age)
+ user = _security.datastore.find_user(id=data[0])
+@@ -223,7 +231,7 @@ def _get_login_manager(app, anonymous_user):
+ lm.anonymous_user = anonymous_user or AnonymousUser
+ lm.login_view = '%s.login' % cv('BLUEPRINT_NAME', app=app)
+ lm.user_loader(_user_loader)
+- lm.token_loader(_token_loader)
++ lm.request_loader(_request_loader)
+
+ if cv('FLASH_MESSAGES', app=app):
+ lm.login_message, lm.login_message_category = cv('MSG_LOGIN', app=app)
+diff --git a/flask_security/decorators.py b/flask_security/decorators.py
+index a28656d..27bb95c 100644
+--- a/flask_security/decorators.py
++++ b/flask_security/decorators.py
+@@ -47,15 +47,7 @@ def _get_unauthorized_view():
+
+
+ def _check_token():
+- header_key = _security.token_authentication_header
+- args_key = _security.token_authentication_key
+- header_token = request.headers.get(header_key, None)
+- token = request.args.get(args_key, header_token)
+- if request.get_json(silent=True):
+- if not isinstance(request.json, list):
+- token = request.json.get(args_key, token)
+-
+- user = _security.login_manager.token_callback(token)
++ user = _security.login_manager.request_callback(request)
+
+ if user and user.is_authenticated:
+ app = current_app._get_current_object()
+diff --git a/tests/test_common.py b/tests/test_common.py
+index e884ab5..531090f 100644
+--- a/tests/test_common.py
++++ b/tests/test_common.py
+@@ -271,7 +271,7 @@ def test_remember_token(client):
+ assert b'profile' in response.data
+
+
+-def test_token_loader_does_not_fail_with_invalid_token(client):
++def test_request_loader_does_not_fail_with_invalid_token(client):
+ c = Cookie(version=0, name='remember_token', value='None', port=None,
+ port_specified=False, domain='www.example.com',
+ domain_specified=False, domain_initial_dot=False, path='/',
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..dbde0ee
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-replace-token-loader-with-request-loader-to-fix-81.patch
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..08b4286
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,8 @@
+#!/usr/bin/make -f
+
+export PYBUILD_NAME=flask-security
+%:
+ dh $@ --with python3 --buildsystem=pybuild
+
+override_dh_auto_test:
+ # Skip for now
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..d1888c9
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,4 @@
+# please also check http://pypi.debian.net/Flask-Security/watch
+version=3
+opts=uversionmangle=s/(rc|a|b|c)/~$1/ \
+http://pypi.debian.net/Flask-Security/Flask-Security-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))
\ No newline at end of file
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/flask-security.git
More information about the Python-modules-commits
mailing list