From c892cd5ae18e13628cd55b1a159dfabd30c62db0 Mon Sep 17 00:00:00 2001 From: Hossein Shafagh Date: Fri, 18 Sep 2020 17:38:52 -0700 Subject: [PATCH 01/26] removing anything that remotely looks like a secret in code to set a good example --- docker/src/lemur.conf.py | 19 ++++++++++++++++--- lemur/tests/conf.py | 22 ++++++++++++++++++---- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/docker/src/lemur.conf.py b/docker/src/lemur.conf.py index 3cc51792..89448b29 100644 --- a/docker/src/lemur.conf.py +++ b/docker/src/lemur.conf.py @@ -1,4 +1,7 @@ import os +import random +import string +import base64 from ast import literal_eval _basedir = os.path.abspath(os.path.dirname(__file__)) @@ -6,10 +9,20 @@ _basedir = os.path.abspath(os.path.dirname(__file__)) CORS = os.environ.get("CORS") == "True" debug = os.environ.get("DEBUG") == "True" -SECRET_KEY = repr(os.environ.get('SECRET_KEY','Hrs8kCDNPuT9vtshsSWzlrYW+d+PrAXvg/HwbRE6M3vzSJTTrA/ZEw==')) -LEMUR_TOKEN_SECRET = repr(os.environ.get('LEMUR_TOKEN_SECRET','YVKT6nNHnWRWk28Lra1OPxMvHTqg1ZXvAcO7bkVNSbrEuDQPABM0VQ==')) -LEMUR_ENCRYPTION_KEYS = repr(os.environ.get('LEMUR_ENCRYPTION_KEYS','Ls-qg9j3EMFHyGB_NL0GcQLI6622n9pSyGM_Pu0GdCo=')) +def get_random_secret(length): + secret_key = ''.join(random.choice(string.ascii_uppercase) for x in range(length/4)) + secret_key = secret_key + ''.join(random.choice("~!@#$%^&*()_+") for x in range(length/4)) + secret_key = secret_key + ''.join(random.choice(string.ascii_lowercase) for x in range(length/4)) + return secret_key + ''.join(random.choice(string.digits) for x in range(length/4)) + + +SECRET_KEY = repr(os.environ.get('SECRET_KEY', get_random_secret(32).encode('utf8'))) + +LEMUR_TOKEN_SECRET = repr(os.environ.get('LEMUR_TOKEN_SECRET', + base64.b64encode(get_random_secret(32).encode('utf8')))) +LEMUR_ENCRYPTION_KEYS = repr(os.environ.get('LEMUR_ENCRYPTION_KEYS', + base64.b64encode(get_random_secret(32).encode('utf8')))) LEMUR_WHITELISTED_DOMAINS = [] diff --git a/lemur/tests/conf.py b/lemur/tests/conf.py index af0c09ce..62df5a68 100644 --- a/lemur/tests/conf.py +++ b/lemur/tests/conf.py @@ -1,9 +1,21 @@ # This is just Python which means you can inherit and tweak settings import os +import random +import string +import base64 _basedir = os.path.abspath(os.path.dirname(__file__)) + +# generate random secrets for unittest +def get_random_secret(length): + secret_key = ''.join(random.choice(string.ascii_uppercase) for x in range(length/4)) + secret_key = secret_key + ''.join(random.choice("~!@#$%^&*()_+") for x in range(length/4)) + secret_key = secret_key + ''.join(random.choice(string.ascii_lowercase) for x in range(length/4)) + return secret_key + ''.join(random.choice(string.digits) for x in range(length/4)) + + THREADS_PER_PAGE = 8 # General @@ -14,12 +26,14 @@ debug = False TESTING = True -# this is the secret key used by flask session management -SECRET_KEY = "I/dVhOZNSMZMqrFJa5tWli6VQccOGudKerq3eWPMSzQNmHHVhMAQfQ==" +# this is the secret key used by flask session management (utf8 encoded) +SECRET_KEY = get_random_secret(length=32).encode('utf8') -# You should consider storing these separately from your config + +# You should consider storing these separately from your config (should be URL-safe) LEMUR_TOKEN_SECRET = "test" -LEMUR_ENCRYPTION_KEYS = "o61sBLNBSGtAckngtNrfVNd8xy8Hp9LBGDstTbMbqCY=" +LEMUR_ENCRYPTION_KEYS = base64.urlsafe_b64encode(get_random_secret(length=32).encode('utf8')) + # List of domain regular expressions that non-admin users can issue LEMUR_WHITELISTED_DOMAINS = [ From 21e9a4508df4323bec5feed0a2d3193633fc5b45 Mon Sep 17 00:00:00 2001 From: Hossein Shafagh Date: Fri, 18 Sep 2020 17:42:28 -0700 Subject: [PATCH 02/26] TypeError: 'float' object cannot be interpreted as an integer --- docker/src/lemur.conf.py | 8 ++++---- lemur/tests/conf.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docker/src/lemur.conf.py b/docker/src/lemur.conf.py index 89448b29..69f9d985 100644 --- a/docker/src/lemur.conf.py +++ b/docker/src/lemur.conf.py @@ -11,10 +11,10 @@ debug = os.environ.get("DEBUG") == "True" def get_random_secret(length): - secret_key = ''.join(random.choice(string.ascii_uppercase) for x in range(length/4)) - secret_key = secret_key + ''.join(random.choice("~!@#$%^&*()_+") for x in range(length/4)) - secret_key = secret_key + ''.join(random.choice(string.ascii_lowercase) for x in range(length/4)) - return secret_key + ''.join(random.choice(string.digits) for x in range(length/4)) + secret_key = ''.join(random.choice(string.ascii_uppercase) for x in range(round(length/4))) + secret_key = secret_key + ''.join(random.choice("~!@#$%^&*()_+") for x in range(round(length/4))) + secret_key = secret_key + ''.join(random.choice(string.ascii_lowercase) for x in range(round(length/4))) + return secret_key + ''.join(random.choice(string.digits) for x in range(round(length/4))) SECRET_KEY = repr(os.environ.get('SECRET_KEY', get_random_secret(32).encode('utf8'))) diff --git a/lemur/tests/conf.py b/lemur/tests/conf.py index 62df5a68..f984aeba 100644 --- a/lemur/tests/conf.py +++ b/lemur/tests/conf.py @@ -10,10 +10,10 @@ _basedir = os.path.abspath(os.path.dirname(__file__)) # generate random secrets for unittest def get_random_secret(length): - secret_key = ''.join(random.choice(string.ascii_uppercase) for x in range(length/4)) - secret_key = secret_key + ''.join(random.choice("~!@#$%^&*()_+") for x in range(length/4)) - secret_key = secret_key + ''.join(random.choice(string.ascii_lowercase) for x in range(length/4)) - return secret_key + ''.join(random.choice(string.digits) for x in range(length/4)) + secret_key = ''.join(random.choice(string.ascii_uppercase) for x in range(round(length/4))) + secret_key = secret_key + ''.join(random.choice("~!@#$%^&*()_+") for x in range(round(length/4))) + secret_key = secret_key + ''.join(random.choice(string.ascii_lowercase) for x in range(round(length/4))) + return secret_key + ''.join(random.choice(string.digits) for x in range(round(length/4))) THREADS_PER_PAGE = 8 From 1632b4b078d2300e815752c0406cbf3579cbe136 Mon Sep 17 00:00:00 2001 From: Hossein Shafagh Date: Fri, 18 Sep 2020 21:58:53 -0700 Subject: [PATCH 03/26] making lint happy, running make test-python doesn't run lint --- docker/src/lemur.conf.py | 8 ++++---- lemur/tests/conf.py | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docker/src/lemur.conf.py b/docker/src/lemur.conf.py index 69f9d985..2a4ef514 100644 --- a/docker/src/lemur.conf.py +++ b/docker/src/lemur.conf.py @@ -11,10 +11,10 @@ debug = os.environ.get("DEBUG") == "True" def get_random_secret(length): - secret_key = ''.join(random.choice(string.ascii_uppercase) for x in range(round(length/4))) - secret_key = secret_key + ''.join(random.choice("~!@#$%^&*()_+") for x in range(round(length/4))) - secret_key = secret_key + ''.join(random.choice(string.ascii_lowercase) for x in range(round(length/4))) - return secret_key + ''.join(random.choice(string.digits) for x in range(round(length/4))) + secret_key = ''.join(random.choice(string.ascii_uppercase) for x in range(round(length / 4))) + secret_key = secret_key + ''.join(random.choice("~!@#$%^&*()_+") for x in range(round(length / 4))) + secret_key = secret_key + ''.join(random.choice(string.ascii_lowercase) for x in range(round(length / 4))) + return secret_key + ''.join(random.choice(string.digits) for x in range(round(length / 4))) soi SECRET_KEY = repr(os.environ.get('SECRET_KEY', get_random_secret(32).encode('utf8'))) diff --git a/lemur/tests/conf.py b/lemur/tests/conf.py index f984aeba..d3badbeb 100644 --- a/lemur/tests/conf.py +++ b/lemur/tests/conf.py @@ -1,19 +1,19 @@ # This is just Python which means you can inherit and tweak settings +import base64 import os import random import string -import base64 _basedir = os.path.abspath(os.path.dirname(__file__)) # generate random secrets for unittest def get_random_secret(length): - secret_key = ''.join(random.choice(string.ascii_uppercase) for x in range(round(length/4))) - secret_key = secret_key + ''.join(random.choice("~!@#$%^&*()_+") for x in range(round(length/4))) - secret_key = secret_key + ''.join(random.choice(string.ascii_lowercase) for x in range(round(length/4))) - return secret_key + ''.join(random.choice(string.digits) for x in range(round(length/4))) + secret_key = ''.join(random.choice(string.ascii_uppercase) for x in range(round(length / 4))) + secret_key = secret_key + ''.join(random.choice("~!@#$%^&*()_+") for x in range(round(length / 4))) + secret_key = secret_key + ''.join(random.choice(string.ascii_lowercase) for x in range(round(length / 4))) + return secret_key + ''.join(random.choice(string.digits) for x in range(round(length / 4))) THREADS_PER_PAGE = 8 From 19a678dcc258e1619a1a4e806ce66146cb4f7dc7 Mon Sep 17 00:00:00 2001 From: Hossein Shafagh Date: Sat, 19 Sep 2020 08:58:52 -0700 Subject: [PATCH 04/26] removing typo --- docker/src/lemur.conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/src/lemur.conf.py b/docker/src/lemur.conf.py index 2a4ef514..4cb3ae0c 100644 --- a/docker/src/lemur.conf.py +++ b/docker/src/lemur.conf.py @@ -14,7 +14,7 @@ def get_random_secret(length): secret_key = ''.join(random.choice(string.ascii_uppercase) for x in range(round(length / 4))) secret_key = secret_key + ''.join(random.choice("~!@#$%^&*()_+") for x in range(round(length / 4))) secret_key = secret_key + ''.join(random.choice(string.ascii_lowercase) for x in range(round(length / 4))) - return secret_key + ''.join(random.choice(string.digits) for x in range(round(length / 4))) soi + return secret_key + ''.join(random.choice(string.digits) for x in range(round(length / 4))) SECRET_KEY = repr(os.environ.get('SECRET_KEY', get_random_secret(32).encode('utf8'))) From cd13832377f295717bab16333e21e8e0a48ac462 Mon Sep 17 00:00:00 2001 From: sayali Date: Wed, 23 Sep 2020 15:16:19 -0700 Subject: [PATCH 05/26] Use key_type column for cert get/rotate/reissue/display Added unit tests --- lemur/certificates/models.py | 1 + lemur/certificates/schemas.py | 9 +++++++++ .../app/angular/certificates/certificate/certificate.js | 5 ++++- lemur/static/app/angular/certificates/view/view.tpl.html | 2 ++ lemur/tests/conf.py | 3 ++- lemur/tests/test_certificates.py | 2 ++ 6 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lemur/certificates/models.py b/lemur/certificates/models.py index f71d2199..60442de2 100644 --- a/lemur/certificates/models.py +++ b/lemur/certificates/models.py @@ -235,6 +235,7 @@ class Certificate(db.Model): self.replaces = kwargs.get("replaces", []) self.rotation = kwargs.get("rotation") self.rotation_policy = kwargs.get("rotation_policy") + self.key_type = kwargs.get("key_type") self.signing_algorithm = defaults.signing_algorithm(cert) self.bits = defaults.bitstrength(cert) self.external_id = kwargs.get("external_id") diff --git a/lemur/certificates/schemas.py b/lemur/certificates/schemas.py index 56c91196..ac7add38 100644 --- a/lemur/certificates/schemas.py +++ b/lemur/certificates/schemas.py @@ -155,6 +155,14 @@ class CertificateInputSchema(CertificateCreationSchema): key_type = cert_utils.get_key_type_from_csr(data["csr"]) if key_type: data["key_type"] = key_type + + # This code will be exercised for certificate import (without CSR) + if data.get("key_type") is None: + if data.get("body"): + data["key_type"] = utils.get_key_type_from_certificate(data["body"]) + else: + data["key_type"] = "RSA2048" # default value + return missing.convert_validity_years(data) @@ -277,6 +285,7 @@ class CertificateOutputSchema(LemurOutputSchema): serial = fields.String() serial_hex = Hex(attribute="serial") signing_algorithm = fields.String() + key_type = fields.String(allow_none=True) status = fields.String() user = fields.Nested(UserNestedOutputSchema) diff --git a/lemur/static/app/angular/certificates/certificate/certificate.js b/lemur/static/app/angular/certificates/certificate/certificate.js index 6b275328..d332e0b0 100644 --- a/lemur/static/app/angular/certificates/certificate/certificate.js +++ b/lemur/static/app/angular/certificates/certificate/certificate.js @@ -251,10 +251,13 @@ angular.module('lemur') $scope.certificate.csr = null; // should not clone CSR in case other settings are changed in clone $scope.certificate.validityStart = null; $scope.certificate.validityEnd = null; - $scope.certificate.keyType = 'RSA2048'; // default algo to show during clone $scope.certificate.description = 'Cloning from cert ID ' + editId; $scope.certificate.replacedBy = []; // should not clone 'replaced by' info $scope.certificate.removeReplaces(); // should not clone 'replacement cert' info + + if(!$scope.certificate.keyType) { + $scope.certificate.keyType = 'RSA2048'; // default algo to show during clone if backend did not return algo + } CertificateService.getDefaults($scope.certificate); }); diff --git a/lemur/static/app/angular/certificates/view/view.tpl.html b/lemur/static/app/angular/certificates/view/view.tpl.html index 7b0919f8..06c4d860 100644 --- a/lemur/static/app/angular/certificates/view/view.tpl.html +++ b/lemur/static/app/angular/certificates/view/view.tpl.html @@ -111,6 +111,8 @@
Key Length
{{ certificate.bits }}
+
Key Type
+
{{ certificate.keyType }}
Signing Algorithm
{{ certificate.signingAlgorithm }}
diff --git a/lemur/tests/conf.py b/lemur/tests/conf.py index af0c09ce..b3df73bf 100644 --- a/lemur/tests/conf.py +++ b/lemur/tests/conf.py @@ -52,7 +52,8 @@ LEMUR_ALLOW_WEEKEND_EXPIRATION = False # Database -# modify this if you are not using a local database +# modify this if you are not using a local database. Please do not use any DB used for development or production purpose +# Please note that Unit Tests drop the whole schema, recreate and again drop everything at the end SQLALCHEMY_DATABASE_URI = os.getenv( "SQLALCHEMY_DATABASE_URI", "postgresql://lemur:lemur@localhost:5432/lemur" ) diff --git a/lemur/tests/test_certificates.py b/lemur/tests/test_certificates.py index 41584cb3..212ac9d9 100644 --- a/lemur/tests/test_certificates.py +++ b/lemur/tests/test_certificates.py @@ -155,6 +155,7 @@ def test_get_certificate_primitives(certificate): with freeze_time(datetime.date(year=2016, month=10, day=30)): primitives = get_certificate_primitives(certificate) assert len(primitives) == 26 + assert (primitives["key_type"] == "RSA2048") def test_certificate_output_schema(session, certificate, issuer_plugin): @@ -759,6 +760,7 @@ def test_reissue_certificate( certificate.authority = crypto_authority new_cert = reissue_certificate(certificate) assert new_cert + assert (new_cert.key_type == "RSA2048") def test_create_csr(): From e871c5eb1808c0ff4bf6aaded6d4435e1a8d31df Mon Sep 17 00:00:00 2001 From: Hossein Shafagh Date: Fri, 25 Sep 2020 12:30:37 -0700 Subject: [PATCH 06/26] Update conf.py --- lemur/tests/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lemur/tests/conf.py b/lemur/tests/conf.py index c314c8bc..df0be16c 100644 --- a/lemur/tests/conf.py +++ b/lemur/tests/conf.py @@ -61,8 +61,8 @@ LEMUR_ALLOW_WEEKEND_EXPIRATION = False # Database -# modify this if you are not using a local database. Please do not use any DB used for development or production purpose -# Please note that Unit Tests drop the whole schema, recreate and again drop everything at the end +# modify this if you are not using a local database. Do not use any development or production DBs, +# as Unit Tests drop the whole schema, recreate and again drop everything at the end SQLALCHEMY_DATABASE_URI = os.getenv( "SQLALCHEMY_DATABASE_URI", "postgresql://lemur:lemur@localhost:5432/lemur" ) From d49edd886b80fde9105fb136e48ff462c040c110 Mon Sep 17 00:00:00 2001 From: Hossein Shafagh Date: Fri, 25 Sep 2020 12:32:33 -0700 Subject: [PATCH 07/26] language --- .../static/app/angular/certificates/certificate/certificate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lemur/static/app/angular/certificates/certificate/certificate.js b/lemur/static/app/angular/certificates/certificate/certificate.js index d332e0b0..9fadb655 100644 --- a/lemur/static/app/angular/certificates/certificate/certificate.js +++ b/lemur/static/app/angular/certificates/certificate/certificate.js @@ -256,7 +256,7 @@ angular.module('lemur') $scope.certificate.removeReplaces(); // should not clone 'replacement cert' info if(!$scope.certificate.keyType) { - $scope.certificate.keyType = 'RSA2048'; // default algo to show during clone if backend did not return algo + $scope.certificate.keyType = 'RSA2048'; // default algo to select during clone if backend did not return algo } CertificateService.getDefaults($scope.certificate); }); From f8705aa730e386411315cbbcfc5b330bd51144a3 Mon Sep 17 00:00:00 2001 From: Hossein Shafagh Date: Fri, 25 Sep 2020 17:19:30 -0700 Subject: [PATCH 08/26] lint --- docker/src/lemur.conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/docker/src/lemur.conf.py b/docker/src/lemur.conf.py index 4cb3ae0c..e414da1f 100644 --- a/docker/src/lemur.conf.py +++ b/docker/src/lemur.conf.py @@ -16,7 +16,6 @@ def get_random_secret(length): secret_key = secret_key + ''.join(random.choice(string.ascii_lowercase) for x in range(round(length / 4))) return secret_key + ''.join(random.choice(string.digits) for x in range(round(length / 4))) - SECRET_KEY = repr(os.environ.get('SECRET_KEY', get_random_secret(32).encode('utf8'))) LEMUR_TOKEN_SECRET = repr(os.environ.get('LEMUR_TOKEN_SECRET', From 96eada297f9d01792aa3640e3e5e456380eee1a2 Mon Sep 17 00:00:00 2001 From: Hossein Shafagh Date: Mon, 28 Sep 2020 14:40:56 -0700 Subject: [PATCH 09/26] lint --- lemur/tests/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lemur/tests/conf.py b/lemur/tests/conf.py index e2d2e50b..f1019d04 100644 --- a/lemur/tests/conf.py +++ b/lemur/tests/conf.py @@ -15,6 +15,7 @@ def get_random_secret(length): secret_key = secret_key + ''.join(random.choice(string.ascii_lowercase) for x in range(round(length / 4))) return secret_key + ''.join(random.choice(string.digits) for x in range(round(length / 4))) + THREADS_PER_PAGE = 8 # General From ba47e7448d360a191f559895e122a7ccd97af9d1 Mon Sep 17 00:00:00 2001 From: Hossein Shafagh Date: Mon, 28 Sep 2020 14:42:03 -0700 Subject: [PATCH 10/26] lint --- docker/src/lemur.conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/src/lemur.conf.py b/docker/src/lemur.conf.py index e414da1f..4cb3ae0c 100644 --- a/docker/src/lemur.conf.py +++ b/docker/src/lemur.conf.py @@ -16,6 +16,7 @@ def get_random_secret(length): secret_key = secret_key + ''.join(random.choice(string.ascii_lowercase) for x in range(round(length / 4))) return secret_key + ''.join(random.choice(string.digits) for x in range(round(length / 4))) + SECRET_KEY = repr(os.environ.get('SECRET_KEY', get_random_secret(32).encode('utf8'))) LEMUR_TOKEN_SECRET = repr(os.environ.get('LEMUR_TOKEN_SECRET', From 7a226241db381e36c0efffac777ca7319e51f3df Mon Sep 17 00:00:00 2001 From: sayali Date: Mon, 28 Sep 2020 18:13:00 -0700 Subject: [PATCH 11/26] Add key_type to CertificateUploadInputSchema Parse cert body to determine algo --- lemur/certificates/schemas.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lemur/certificates/schemas.py b/lemur/certificates/schemas.py index ac7add38..1e5fe6a6 100644 --- a/lemur/certificates/schemas.py +++ b/lemur/certificates/schemas.py @@ -326,6 +326,7 @@ class CertificateUploadInputSchema(CertificateCreationSchema): body = fields.String(required=True) chain = fields.String(missing=None, allow_none=True) csr = fields.String(required=False, allow_none=True, validate=validators.csr) + key_type = fields.String() destinations = fields.Nested(AssociatedDestinationSchema, missing=[], many=True) notifications = fields.Nested(AssociatedNotificationSchema, missing=[], many=True) @@ -373,6 +374,10 @@ class CertificateUploadInputSchema(CertificateCreationSchema): # Throws ValidationError validators.verify_cert_chain([cert] + chain) + @pre_load + def load_data(self, data): + data["key_type"] = utils.get_key_type_from_certificate(data["body"]) + class CertificateExportInputSchema(LemurInputSchema): plugin = fields.Nested(PluginInputSchema) From aaff0f7581a20add80c7fb778f7abd0236604c0b Mon Sep 17 00:00:00 2001 From: sayali Date: Mon, 28 Sep 2020 19:03:21 -0700 Subject: [PATCH 12/26] Fixing UT for key_type on upload schema --- lemur/certificates/schemas.py | 8 +++++++- lemur/tests/test_pending_certificates.py | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lemur/certificates/schemas.py b/lemur/certificates/schemas.py index 1e5fe6a6..f393aa49 100644 --- a/lemur/certificates/schemas.py +++ b/lemur/certificates/schemas.py @@ -376,7 +376,13 @@ class CertificateUploadInputSchema(CertificateCreationSchema): @pre_load def load_data(self, data): - data["key_type"] = utils.get_key_type_from_certificate(data["body"]) + if data.get("body"): + try: + data["key_type"] = utils.get_key_type_from_certificate(data["body"]) + except ValueError: + raise ValidationError( + "Public certificate presented is not valid.", field_names=["body"] + ) class CertificateExportInputSchema(LemurInputSchema): diff --git a/lemur/tests/test_pending_certificates.py b/lemur/tests/test_pending_certificates.py index 3e755574..3718ef0a 100644 --- a/lemur/tests/test_pending_certificates.py +++ b/lemur/tests/test_pending_certificates.py @@ -55,6 +55,7 @@ def test_create_pending(pending_certificate, user, session): assert real_cert.notify == pending_certificate.notify assert real_cert.private_key == pending_certificate.private_key assert real_cert.external_id == "54321" + assert real_cert.key_type == "RSA2048" @pytest.mark.parametrize( From d3908fa445e113914c39daa2ecdf3ab87d471ca8 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 29 Sep 2020 07:33:30 +0000 Subject: [PATCH 13/26] Bump botocore from 1.18.2 to 1.18.7 Bumps [botocore](https://github.com/boto/botocore) from 1.18.2 to 1.18.7. - [Release notes](https://github.com/boto/botocore/releases) - [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/botocore/compare/1.18.2...1.18.7) Signed-off-by: dependabot-preview[bot] --- requirements-docs.txt | 2 +- requirements-tests.txt | 2 +- requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 5c6fdf92..c2cb3e12 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -18,7 +18,7 @@ beautifulsoup4==4.9.1 # via -r requirements.txt, cloudflare billiard==3.6.3.0 # via -r requirements.txt, celery blinker==1.4 # via -r requirements.txt, flask-mail, flask-principal, raven boto3==1.15.2 # via -r requirements.txt -botocore==1.18.2 # via -r requirements.txt, boto3, s3transfer +botocore==1.18.7 # via -r requirements.txt, boto3, s3transfer celery[redis]==4.4.2 # via -r requirements.txt certifi==2020.6.20 # via -r requirements.txt, requests certsrv==2.1.1 # via -r requirements.txt diff --git a/requirements-tests.txt b/requirements-tests.txt index b2b51cd7..7f9aafaf 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -12,7 +12,7 @@ bandit==1.6.2 # via -r requirements-tests.in black==20.8b1 # via -r requirements-tests.in boto3==1.15.2 # via aws-sam-translator, moto boto==2.49.0 # via moto -botocore==1.18.2 # via aws-xray-sdk, boto3, moto, s3transfer +botocore==1.18.7 # via aws-xray-sdk, boto3, moto, s3transfer certifi==2020.6.20 # via requests cffi==1.14.0 # via cryptography cfn-lint==0.29.5 # via moto diff --git a/requirements.txt b/requirements.txt index cab2a8ed..5dc985cc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,7 +16,7 @@ beautifulsoup4==4.9.1 # via cloudflare billiard==3.6.3.0 # via celery blinker==1.4 # via flask-mail, flask-principal, raven boto3==1.15.2 # via -r requirements.in -botocore==1.18.2 # via -r requirements.in, boto3, s3transfer +botocore==1.18.7 # via -r requirements.in, boto3, s3transfer celery[redis]==4.4.2 # via -r requirements.in certifi==2020.6.20 # via -r requirements.in, requests certsrv==2.1.1 # via -r requirements.in From d7fc84f6e92cb2f6bc3006971258d655059f9fb1 Mon Sep 17 00:00:00 2001 From: Mathias Petermann Date: Tue, 29 Sep 2020 14:36:31 +0200 Subject: [PATCH 14/26] Fix dns-providers type missing from schema --- lemur/dns_providers/schemas.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lemur/dns_providers/schemas.py b/lemur/dns_providers/schemas.py index 05b6471d..af9377b3 100644 --- a/lemur/dns_providers/schemas.py +++ b/lemur/dns_providers/schemas.py @@ -8,7 +8,7 @@ class DnsProvidersNestedOutputSchema(LemurOutputSchema): __envelope__ = False id = fields.Integer() name = fields.String() - providerType = fields.String() + provider_type = fields.String() description = fields.String() credentials = fields.String() api_endpoint = fields.String() From 23797ec06755fda24c3a57d38da77cef58f5c89f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 29 Sep 2020 16:15:06 +0000 Subject: [PATCH 15/26] Bump pytest from 6.0.2 to 6.1.0 Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.0.2 to 6.1.0. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/6.0.2...6.1.0) Signed-off-by: dependabot-preview[bot] --- requirements-tests.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-tests.txt b/requirements-tests.txt index 7f9aafaf..ce68b01c 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -44,7 +44,7 @@ jsonpointer==2.0 # via jsonpatch jsonschema==3.2.0 # via aws-sam-translator, cfn-lint markupsafe==1.1.1 # via jinja2, moto mock==4.0.2 # via moto -more-itertools==8.2.0 # via moto, pytest +more-itertools==8.2.0 # via moto moto==1.3.16 # via -r requirements-tests.in mypy-extensions==0.4.3 # via black networkx==2.4 # via cfn-lint @@ -61,7 +61,7 @@ pyparsing==2.4.7 # via packaging pyrsistent==0.16.0 # via jsonschema pytest-flask==1.0.0 # via -r requirements-tests.in pytest-mock==3.3.1 # via -r requirements-tests.in -pytest==6.0.2 # via -r requirements-tests.in, pytest-flask, pytest-mock +pytest==6.1.0 # via -r requirements-tests.in, pytest-flask, pytest-mock python-dateutil==2.8.1 # via botocore, faker, freezegun, moto python-jose[cryptography]==3.1.0 # via moto pytz==2019.3 # via moto From 5fc65334436587af9809abd6148f34b67b7f74ea Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 29 Sep 2020 16:27:01 +0000 Subject: [PATCH 16/26] Bump boto3 from 1.15.2 to 1.15.7 Bumps [boto3](https://github.com/boto/boto3) from 1.15.2 to 1.15.7. - [Release notes](https://github.com/boto/boto3/releases) - [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/boto3/compare/1.15.2...1.15.7) Signed-off-by: dependabot-preview[bot] --- requirements-docs.txt | 2 +- requirements-tests.txt | 2 +- requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index c2cb3e12..377966f3 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -17,7 +17,7 @@ bcrypt==3.1.7 # via -r requirements.txt, flask-bcrypt, paramiko beautifulsoup4==4.9.1 # via -r requirements.txt, cloudflare billiard==3.6.3.0 # via -r requirements.txt, celery blinker==1.4 # via -r requirements.txt, flask-mail, flask-principal, raven -boto3==1.15.2 # via -r requirements.txt +boto3==1.15.7 # via -r requirements.txt botocore==1.18.7 # via -r requirements.txt, boto3, s3transfer celery[redis]==4.4.2 # via -r requirements.txt certifi==2020.6.20 # via -r requirements.txt, requests diff --git a/requirements-tests.txt b/requirements-tests.txt index ce68b01c..59f46952 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -10,7 +10,7 @@ aws-sam-translator==1.22.0 # via cfn-lint aws-xray-sdk==2.5.0 # via moto bandit==1.6.2 # via -r requirements-tests.in black==20.8b1 # via -r requirements-tests.in -boto3==1.15.2 # via aws-sam-translator, moto +boto3==1.15.7 # via aws-sam-translator, moto boto==2.49.0 # via moto botocore==1.18.7 # via aws-xray-sdk, boto3, moto, s3transfer certifi==2020.6.20 # via requests diff --git a/requirements.txt b/requirements.txt index 5dc985cc..6538df93 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,7 +15,7 @@ bcrypt==3.1.7 # via flask-bcrypt, paramiko beautifulsoup4==4.9.1 # via cloudflare billiard==3.6.3.0 # via celery blinker==1.4 # via flask-mail, flask-principal, raven -boto3==1.15.2 # via -r requirements.in +boto3==1.15.7 # via -r requirements.in botocore==1.18.7 # via -r requirements.in, boto3, s3transfer celery[redis]==4.4.2 # via -r requirements.in certifi==2020.6.20 # via -r requirements.in, requests From 0f0f7175202ed9d21ebebfaf90625fe2778f1669 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 29 Sep 2020 16:39:43 +0000 Subject: [PATCH 17/26] Bump cryptography from 3.1 to 3.1.1 Bumps [cryptography](https://github.com/pyca/cryptography) from 3.1 to 3.1.1. - [Release notes](https://github.com/pyca/cryptography/releases) - [Changelog](https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pyca/cryptography/compare/3.1...3.1.1) Signed-off-by: dependabot-preview[bot] --- requirements-dev.txt | 2 +- requirements-docs.txt | 2 +- requirements-tests.txt | 2 +- requirements.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 166722e8..c53c57f9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -11,7 +11,7 @@ cffi==1.14.0 # via cryptography cfgv==3.1.0 # via pre-commit chardet==3.0.4 # via requests colorama==0.4.3 # via twine -cryptography==3.1 # via secretstorage +cryptography==3.1.1 # via secretstorage distlib==0.3.0 # via virtualenv docutils==0.16 # via readme-renderer filelock==3.0.12 # via virtualenv diff --git a/requirements-docs.txt b/requirements-docs.txt index 377966f3..36d3defd 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -26,7 +26,7 @@ cffi==1.14.0 # via -r requirements.txt, bcrypt, cryptography, pynac chardet==3.0.4 # via -r requirements.txt, requests click==7.1.1 # via -r requirements.txt, flask cloudflare==2.8.13 # via -r requirements.txt -cryptography==3.1 # via -r requirements.txt, acme, josepy, paramiko, pyopenssl, requests +cryptography==3.1.1 # via -r requirements.txt, acme, josepy, paramiko, pyopenssl, requests dnspython3==1.15.0 # via -r requirements.txt dnspython==1.15.0 # via -r requirements.txt, dnspython3 docutils==0.15.2 # via sphinx diff --git a/requirements-tests.txt b/requirements-tests.txt index 59f46952..1a8d4cb0 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -19,7 +19,7 @@ cfn-lint==0.29.5 # via moto chardet==3.0.4 # via requests click==7.1.2 # via black, flask coverage==5.3 # via -r requirements-tests.in -cryptography==3.1 # via moto, python-jose, sshpubkeys +cryptography==3.1.1 # via moto, python-jose, sshpubkeys decorator==4.4.2 # via networkx docker==4.2.0 # via moto ecdsa==0.14.1 # via moto, python-jose, sshpubkeys diff --git a/requirements.txt b/requirements.txt index 6538df93..a668ff05 100644 --- a/requirements.txt +++ b/requirements.txt @@ -24,7 +24,7 @@ cffi==1.14.0 # via bcrypt, cryptography, pynacl chardet==3.0.4 # via requests click==7.1.1 # via flask cloudflare==2.8.13 # via -r requirements.in -cryptography==3.1 # via -r requirements.in, acme, josepy, paramiko, pyopenssl, requests +cryptography==3.1.1 # via -r requirements.in, acme, josepy, paramiko, pyopenssl, requests dnspython3==1.15.0 # via -r requirements.in dnspython==1.15.0 # via dnspython3 dyn==1.8.1 # via -r requirements.in From ea513f465fa9d060ad9238a7574d000f142f0088 Mon Sep 17 00:00:00 2001 From: sayali Date: Tue, 29 Sep 2020 16:33:10 -0700 Subject: [PATCH 18/26] Remove bit length check from last query --- lemur/migrations/versions/c301c59688d2_.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lemur/migrations/versions/c301c59688d2_.py b/lemur/migrations/versions/c301c59688d2_.py index 3b0a86f7..669c934f 100644 --- a/lemur/migrations/versions/c301c59688d2_.py +++ b/lemur/migrations/versions/c301c59688d2_.py @@ -90,7 +90,7 @@ def update_key_type(): # Loop through all certificates that are valid today or expired in the last 30 days. for cert_id, body in conn.execute( text( - "select id, body from certificates where bits < 1024 and not_after > CURRENT_DATE - 31 and key_type is null") + "select id, body from certificates where not_after > CURRENT_DATE - 31 and key_type is null") ): try: cert_key_type = utils.get_key_type_from_certificate(body) From 60d28cf875f1f574384f95e91c6563fb66886754 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 6 Oct 2020 08:30:51 +0000 Subject: [PATCH 19/26] Bump pytest from 6.1.0 to 6.1.1 Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.1.0 to 6.1.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/6.1.0...6.1.1) Signed-off-by: dependabot-preview[bot] --- requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-tests.txt b/requirements-tests.txt index 1a8d4cb0..95045003 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -61,7 +61,7 @@ pyparsing==2.4.7 # via packaging pyrsistent==0.16.0 # via jsonschema pytest-flask==1.0.0 # via -r requirements-tests.in pytest-mock==3.3.1 # via -r requirements-tests.in -pytest==6.1.0 # via -r requirements-tests.in, pytest-flask, pytest-mock +pytest==6.1.1 # via -r requirements-tests.in, pytest-flask, pytest-mock python-dateutil==2.8.1 # via botocore, faker, freezegun, moto python-jose[cryptography]==3.1.0 # via moto pytz==2019.3 # via moto From 2586c23efd32ce7954a293ef624303865e993ef0 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 6 Oct 2020 16:40:44 +0000 Subject: [PATCH 20/26] Bump factory-boy from 3.0.1 to 3.1.0 Bumps [factory-boy](https://github.com/FactoryBoy/factory_boy) from 3.0.1 to 3.1.0. - [Release notes](https://github.com/FactoryBoy/factory_boy/releases) - [Changelog](https://github.com/FactoryBoy/factory_boy/blob/master/docs/changelog.rst) - [Commits](https://github.com/FactoryBoy/factory_boy/compare/3.0.1...3.1.0) Signed-off-by: dependabot-preview[bot] --- requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-tests.txt b/requirements-tests.txt index 95045003..b35575d2 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -23,7 +23,7 @@ cryptography==3.1.1 # via moto, python-jose, sshpubkeys decorator==4.4.2 # via networkx docker==4.2.0 # via moto ecdsa==0.14.1 # via moto, python-jose, sshpubkeys -factory-boy==3.0.1 # via -r requirements-tests.in +factory-boy==3.1.0 # via -r requirements-tests.in faker==4.1.3 # via -r requirements-tests.in, factory-boy fakeredis==1.4.3 # via -r requirements-tests.in flask==1.1.2 # via pytest-flask From 16177d751d21964c218eebfc755f240f24367252 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 6 Oct 2020 16:59:28 +0000 Subject: [PATCH 21/26] Bump faker from 4.1.3 to 4.4.0 Bumps [faker](https://github.com/joke2k/faker) from 4.1.3 to 4.4.0. - [Release notes](https://github.com/joke2k/faker/releases) - [Changelog](https://github.com/joke2k/faker/blob/master/CHANGELOG.rst) - [Commits](https://github.com/joke2k/faker/compare/v4.1.3...v4.4.0) Signed-off-by: dependabot-preview[bot] --- requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-tests.txt b/requirements-tests.txt index b35575d2..f9f5605c 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -24,7 +24,7 @@ decorator==4.4.2 # via networkx docker==4.2.0 # via moto ecdsa==0.14.1 # via moto, python-jose, sshpubkeys factory-boy==3.1.0 # via -r requirements-tests.in -faker==4.1.3 # via -r requirements-tests.in, factory-boy +faker==4.4.0 # via -r requirements-tests.in, factory-boy fakeredis==1.4.3 # via -r requirements-tests.in flask==1.1.2 # via pytest-flask freezegun==1.0.0 # via -r requirements-tests.in From 4e6d25d0f9fb8192ac659045e2be176e3bd359f1 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 6 Oct 2020 17:35:06 +0000 Subject: [PATCH 22/26] Bump botocore from 1.18.7 to 1.18.12 Bumps [botocore](https://github.com/boto/botocore) from 1.18.7 to 1.18.12. - [Release notes](https://github.com/boto/botocore/releases) - [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/botocore/compare/1.18.7...1.18.12) Signed-off-by: dependabot-preview[bot] --- requirements-docs.txt | 2 +- requirements-tests.txt | 2 +- requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index 36d3defd..ee2687e0 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -18,7 +18,7 @@ beautifulsoup4==4.9.1 # via -r requirements.txt, cloudflare billiard==3.6.3.0 # via -r requirements.txt, celery blinker==1.4 # via -r requirements.txt, flask-mail, flask-principal, raven boto3==1.15.7 # via -r requirements.txt -botocore==1.18.7 # via -r requirements.txt, boto3, s3transfer +botocore==1.18.12 # via -r requirements.txt, boto3, s3transfer celery[redis]==4.4.2 # via -r requirements.txt certifi==2020.6.20 # via -r requirements.txt, requests certsrv==2.1.1 # via -r requirements.txt diff --git a/requirements-tests.txt b/requirements-tests.txt index f9f5605c..c234d847 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -12,7 +12,7 @@ bandit==1.6.2 # via -r requirements-tests.in black==20.8b1 # via -r requirements-tests.in boto3==1.15.7 # via aws-sam-translator, moto boto==2.49.0 # via moto -botocore==1.18.7 # via aws-xray-sdk, boto3, moto, s3transfer +botocore==1.18.12 # via aws-xray-sdk, boto3, moto, s3transfer certifi==2020.6.20 # via requests cffi==1.14.0 # via cryptography cfn-lint==0.29.5 # via moto diff --git a/requirements.txt b/requirements.txt index a668ff05..f55d597f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,7 +16,7 @@ beautifulsoup4==4.9.1 # via cloudflare billiard==3.6.3.0 # via celery blinker==1.4 # via flask-mail, flask-principal, raven boto3==1.15.7 # via -r requirements.in -botocore==1.18.7 # via -r requirements.in, boto3, s3transfer +botocore==1.18.12 # via -r requirements.in, boto3, s3transfer celery[redis]==4.4.2 # via -r requirements.in certifi==2020.6.20 # via -r requirements.in, requests certsrv==2.1.1 # via -r requirements.in From 0b667177ddf48eaf0b6ad5a18c591e3f13e7d03a Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 6 Oct 2020 17:51:12 +0000 Subject: [PATCH 23/26] Bump boto3 from 1.15.7 to 1.15.12 Bumps [boto3](https://github.com/boto/boto3) from 1.15.7 to 1.15.12. - [Release notes](https://github.com/boto/boto3/releases) - [Changelog](https://github.com/boto/boto3/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/boto3/compare/1.15.7...1.15.12) Signed-off-by: dependabot-preview[bot] --- requirements-docs.txt | 2 +- requirements-tests.txt | 2 +- requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index ee2687e0..18338b5a 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -17,7 +17,7 @@ bcrypt==3.1.7 # via -r requirements.txt, flask-bcrypt, paramiko beautifulsoup4==4.9.1 # via -r requirements.txt, cloudflare billiard==3.6.3.0 # via -r requirements.txt, celery blinker==1.4 # via -r requirements.txt, flask-mail, flask-principal, raven -boto3==1.15.7 # via -r requirements.txt +boto3==1.15.12 # via -r requirements.txt botocore==1.18.12 # via -r requirements.txt, boto3, s3transfer celery[redis]==4.4.2 # via -r requirements.txt certifi==2020.6.20 # via -r requirements.txt, requests diff --git a/requirements-tests.txt b/requirements-tests.txt index c234d847..2a81f432 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -10,7 +10,7 @@ aws-sam-translator==1.22.0 # via cfn-lint aws-xray-sdk==2.5.0 # via moto bandit==1.6.2 # via -r requirements-tests.in black==20.8b1 # via -r requirements-tests.in -boto3==1.15.7 # via aws-sam-translator, moto +boto3==1.15.12 # via aws-sam-translator, moto boto==2.49.0 # via moto botocore==1.18.12 # via aws-xray-sdk, boto3, moto, s3transfer certifi==2020.6.20 # via requests diff --git a/requirements.txt b/requirements.txt index f55d597f..83013eac 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,7 +15,7 @@ bcrypt==3.1.7 # via flask-bcrypt, paramiko beautifulsoup4==4.9.1 # via cloudflare billiard==3.6.3.0 # via celery blinker==1.4 # via flask-mail, flask-principal, raven -boto3==1.15.7 # via -r requirements.in +boto3==1.15.12 # via -r requirements.in botocore==1.18.12 # via -r requirements.in, boto3, s3transfer celery[redis]==4.4.2 # via -r requirements.in certifi==2020.6.20 # via -r requirements.in, requests From 6b96aefa2185f49e2a211a60463f17a29c4cd8a8 Mon Sep 17 00:00:00 2001 From: sayali Date: Tue, 6 Oct 2020 18:35:28 -0700 Subject: [PATCH 24/26] Authority create: Email added to subject DN for cloudCA --- lemur/authorities/schemas.py | 2 ++ .../app/angular/authorities/authority/authority.js | 5 +++++ .../authorities/authority/distinguishedName.tpl.html | 9 +++++++++ .../app/angular/authorities/authority/tracking.tpl.html | 2 +- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lemur/authorities/schemas.py b/lemur/authorities/schemas.py index ef6263a8..bead94ba 100644 --- a/lemur/authorities/schemas.py +++ b/lemur/authorities/schemas.py @@ -50,6 +50,8 @@ class AuthorityInputSchema(LemurInputSchema): missing=lambda: current_app.config.get("LEMUR_DEFAULT_COUNTRY") ) state = fields.String(missing=lambda: current_app.config.get("LEMUR_DEFAULT_STATE")) + # Creating a String field instead of Email to allow empty value + email = fields.String() plugin = fields.Nested(PluginInputSchema) diff --git a/lemur/static/app/angular/authorities/authority/authority.js b/lemur/static/app/angular/authorities/authority/authority.js index 9863bf4d..4868709b 100644 --- a/lemur/static/app/angular/authorities/authority/authority.js +++ b/lemur/static/app/angular/authorities/authority/authority.js @@ -124,4 +124,9 @@ angular.module('lemur') opened: false }; + $scope.populateSubjectEmail = function () { + if($scope.authority.plugin.title.toLowerCase() === 'cloudca') + $scope.authority.email = $scope.authority.owner; + }; + }); diff --git a/lemur/static/app/angular/authorities/authority/distinguishedName.tpl.html b/lemur/static/app/angular/authorities/authority/distinguishedName.tpl.html index c6a7d312..ca3e1391 100644 --- a/lemur/static/app/angular/authorities/authority/distinguishedName.tpl.html +++ b/lemur/static/app/angular/authorities/authority/distinguishedName.tpl.html @@ -49,6 +49,15 @@ +
+ +
+ +
+
diff --git a/lemur/static/app/angular/authorities/authority/tracking.tpl.html b/lemur/static/app/angular/authorities/authority/tracking.tpl.html index 72d7e3d5..a561745f 100644 --- a/lemur/static/app/angular/authorities/authority/tracking.tpl.html +++ b/lemur/static/app/angular/authorities/authority/tracking.tpl.html @@ -21,7 +21,7 @@
+ class="form-control" ng-change="populateSubjectEmail()" required/>

