Various minor cleanups and fixes (#938)

* Documentation fixes

* Various docstring and help string fixes

* Minor code cleanups

* Removed redundant .gitignore entry, ignored package-lock.json.
* 'return' statement in certificates.service.render was redundant
* Split up too long line
* Non-matching tags in templates
This commit is contained in:
Marti Raudsepp
2017-09-26 01:33:42 +03:00
committed by kevgliss
parent ec5dec4a16
commit 97d83890e0
21 changed files with 48 additions and 48 deletions

View File

@ -132,8 +132,8 @@ class Ping(Resource):
this example we use an OpenIDConnect authentication flow, that is essentially OAuth2 underneath. If you have an
OAuth2 provider you want to use Lemur there would be two steps:
1. Define your own class that inherits from :class:`flask.ext.restful.Resource` and create the HTTP methods the \
provider uses for it's callbacks.
1. Define your own class that inherits from :class:`flask_restful.Resource` and create the HTTP methods the \
provider uses for its callbacks.
2. Add or change the Lemur AngularJS Configuration to point to your new provider
"""
def __init__(self):

View File

@ -146,7 +146,7 @@ class CertificateNestedOutputSchema(LemurOutputSchema):
notify = fields.Boolean()
rotation_policy = fields.Nested(RotationPolicyNestedOutputSchema)
# Note aliasing is the first step in deprecating these fields.
# Note aliasing is the first step in deprecating these fields.
cn = fields.String() # deprecated
common_name = fields.String(attribute='cn')
@ -177,7 +177,7 @@ class CertificateOutputSchema(LemurOutputSchema):
rotation = fields.Boolean()
# Note aliasing is the first step in deprecating these fields.
# Note aliasing is the first step in deprecating these fields.
notify = fields.Boolean()
active = fields.Boolean(attribute='notify')

View File

@ -291,7 +291,6 @@ def render(args):
Certificate.authority_id.in_(sub_query)
)
)
return database.sort_and_page(query, Certificate, args)
elif 'destination' in terms:
query = query.filter(Certificate.destinations.any(Destination.id == terms[1]))

View File

@ -19,7 +19,7 @@ def ocsp_verify(cert_path, issuer_chain_path):
"""
Attempts to verify a certificate via OCSP. OCSP is a more modern version
of CRL in that it will query the OCSP URI in order to determine if the
certificate as been revoked
certificate has been revoked
:param cert_path:
:param issuer_chain_path:

View File

@ -84,7 +84,7 @@ class CertificatesList(AuthenticatedResource):
"deleted": null,
"notifications": [{
"id": 1
}]
}],
"signingAlgorithm": "sha256",
"user": {
"username": "jane",
@ -169,7 +169,7 @@ class CertificatesList(AuthenticatedResource):
},
"replacements": [{
"id": 1
},
}],
"notify": true,
"validityEnd": "2026-01-01T08:00:00.000Z",
"authority": {
@ -215,7 +215,7 @@ class CertificatesList(AuthenticatedResource):
"deleted": null,
"notifications": [{
"id": 1
}]
}],
"signingAlgorithm": "sha256",
"user": {
"username": "jane",
@ -232,7 +232,7 @@ class CertificatesList(AuthenticatedResource):
"replaces": [{
"id": 1
}],
"rotation": True,
"rotation": true,
"rotationPolicy": {"name": "default"},
"name": "WILDCARD.test.example.net-SymantecCorporation-20160603-20180112",
"roles": [{
@ -331,7 +331,7 @@ class CertificatesUpload(AuthenticatedResource):
"deleted": null,
"notifications": [{
"id": 1
}]
}],
"signingAlgorithm": "sha256",
"user": {
"username": "jane",
@ -346,7 +346,7 @@ class CertificatesUpload(AuthenticatedResource):
"name": "*.test.example.net"
}],
"replaces": [],
"rotation": True,
"rotation": true,
"rotationPolicy": {"name": "default"},
"name": "WILDCARD.test.example.net-SymantecCorporation-20160603-20180112",
"roles": [{
@ -417,7 +417,7 @@ class CertificatePrivateKey(AuthenticatedResource):
Content-Type: text/javascript
{
"key": "-----BEGIN ...",
"key": "-----BEGIN ..."
}
:reqheader Authorization: OAuth token to authenticate
@ -495,7 +495,7 @@ class Certificates(AuthenticatedResource):
"deleted": null,
"notifications": [{
"id": 1
}]
}],
"signingAlgorithm": "sha256",
"user": {
"username": "jane",
@ -509,7 +509,7 @@ class Certificates(AuthenticatedResource):
"id": 1090,
"name": "*.test.example.net"
}],
"rotation": True,
"rotation": true,
"rotationPolicy": {"name": "default"},
"replaces": [],
"replaced": [],
@ -605,7 +605,7 @@ class Certificates(AuthenticatedResource):
"description": "This is a google group based role created by Lemur",
"name": "joe@example.com"
}],
"rotation": True,
"rotation": true,
"rotationPolicy": {"name": "default"},
"san": null
}
@ -697,7 +697,7 @@ class NotificationCertificatesList(AuthenticatedResource):
"deleted": null,
"notifications": [{
"id": 1
}]
}],
"signingAlgorithm": "sha256",
"user": {
"username": "jane",
@ -713,7 +713,7 @@ class NotificationCertificatesList(AuthenticatedResource):
}],
"replaces": [],
"replaced": [],
"rotation": True,
"rotation": true,
"rotationPolicy": {"name": "default"},
"name": "WILDCARD.test.example.net-SymantecCorporation-20160603-20180112",
"roles": [{
@ -820,7 +820,7 @@ class CertificatesReplacementsList(AuthenticatedResource):
}],
"replaces": [],
"replaced": [],
"rotation": True,
"rotation": true,
"rotationPolicy": {"name": "default"},
"name": "WILDCARD.test.example.net-SymantecCorporation-20160603-20180112",
"roles": [{

View File

@ -9,7 +9,7 @@ THREADS_PER_PAGE = 8
# These will need to be set to `True` if you are developing locally
CORS = False
debug = False
DEBUG = False
# Logging

View File

@ -188,8 +188,10 @@ def install_plugins(app):
# ensure that we have some way to notify
with app.app_context():
slug = app.config.get("LEMUR_DEFAULT_NOTIFICATION_PLUGIN", "email-notification")
try:
slug = app.config.get("LEMUR_DEFAULT_NOTIFICATION_PLUGIN", "email-notification")
plugins.get(slug)
except KeyError:
raise Exception("Unable to location notification plugin: {slug}. Ensure that LEMUR_DEFAULT_NOTIFICATION_PLUGIN is set to a valid and installed notification plugin.".format(slug=slug))
raise Exception("Unable to location notification plugin: {slug}. Ensure that "
"LEMUR_DEFAULT_NOTIFICATION_PLUGIN is set to a valid and installed notification plugin."
.format(slug=slug))

View File

@ -375,7 +375,7 @@ class LemurServer(Command):
app = WSGIApplication()
# run startup tasks on a app like object
# run startup tasks on an app like object
validate_conf(current_app, REQUIRED_VARIABLES)
app.app_uri = 'lemur:create_app(config="{0}")'.format(current_app.config.get('CONFIG_PATH'))

View File

@ -143,7 +143,7 @@ def send_expiration_notifications(exclude):
def send_rotation_notification(certificate, notification_plugin=None):
"""
Sends a report to certificate owners when their certificate as been
Sends a report to certificate owners when their certificate has been
rotated.
:param certificate:

View File

@ -101,7 +101,7 @@ class IPlugin(local):
Returns a list of tuples pointing to various resources for this plugin.
>>> def get_resource_links(self):
>>> return [
>>> ('Documentation', 'http://lemury.readthedocs.org'),
>>> ('Documentation', 'https://lemur.readthedocs.io'),
>>> ('Bug Tracker', 'https://github.com/Netflix/lemur/issues'),
>>> ('Source', 'https://github.com/Netflix/lemur'),
>>> ]

View File

@ -98,7 +98,7 @@ def get_all_elbs_v2(**kwargs):
@retry(retry_on_exception=retry_throttled, stop_max_attempt_number=7, wait_exponential_multiplier=1000)
def get_listener_arn_from_endpoint(endpoint_name, endpoint_port, **kwargs):
"""
Get a listener ARN from a endpoint.
Get a listener ARN from an endpoint.
:param endpoint_name:
:param endpoint_port:
:return:

View File

@ -62,7 +62,7 @@ class LinuxDstPlugin(DestinationPlugin):
"name": "exportType",
"required": True,
"value": "NGINX",
"helpMessage": "Reference the docs for an explaination of each export type",
"helpMessage": "Reference the docs for an explanation of each export type",
"type": "select"
}
]

