mirror of
https://github.com/wassname/flask-security.git
synced 2026-08-07 11:22:21 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
029466830d | ||
|
|
31595196fc | ||
|
|
2a0b582911 | ||
|
|
f8fbd6cec8 | ||
|
|
9d11dd0787 | ||
|
|
3a5a1b4f52 | ||
|
|
0724bd12a5 | ||
|
|
c7e3e642fa | ||
|
|
ee4c8f2a3f | ||
|
|
1092ffc9ea | ||
|
|
f4b6eb9869 |
@@ -3,6 +3,29 @@ Flask-Security Changelog
|
|||||||
|
|
||||||
Here you can see the full list of changes between each Flask-Security release.
|
Here you can see the full list of changes between each Flask-Security release.
|
||||||
|
|
||||||
|
|
||||||
|
Version 1.5.4
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Released January 6th 2013
|
||||||
|
|
||||||
|
- Fix bug in forms with `csrf_enabled` parameter not accounting attempts to login using JSON data
|
||||||
|
|
||||||
|
|
||||||
|
Version 1.5.3
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Released December 23rd 2012
|
||||||
|
|
||||||
|
- Change dependency requirement
|
||||||
|
|
||||||
|
Version 1.5.2
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Released December 11th 2012
|
||||||
|
|
||||||
|
- Fix a small bug in `flask_security.utils.login_user` method
|
||||||
|
|
||||||
Version 1.5.1
|
Version 1.5.1
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -49,7 +49,7 @@ copyright = u'2012, Matt Wright'
|
|||||||
# built documents.
|
# built documents.
|
||||||
#
|
#
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
version = '1.5.1'
|
version = '1.5.4'
|
||||||
# The full version, including alpha/beta/rc tags.
|
# The full version, including alpha/beta/rc tags.
|
||||||
release = version
|
release = version
|
||||||
|
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ Email
|
|||||||
``SECURITY_EMAIL_SUBJECT_CONFIRM`` Sets the subject for the email
|
``SECURITY_EMAIL_SUBJECT_CONFIRM`` Sets the subject for the email
|
||||||
confirmation message. Defaults to
|
confirmation message. Defaults to
|
||||||
``Please confirm your email``
|
``Please confirm your email``
|
||||||
|
=========================================== ====================================
|
||||||
|
|
||||||
Miscellaneous
|
Miscellaneous
|
||||||
-------------
|
-------------
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
:license: MIT, see LICENSE for more details.
|
:license: MIT, see LICENSE for more details.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__version__ = '1.5.1'
|
__version__ = '1.5.4'
|
||||||
|
|
||||||
from .core import Security, RoleMixin, UserMixin, AnonymousUser, current_user
|
from .core import Security, RoleMixin, UserMixin, AnonymousUser, current_user
|
||||||
from .datastore import SQLAlchemyUserDatastore, MongoEngineUserDatastore
|
from .datastore import SQLAlchemyUserDatastore, MongoEngineUserDatastore
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ def generate_confirmation_token(user):
|
|||||||
|
|
||||||
:param user: The user to work with
|
:param user: The user to work with
|
||||||
"""
|
"""
|
||||||
data = [user.id, md5(user.email)]
|
data = [str(user.id), md5(user.email)]
|
||||||
return _security.confirm_serializer.dumps(data)
|
return _security.confirm_serializer.dumps(data)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,11 @@ def valid_user_email(form, field):
|
|||||||
|
|
||||||
class Form(BaseForm):
|
class Form(BaseForm):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
kwargs.setdefault('csrf_enabled', not current_app.testing)
|
if current_app.testing:
|
||||||
|
csrf_enabled = False
|
||||||
|
else:
|
||||||
|
csrf_enabled = request.json is None
|
||||||
|
kwargs.setdefault('csrf_enabled', csrf_enabled)
|
||||||
super(Form, self).__init__(*args, **kwargs)
|
super(Form, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ def generate_login_token(user):
|
|||||||
|
|
||||||
:param user: The user the token belongs to
|
:param user: The user the token belongs to
|
||||||
"""
|
"""
|
||||||
return _security.login_serializer.dumps([user.id])
|
return _security.login_serializer.dumps([str(user.id)])
|
||||||
|
|
||||||
|
|
||||||
def login_token_status(token):
|
def login_token_status(token):
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ def generate_reset_password_token(user):
|
|||||||
|
|
||||||
:param user: The user to work with
|
:param user: The user to work with
|
||||||
"""
|
"""
|
||||||
data = [user.id, md5(user.password)]
|
data = [str(user.id), md5(user.password)]
|
||||||
return _security.reset_serializer.dumps(data)
|
return _security.reset_serializer.dumps(data)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+11
-9
@@ -38,23 +38,25 @@ _pwd_context = LocalProxy(lambda: _security.pwd_context)
|
|||||||
def login_user(user, remember=True):
|
def login_user(user, remember=True):
|
||||||
"""Performs the login and sends the appropriate signal."""
|
"""Performs the login and sends the appropriate signal."""
|
||||||
|
|
||||||
_login_user(user, remember)
|
if not _login_user(user, remember):
|
||||||
|
return False
|
||||||
|
|
||||||
if _security.trackable:
|
if _security.trackable:
|
||||||
old_current, new_current = user.current_login_at, datetime.utcnow()
|
old_current_login, new_current_login = user.current_login_at, datetime.utcnow()
|
||||||
user.last_login_at = old_current or new_current
|
|
||||||
user.current_login_at = new_current
|
|
||||||
|
|
||||||
remote_addr = request.remote_addr or 'untrackable'
|
remote_addr = request.remote_addr or 'untrackable'
|
||||||
old_current, new_current = user.current_login_ip, remote_addr
|
old_current_ip, new_current_ip = user.current_login_ip, remote_addr
|
||||||
user.last_login_ip = old_current or new_current
|
|
||||||
user.current_login_ip = new_current
|
|
||||||
|
|
||||||
|
user.last_login_at = old_current_login or new_current_login
|
||||||
|
user.current_login_at = new_current_login
|
||||||
|
user.last_login_ip = old_current_ip or new_current_ip
|
||||||
|
user.current_login_ip = new_current_ip
|
||||||
user.login_count = user.login_count + 1 if user.login_count else 1
|
user.login_count = user.login_count + 1 if user.login_count else 1
|
||||||
|
|
||||||
_datastore.put(user)
|
_datastore.put(user)
|
||||||
|
|
||||||
identity_changed.send(current_app._get_current_object(),
|
identity_changed.send(current_app._get_current_object(),
|
||||||
identity=Identity(user.id))
|
identity=Identity(user.id))
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def logout_user():
|
def logout_user():
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ from setuptools import setup
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='Flask-Security',
|
name='Flask-Security',
|
||||||
version='1.5.1',
|
version='1.5.4',
|
||||||
url='https://github.com/mattupstate/flask-security',
|
url='https://github.com/mattupstate/flask-security',
|
||||||
license='MIT',
|
license='MIT',
|
||||||
author='Matt Wright',
|
author='Matt Wright',
|
||||||
@@ -35,12 +35,12 @@ setup(
|
|||||||
platforms='any',
|
platforms='any',
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'Flask>=0.8',
|
'Flask>=0.8',
|
||||||
'Flask-Login==0.1.3',
|
'Flask-Login>=0.1.3',
|
||||||
'Flask-Mail==0.7.3',
|
'Flask-Mail>=0.7.3',
|
||||||
'Flask-Principal==0.3.3',
|
'Flask-Principal>=0.3.3',
|
||||||
'Flask-WTF==0.8',
|
'Flask-WTF>=0.8',
|
||||||
'itsdangerous==0.17',
|
'itsdangerous>=0.17',
|
||||||
'passlib==1.6.1',
|
'passlib>=1.6.1',
|
||||||
],
|
],
|
||||||
test_suite='nose.collector',
|
test_suite='nose.collector',
|
||||||
tests_require=[
|
tests_require=[
|
||||||
|
|||||||
Reference in New Issue
Block a user