From 8303cfbd2bf7799b6636bf1e9d5a018f3b719888 Mon Sep 17 00:00:00 2001 From: Curtis Castrapel Date: Fri, 13 Apr 2018 14:53:45 -0700 Subject: [PATCH 1/7] Fix datetime --- lemur/plugins/lemur_digicert/plugin.py | 2 +- lemur/plugins/lemur_digicert/tests/test_digicert.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lemur/plugins/lemur_digicert/plugin.py b/lemur/plugins/lemur_digicert/plugin.py index 00fe9519..0e93f487 100644 --- a/lemur/plugins/lemur_digicert/plugin.py +++ b/lemur/plugins/lemur_digicert/plugin.py @@ -157,7 +157,7 @@ def map_cis_fields(options, csr): "csr": csr, "signature_hash": signature_hash(options.get('signing_algorithm')), "validity": { - "valid_to": options['validity_end'].format('YYYY-MM-DD') + "valid_to": options['validity_end'].format('YYYY-MM-DDTHH:MM:SS' + Z) }, "organization": { "name": options['organization'], diff --git a/lemur/plugins/lemur_digicert/tests/test_digicert.py b/lemur/plugins/lemur_digicert/tests/test_digicert.py index dca24892..7b19f318 100644 --- a/lemur/plugins/lemur_digicert/tests/test_digicert.py +++ b/lemur/plugins/lemur_digicert/tests/test_digicert.py @@ -103,7 +103,7 @@ def test_map_cis_fields(app): 'signature_hash': 'sha256', 'organization': {'name': 'Example, Inc.', 'units': ['Example Org']}, 'validity': { - 'valid_to': arrow.get(2017, 5, 7).format('YYYY-MM-DD') + 'valid_to': arrow.get(2017, 5, 7).format('YYYY-MM-DDTHH:MM:SS' + Z) }, 'profile_name': None } @@ -132,7 +132,7 @@ def test_map_cis_fields(app): 'signature_hash': 'sha256', 'organization': {'name': 'Example, Inc.', 'units': ['Example Org']}, 'validity': { - 'valid_to': arrow.get(2018, 11, 3).format('YYYY-MM-DD') + 'valid_to': arrow.get(2018, 11, 3).format('YYYY-MM-DDTHH:MM:SS' + Z) }, 'profile_name': None } From 4392657a7181456e0a57ac23a82f8a37b76e97e1 Mon Sep 17 00:00:00 2001 From: Titouan Christophe Date: Mon, 16 Apr 2018 19:41:28 +0200 Subject: [PATCH 2/7] [fix] Pip imports for pip 10 --- setup.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 9f5e2990..3cb731d2 100644 --- a/setup.py +++ b/setup.py @@ -16,14 +16,20 @@ import datetime from distutils import log from distutils.core import Command -from pip.download import PipSession -from pip.req import parse_requirements from setuptools.command.develop import develop from setuptools.command.install import install from setuptools.command.sdist import sdist from setuptools import setup, find_packages from subprocess import check_output +import pip +if tuple(map(int, pip.__version__.split('.'))) >= (10, 0, 0): + from pip._internal.download import PipSession + from pip._internal.req import parse_requirements +else: + from pip.download import PipSession + from pip.req import parse_requirements + ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__))) # When executing the setup.py, we need to be able to import ourselves, this From 4e94e512181759291dab571b9b39a4b3586b756b Mon Sep 17 00:00:00 2001 From: Titouan Christophe Date: Mon, 16 Apr 2018 20:15:25 +0200 Subject: [PATCH 3/7] [add] Reference lemur-influxdb as 3rd party plugin --- docs/administration.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/administration.rst b/docs/administration.rst index 1d50f280..b83c745b 100644 --- a/docs/administration.rst +++ b/docs/administration.rst @@ -1186,6 +1186,19 @@ Digicert https://github.com/opendns/lemur-digicert +InfluxDB +-------- + +:Authors: + Titouan Christophe +:Type: + Metric +:Description: + Sends key metrics to InfluxDB +:Links: + https://github.com/titouanc/lemur-influxdb + + Have an extension that should be listed here? Submit a `pull request `_ and we'll get it added. From b9e93065f71713efdaeef6f3850d4c10b39fbd56 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Thu, 19 Apr 2018 13:26:49 -0700 Subject: [PATCH 4/7] Removing the need for a separate requirements txt (#1214) --- docs/requirements.txt | 36 --------------------- requirements-docs.in | 1 + requirements-docs.txt | 73 +++++++++++++++++++++++++++++++++++++------ 3 files changed, 64 insertions(+), 46 deletions(-) delete mode 100644 docs/requirements.txt diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 5cb8b8b6..00000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,36 +0,0 @@ -CloudFlare==1.7.5 -Flask==0.12 -Flask-RESTful==0.3.6 -Flask-SQLAlchemy==2.1 -Flask-Script==2.0.5 -Flask-Migrate==2.1.1 -Flask-Bcrypt==0.7.1 -Flask-Principal==0.4.0 -Flask-Mail==0.9.1 -SQLAlchemy-Utils==0.32.14 -requests==2.11.1 -ndg-httpsclient==0.4.2 -psycopg2==2.7.3 -arrow==0.10.0 -six==1.10.0 -marshmallow-sqlalchemy==0.13.1 -gunicorn==19.7.1 -marshmallow==2.13.6 -cryptography==1.9 -xmltodict==0.11.0 -pyjwt==1.5.2 -lockfile==0.12.2 -inflection==0.3.1 -future==0.16.0 -boto3==1.4.6 -acme==0.18.1 -retrying==1.3.3 -tabulate==0.7.7 -pem==17.1.0 -raven[flask]==6.1.0 -jinja2==2.9.6 -# pyldap==2.4.37 # cannot be installed on rtd - required by ldap auth provider -paramiko==2.4.1 # required for the SFTP destination plugin -sphinx -sphinxcontrib-httpdomain -sphinx-rtd-theme diff --git a/requirements-docs.in b/requirements-docs.in index 8f1c7fe9..3dc923ba 100644 --- a/requirements-docs.in +++ b/requirements-docs.in @@ -1,3 +1,4 @@ +-r requirements.txt sphinx sphinxcontrib-httpdomain sphinx-rtd-theme \ No newline at end of file diff --git a/requirements-docs.txt b/requirements-docs.txt index a8b93db2..e62ea38f 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -4,24 +4,77 @@ # # pip-compile --no-index --output-file requirements-docs.txt requirements-docs.in # +acme==0.23.0 alabaster==0.7.10 # via sphinx +alembic-autogenerate-enums==0.0.2 +alembic==0.9.9 +aniso8601==3.0.0 +arrow==0.12.1 +asn1crypto==0.24.0 babel==2.5.3 # via sphinx -certifi==2018.1.18 # via requests -chardet==3.0.4 # via requests -docutils==0.14 # via sphinx -idna==2.6 # via requests +bcrypt==3.1.4 +blinker==1.4 +boto3==1.7.4 +botocore==1.10.4 +cffi==1.11.5 +click==6.7 +cryptography==2.2.2 +docutils==0.14 +flask-bcrypt==0.7.1 +flask-cors==3.0.3 +flask-mail==0.9.1 +flask-migrate==2.1.1 +flask-principal==0.4.0 +flask-restful==0.3.6 +flask-script==2.0.6 +flask-sqlalchemy==2.3.2 +flask==0.12 +future==0.16.0 +gunicorn==19.7.1 +idna==2.6 imagesize==1.0.0 # via sphinx -jinja2==2.10 # via sphinx -markupsafe==1.0 # via jinja2 +inflection==0.3.1 +itsdangerous==0.24 +jinja2==2.10 +jmespath==0.9.3 +josepy==1.0.1 +lockfile==0.12.2 +mako==1.0.7 +markupsafe==1.0 +marshmallow-sqlalchemy==0.13.2 +marshmallow==2.15.0 +mock==2.0.0 +ndg-httpsclient==0.4.4 packaging==17.1 # via sphinx +paramiko==2.4.1 +pbr==4.0.2 +pem==17.1.0 +psycopg2==2.7.4 +pyasn1-modules==0.2.1 +pyasn1==0.4.2 +pycparser==2.18 pygments==2.2.0 # via sphinx +pyjwt==1.6.1 +pynacl==1.2.1 +pyopenssl==17.2.0 pyparsing==2.2.0 # via packaging -pytz==2018.4 # via babel -requests==2.18.4 # via sphinx -six==1.11.0 # via packaging, sphinx, sphinxcontrib-httpdomain +pyrfc3339==1.0 +python-dateutil==2.6.1 +python-editor==1.0.3 +python-ldap==3.0.0 +pytz==2018.4 +raven[flask]==6.6.0 +requests[security]==2.11.1 +retrying==1.3.3 +s3transfer==0.1.13 +six==1.11.0 snowballstemmer==1.2.1 # via sphinx sphinx-rtd-theme==0.3.0 sphinx==1.7.2 sphinxcontrib-httpdomain==1.6.1 sphinxcontrib-websupport==1.0.1 # via sphinx -urllib3==1.22 # via requests +sqlalchemy-utils==0.33.2 +sqlalchemy==1.2.6 +tabulate==0.8.2 +werkzeug==0.14.1 +xmltodict==0.11.0 From a8ce2190160089fb7cd8b652d02807f75be9301a Mon Sep 17 00:00:00 2001 From: kevgliss Date: Thu, 19 Apr 2018 13:57:35 -0700 Subject: [PATCH 5/7] Readthedocs doesn't have the necessary c header files to build python-ldap. (#1215) --- requirements-docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.txt b/requirements-docs.txt index e62ea38f..63d5ebe8 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -61,7 +61,7 @@ pyparsing==2.2.0 # via packaging pyrfc3339==1.0 python-dateutil==2.6.1 python-editor==1.0.3 -python-ldap==3.0.0 +# python-ldap==3.0.0 can install due to readthedocs.io not having the correct header files pytz==2018.4 raven[flask]==6.6.0 requests[security]==2.11.1 From 552c07e93276afadd3b6003028308245981710b4 Mon Sep 17 00:00:00 2001 From: Curtis Castrapel Date: Mon, 23 Apr 2018 09:23:23 -0700 Subject: [PATCH 6/7] reqs update --- Makefile | 3 +++ requirements-dev.in | 2 ++ requirements-dev.txt | 6 +++--- requirements-docs.in | 3 +++ requirements-docs.txt | 15 +++++++-------- requirements-tests.in | 2 ++ requirements-tests.txt | 15 ++++++++------- requirements.in | 2 ++ requirements.txt | 12 ++++++------ 9 files changed, 36 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index 92181461..f740faab 100644 --- a/Makefile +++ b/Makefile @@ -109,12 +109,15 @@ ifndef VIRTUAL_ENV $(error Please activate virtualenv first) endif @echo "--> Updating Python requirements" + pip install --upgrade pip pip install --upgrade pip-tools pip-compile --output-file requirements-docs.txt requirements-docs.in -U --no-index pip-compile --output-file requirements-dev.txt requirements-dev.in -U --no-index pip-compile --output-file requirements-tests.txt requirements-tests.in -U --no-index pip-compile --output-file requirements.txt requirements.in -U --no-index @echo "--> Done updating Python requirements" + @echo "--> Removing python-ldap from requirements-docs.txt" + grep -v "python-ldap" requirements-docs.txt > tempreqs && mv tempreqs requirements-docs.txt @echo "--> Installing new dependencies" pip install -e . @echo "--> Done installing new dependencies" diff --git a/requirements-dev.in b/requirements-dev.in index 4e560267..de8b60d3 100644 --- a/requirements-dev.in +++ b/requirements-dev.in @@ -1,3 +1,5 @@ +# Run `make up-reqs` to update pinned dependencies in requirement text files + flake8>=3.2,<4.0 pre-commit invoke diff --git a/requirements-dev.txt b/requirements-dev.txt index f94fa610..356db421 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,11 +6,11 @@ # aspy.yaml==1.1.0 # via pre-commit cached-property==1.4.2 # via pre-commit -certifi==2018.1.18 # via requests +certifi==2018.4.16 # via requests cfgv==1.0.0 # via pre-commit chardet==3.0.4 # via requests flake8==3.5.0 -identify==1.0.11 # via pre-commit +identify==1.0.13 # via pre-commit idna==2.6 # via requests invoke==0.22.1 mccabe==0.6.1 # via flake8 @@ -23,7 +23,7 @@ pyyaml==3.12 # via aspy.yaml, pre-commit requests-toolbelt==0.8.0 # via twine requests==2.18.4 # via requests-toolbelt, twine six==1.11.0 # via cfgv, pre-commit -tqdm==4.22.0 # via twine +tqdm==4.23.0 # via twine twine==1.11.0 urllib3==1.22 # via requests virtualenv==15.2.0 # via pre-commit diff --git a/requirements-docs.in b/requirements-docs.in index 3dc923ba..4111ae2d 100644 --- a/requirements-docs.in +++ b/requirements-docs.in @@ -1,3 +1,6 @@ +# Note: python-ldap from requirements breaks docs because it requires compiled binary. +# The `make up-reqs` will update all requirement text files, and forcibly remove python-ldap +# from requirements-docs.txt -r requirements.txt sphinx sphinxcontrib-httpdomain diff --git a/requirements-docs.txt b/requirements-docs.txt index 63d5ebe8..9d388183 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -14,8 +14,8 @@ asn1crypto==0.24.0 babel==2.5.3 # via sphinx bcrypt==3.1.4 blinker==1.4 -boto3==1.7.4 -botocore==1.10.4 +boto3==1.7.6 +botocore==1.10.6 cffi==1.11.5 click==6.7 cryptography==2.2.2 @@ -37,7 +37,7 @@ inflection==0.3.1 itsdangerous==0.24 jinja2==2.10 jmespath==0.9.3 -josepy==1.0.1 +josepy==1.1.0 lockfile==0.12.2 mako==1.0.7 markupsafe==1.0 @@ -59,22 +59,21 @@ pynacl==1.2.1 pyopenssl==17.2.0 pyparsing==2.2.0 # via packaging pyrfc3339==1.0 -python-dateutil==2.6.1 +python-dateutil==2.7.2 python-editor==1.0.3 -# python-ldap==3.0.0 can install due to readthedocs.io not having the correct header files pytz==2018.4 -raven[flask]==6.6.0 +raven[flask]==6.7.0 requests[security]==2.11.1 retrying==1.3.3 s3transfer==0.1.13 six==1.11.0 snowballstemmer==1.2.1 # via sphinx sphinx-rtd-theme==0.3.0 -sphinx==1.7.2 +sphinx==1.7.3 sphinxcontrib-httpdomain==1.6.1 sphinxcontrib-websupport==1.0.1 # via sphinx sqlalchemy-utils==0.33.2 -sqlalchemy==1.2.6 +sqlalchemy==1.2.7 tabulate==0.8.2 werkzeug==0.14.1 xmltodict==0.11.0 diff --git a/requirements-tests.in b/requirements-tests.in index 44a5c59f..02a2b0ae 100644 --- a/requirements-tests.in +++ b/requirements-tests.in @@ -1,3 +1,5 @@ +# Run `make up-reqs` to update pinned dependencies in requirement text files + coverage factory-boy Faker diff --git a/requirements-tests.txt b/requirements-tests.txt index 4113ad2a..0c74eacb 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -7,14 +7,14 @@ asn1crypto==0.24.0 # via cryptography attrs==17.4.0 # via pytest aws-xray-sdk==0.95 # via moto -boto3==1.7.4 # via moto +boto3==1.7.6 # via moto boto==2.48.0 # via moto -botocore==1.10.4 # via boto3, moto, s3transfer -certifi==2018.1.18 # via requests +botocore==1.10.6 # via boto3, moto, s3transfer +certifi==2018.4.16 # via requests cffi==1.11.5 # via cryptography chardet==3.0.4 # via requests click==6.7 # via flask -cookies==2.2.1 # via moto +cookies==2.2.1 # via moto, responses coverage==4.5.1 cryptography==2.2.2 # via moto docker-pycreds==0.2.2 # via docker @@ -33,7 +33,7 @@ jsonpickle==0.9.6 # via aws-xray-sdk markupsafe==1.0 # via jinja2 mock==2.0.0 # via moto more-itertools==4.1.0 # via pytest -moto==1.3.1 +moto==1.3.3 nose==1.3.7 pbr==4.0.2 # via mock pluggy==0.6.0 # via pytest @@ -48,9 +48,10 @@ python-dateutil==2.6.1 # via botocore, faker, freezegun, moto pytz==2018.4 # via moto pyyaml==3.12 # via pyaml requests-mock==1.4.0 -requests==2.18.4 # via aws-xray-sdk, docker, moto, requests-mock +requests==2.18.4 # via aws-xray-sdk, docker, moto, requests-mock, responses +responses==0.9.0 # via moto s3transfer==0.1.13 # via boto3 -six==1.11.0 # via cryptography, docker, docker-pycreds, faker, freezegun, mock, more-itertools, moto, pytest, python-dateutil, requests-mock, websocket-client +six==1.11.0 # via cryptography, docker, docker-pycreds, faker, freezegun, mock, more-itertools, moto, pytest, python-dateutil, requests-mock, responses, websocket-client text-unidecode==1.2 # via faker urllib3==1.22 # via requests websocket-client==0.47.0 # via docker diff --git a/requirements.in b/requirements.in index 90a48170..a5fe2317 100644 --- a/requirements.in +++ b/requirements.in @@ -1,3 +1,5 @@ +# Run `make up-reqs` to update pinned dependencies in requirement text files + acme alembic-autogenerate-enums arrow diff --git a/requirements.txt b/requirements.txt index 5e8ef031..23f1f28f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,8 +12,8 @@ arrow==0.12.1 asn1crypto==0.24.0 # via cryptography bcrypt==3.1.4 # via flask-bcrypt, paramiko blinker==1.4 # via flask-mail, flask-principal, raven -boto3==1.7.4 -botocore==1.10.4 # via boto3, s3transfer +boto3==1.7.6 +botocore==1.10.6 # via boto3, s3transfer cffi==1.11.5 # via bcrypt, cryptography, pynacl click==6.7 # via flask cryptography==2.2.2 @@ -34,7 +34,7 @@ inflection==0.3.1 itsdangerous==0.24 # via flask jinja2==2.10 jmespath==0.9.3 # via boto3, botocore -josepy==1.0.1 # via acme +josepy==1.1.0 # via acme lockfile==0.12.2 mako==1.0.7 # via alembic markupsafe==1.0 # via jinja2, mako @@ -53,17 +53,17 @@ pyjwt==1.6.1 pynacl==1.2.1 # via paramiko pyopenssl==17.2.0 pyrfc3339==1.0 # via acme -python-dateutil==2.6.1 # via alembic, arrow, botocore +python-dateutil==2.7.2 # via alembic, arrow, botocore python-editor==1.0.3 # via alembic python-ldap==3.0.0 pytz==2018.4 # via acme, flask-restful, pyrfc3339 -raven[flask]==6.6.0 +raven[flask]==6.7.0 requests[security]==2.11.1 retrying==1.3.3 s3transfer==0.1.13 # via boto3 six==1.11.0 sqlalchemy-utils==0.33.2 -sqlalchemy==1.2.6 # via alembic, flask-sqlalchemy, marshmallow-sqlalchemy, sqlalchemy-utils +sqlalchemy==1.2.7 # via alembic, flask-sqlalchemy, marshmallow-sqlalchemy, sqlalchemy-utils tabulate==0.8.2 werkzeug==0.14.1 # via flask xmltodict==0.11.0 From 7e36b0e8fd25e798e29f86f36074b873a1f7e985 Mon Sep 17 00:00:00 2001 From: Curtis Castrapel Date: Mon, 23 Apr 2018 09:26:36 -0700 Subject: [PATCH 7/7] comment --- requirements-docs.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-docs.in b/requirements-docs.in index 4111ae2d..cf598240 100644 --- a/requirements-docs.in +++ b/requirements-docs.in @@ -1,4 +1,4 @@ -# Note: python-ldap from requirements breaks docs because it requires compiled binary. +# Note: python-ldap from requirements breaks due to readthedocs.io not having the correct header files # The `make up-reqs` will update all requirement text files, and forcibly remove python-ldap # from requirements-docs.txt -r requirements.txt