View File

@ -19,7 +19,7 @@ def copy_cert(cert_cn, dst_user, dst_priv, dst_priv_key, dst_host, dst_port, dst
sftp = ssh.open_sftp()
# make the directory on the destination server
# files will be in a a folder based on the cert_cn
# files will be in a folder based on the cert_cn
# example:
# destination folder: /etc/nginx/certs/
# files will go in: /etc/nginx/certs/your.cn.com/cert.pem

View File

@ -98,7 +98,7 @@ class OpenSSLExportPlugin(ExportPlugin):
'name': 'passphrase',
'type': 'str',
'required': False,
'helpMessage': 'If no passphrase is given one will be generated for you, we highly recommend this. Minimum length is 8.',
'helpMessage': 'If no passphrase is given one will be generated for you, we highly recommend this.',
'validation': ''
},
{
@ -111,7 +111,7 @@ class OpenSSLExportPlugin(ExportPlugin):
def export(self, body, chain, key, options, **kwargs):
"""
Generates a Java Keystore or Truststore
Generates a PKCS#12 archive.
:param key:
:param chain:

View File

@ -113,7 +113,7 @@
<span class="pull-right">{{ certificate.serialHex }}</span>
</li>
<li
uib-tooltip="Lemur will attempt to check a certificates validity, this is used to track whether a certificate as been revoked"
uib-tooltip="Lemur will attempt to check a certificates validity, this is used to track whether a certificate has been revoked"
class="list-group-item">
<strong>Validity</strong>
<span class="pull-right">
@ -179,7 +179,7 @@
<ul class="list-group">
<li class="list-group-item" ng-repeat="replaces in certificate.replaces">
<strong>{{ replaces.name }}</strong>
<p>{{ replaces.description}}</p>
<p>{{ replaces.description }}</p>
</li>
</ul>
</uib-tab>
@ -221,4 +221,3 @@
</div>
</div>
</div>
</div>

View File

@ -45,7 +45,7 @@ angular.module('lemur')
body: 'Unable to update! ' + response.data.message,
timeout: 100000
});
domain.sensitive = domain.sensitive ? false : true;
domain.sensitive = !domain.sensitive;
});
};

View File

@ -95,7 +95,7 @@
<div class="container">
<p class="text-muted">
<span>Lemur is broken regularly by <a href="https://github.com/Netflix/lemur.git">Netflix</a>.</span>
<span class="pull-right">Confused? Check out our <a href="https://lemur.readthedocs.org/en/latest">docs</a>!</span>
<span class="pull-right">Confused? Check out our <a href="https://lemur.readthedocs.io/en/latest">docs</a>!</span>
</p>
</div>
</footer>