You must enter an Certificate Authority owner

From c72661a87fb8e3e892f2244a0c9478123598b3c5 Mon Sep 17 00:00:00 2001 From: sayali Date: Tue, 6 Oct 2020 18:50:37 -0700 Subject: [PATCH 25/26] Removing hardcoded name --- lemur/static/app/angular/authorities/authority/authority.js | 3 +-- .../angular/authorities/authority/distinguishedName.tpl.html | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lemur/static/app/angular/authorities/authority/authority.js b/lemur/static/app/angular/authorities/authority/authority.js index 4868709b..a449cff5 100644 --- a/lemur/static/app/angular/authorities/authority/authority.js +++ b/lemur/static/app/angular/authorities/authority/authority.js @@ -125,8 +125,7 @@ angular.module('lemur') }; $scope.populateSubjectEmail = function () { - if($scope.authority.plugin.title.toLowerCase() === 'cloudca') - $scope.authority.email = $scope.authority.owner; + $scope.authority.email = $scope.authority.owner; }; }); diff --git a/lemur/static/app/angular/authorities/authority/distinguishedName.tpl.html b/lemur/static/app/angular/authorities/authority/distinguishedName.tpl.html index ca3e1391..1303f200 100644 --- a/lemur/static/app/angular/authorities/authority/distinguishedName.tpl.html +++ b/lemur/static/app/angular/authorities/authority/distinguishedName.tpl.html @@ -49,7 +49,7 @@ -
- -

You must enter a location

+
- -

You must enter a - location

+