From de0b4ddc99246dc91740349633dd48eea2a6141b Mon Sep 17 00:00:00 2001 From: Curtis Castrapel Date: Tue, 20 Mar 2018 15:43:25 -0700 Subject: [PATCH 1/4] unpin flask in requirements.in --- requirements.in | 2 +- requirements.txt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/requirements.in b/requirements.in index 4f08d318..5e283b4b 100644 --- a/requirements.in +++ b/requirements.in @@ -1,6 +1,6 @@ Flask==0.12 Flask-RESTful==0.3.6 -Flask-SQLAlchemy==2.1 +Flask-SQLAlchemy>2,<3 Flask-Script==2.0.6 Flask-Migrate==2.1.1 Flask-Bcrypt==0.7.1 diff --git a/requirements.txt b/requirements.txt index abc6ed54..68c83090 100644 --- a/requirements.txt +++ b/requirements.txt @@ -134,8 +134,9 @@ flask-restful==0.3.6 \ --hash=sha256:e2f1b8063de3944b94c7f8be5cee4d2161db0267c54c5b757d875295061776fa flask-script==2.0.6 \ --hash=sha256:6425963d91054cfcc185807141c7314a9c5ad46325911bd24dcb489bd0161c65 -flask-sqlalchemy==2.1 \ - --hash=sha256:c5244de44cc85d2267115624d83faef3f9e8f088756788694f305a5d5ad137c5 +flask-sqlalchemy==2.3.2 \ + --hash=sha256:3bc0fac969dd8c0ace01b32060f0c729565293302f0c4269beed154b46bec50b \ + --hash=sha256:5971b9852b5888655f11db634e87725a9031e170f37c0ce7851cf83497f56e53 flask==0.12 \ --hash=sha256:7f03bb2c255452444f7265eddb51601806e5447b6f8a2d50bbc77a654a14c118 \ --hash=sha256:93e803cdbe326a61ebd5c5d353959397c85f829bec610d59cb635c9f97d7ca8b From 48d9a3ec8a06a6157431f8e80c8b188af220c829 Mon Sep 17 00:00:00 2001 From: cjwaian Date: Tue, 20 Mar 2018 16:54:30 -0700 Subject: [PATCH 2/4] Remove non-ASCII character (#1104) --- lemur/common/defaults.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lemur/common/defaults.py b/lemur/common/defaults.py index bb49c5b7..3eba7be0 100644 --- a/lemur/common/defaults.py +++ b/lemur/common/defaults.py @@ -10,7 +10,7 @@ from lemur.constants import SAN_NAMING_TEMPLATE, DEFAULT_NAMING_TEMPLATE def text_to_slug(value): """Normalize a string to a "slug" value, stripping character accents and removing non-alphanum characters.""" - # Strip all character accents (รค => a): decompose Unicode characters and then drop combining chars. + # Strip all character accents: decompose Unicode characters and then drop combining chars. value = ''.join(c for c in unicodedata.normalize('NFKD', value) if not unicodedata.combining(c)) # Replace all remaining non-alphanumeric characters with '-'. Multiple characters get collapsed into a single dash. From 08f66df8606a3d1f2624f68663199caac7927d04 Mon Sep 17 00:00:00 2001 From: iTitou Date: Wed, 21 Mar 2018 16:14:54 +0100 Subject: [PATCH 3/4] [fix] No internal server error when trying to Google Auth an unregistered user (#1109) --- lemur/auth/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lemur/auth/views.py b/lemur/auth/views.py index ce38d5d8..60f4e246 100644 --- a/lemur/auth/views.py +++ b/lemur/auth/views.py @@ -433,7 +433,7 @@ class Google(Resource): user = user_service.get_by_email(profile['email']) - if not user.active: + if not (user and user.active): metrics.send('login', 'counter', 1, metric_tags={'status': FAILURE_METRIC_STATUS}) return dict(message='The supplied credentials are invalid.'), 403 From d44a1934feb822ee16dcf53aa7cd85d59b4afc34 Mon Sep 17 00:00:00 2001 From: Curtis Castrapel Date: Wed, 21 Mar 2018 10:29:08 -0700 Subject: [PATCH 4/4] Update auth keys, change python version to satisfy tests --- lemur/tests/vectors.py | 4 ++-- requirements-dev.txt | 10 +++++----- requirements.in | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lemur/tests/vectors.py b/lemur/tests/vectors.py index 9572ba66..0c4c732f 100644 --- a/lemur/tests/vectors.py +++ b/lemur/tests/vectors.py @@ -1,13 +1,13 @@ from lemur.common.utils import parse_certificate VALID_USER_HEADER_TOKEN = { - 'Authorization': 'Basic ' + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE0MzUyMzMzNjksInN1YiI6MSwiZXhwIjoxNTIxNTQ2OTY5fQ.1qCi0Ip7mzKbjNh0tVd3_eJOrae3rNa_9MCVdA4WtQI', + 'Authorization': 'Basic ' + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1MjE2NTIwMjIsImV4cCI6MjM4NTY1MjAyMiwic3ViIjoxfQ.uK4PZjVAs0gt6_9h2EkYkKd64nFXdOq-rHsJZzeQicc', 'Content-Type': 'application/json' } VALID_ADMIN_HEADER_TOKEN = { - 'Authorization': 'Basic ' + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE0MzUyNTAyMTgsInN1YiI6MiwiZXhwIjoxNTIxNTYzODE4fQ.6mbq4-Ro6K5MmuNiTJBB153RDhlM5LGJBjI7GBKkfqA', + 'Authorization': 'Basic ' + 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1MjE2NTE2NjMsInN1YiI6MiwiYWlkIjoxfQ.wyf5PkQNcggLrMFqxDfzjY-GWPw_XsuWvU2GmQaC5sg', 'Content-Type': 'application/json' } diff --git a/requirements-dev.txt b/requirements-dev.txt index 22bc2bbb..66d1e9ea 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -43,8 +43,8 @@ mccabe==0.6.1 \ --hash=sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42 \ --hash=sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f \ # via flake8 -nodeenv==1.2.0 \ - --hash=sha256:98835dab727f94a713eacc7234e3db6777a55cafb60f391485011899e5c818df \ +nodeenv==1.3.0 \ + --hash=sha256:dd0a34001090ff042cfdb4b0c8d6a6f7ec9baa49733f00b695bb8a8b4700ba6c \ # via pre-commit pkginfo==1.4.2 \ --hash=sha256:5878d542a4b3f237e359926384f1dde4e099c9f5525d236b1840cf704fa8d474 \ @@ -87,9 +87,9 @@ tqdm==4.19.8 \ --hash=sha256:05e991ecb0f874046ddcb374396a626afd046fb4d31f73633ea752b844458a7a \ --hash=sha256:2aea9f81fdf127048667e0ba22f5fc10ebc879fb838dc52dcf055242037ec1f7 \ # via twine -twine==1.10.0 \ - --hash=sha256:c3540f2b98667698412b0dc9f5e40c8c1a08a9e79e255c9c21339105eb4ca57a \ - --hash=sha256:eff86e20fdffef8abb0b638784c62d0348dac4c80380907e39b732c56e9192fb +twine==1.11.0 \ + --hash=sha256:08eb132bbaec40c6d25b358f546ec1dc96ebd2638a86eea68769d9e67fe2b129 \ + --hash=sha256:2fd9a4d9ff0bcacf41fdc40c8cb0cfaef1f1859457c9653fd1b92237cc4e9f25 urllib3==1.22 \ --hash=sha256:06330f386d6e4b195fbfc736b297f58c5a892e4440e54d294d7004e3a9bbea1b \ --hash=sha256:cc44da8e1145637334317feebd728bd869a35285b93cbb4cca2577da7e62db4f \ diff --git a/requirements.in b/requirements.in index 5e283b4b..00076194 100644 --- a/requirements.in +++ b/requirements.in @@ -30,5 +30,5 @@ pem==17.1.0 raven[flask]==6.2.1 jinja2==2.10 paramiko==2.4.1 # required for lemur_linuxdst plugin -pyldap==3.0.0 # required by ldap auth provider +python_ldap<=3.0.0b4 alembic-autogenerate-enums==0.0.2