Rotation ui (#633)

* Adding rotation to the UI.

* Removing spinkit dependency.
This commit is contained in:
kevgliss 2016-12-26 15:55:11 -08:00 committed by GitHub
parent ce75bba2c3
commit 700c57b807
18 changed files with 417 additions and 391 deletions

View File

@ -20,7 +20,6 @@
"angular-loading-bar": "~0.8.0", "angular-loading-bar": "~0.8.0",
"angular-moment": "~0.10.3", "angular-moment": "~0.10.3",
"moment-range": "~2.1.0", "moment-range": "~2.1.0",
"angular-spinkit": "~0.3.3",
"angular-clipboard": "~1.3.0", "angular-clipboard": "~1.3.0",
"angularjs-toaster": "~1.0.0", "angularjs-toaster": "~1.0.0",
"angular-chart.js": "~0.8.8", "angular-chart.js": "~0.8.8",

View File

@ -196,6 +196,8 @@ def reissue(old_certificate_name, commit):
if commit: if commit:
print("[!] Running in COMMIT mode.") print("[!] Running in COMMIT mode.")
print("[+] Starting certificate re-issuance.")
old_cert = validate_certificate(old_certificate_name) old_cert = validate_certificate(old_certificate_name)
if not old_cert: if not old_cert:

View File

@ -66,7 +66,7 @@ class Certificate(db.Model):
bits = Column(Integer()) bits = Column(Integer())
san = Column(String(1024)) # TODO this should be migrated to boolean san = Column(String(1024)) # TODO this should be migrated to boolean
rotation = Column(Boolean) rotation = Column(Boolean, default=False)
user_id = Column(Integer, ForeignKey('users.id')) user_id = Column(Integer, ForeignKey('users.id'))
authority_id = Column(Integer, ForeignKey('authorities.id', ondelete="CASCADE")) authority_id = Column(Integer, ForeignKey('authorities.id', ondelete="CASCADE"))

View File

@ -62,6 +62,7 @@ class CertificateInputSchema(CertificateCreationSchema):
key_type = fields.String(validate=validate.OneOf(['RSA2048', 'RSA4096']), missing='RSA2048') key_type = fields.String(validate=validate.OneOf(['RSA2048', 'RSA4096']), missing='RSA2048')
notify = fields.Boolean(default=True) notify = fields.Boolean(default=True)
rotation = fields.Boolean()
# certificate body fields # certificate body fields
organizational_unit = fields.String(missing=lambda: current_app.config.get('LEMUR_DEFAULT_ORGANIZATIONAL_UNIT')) organizational_unit = fields.String(missing=lambda: current_app.config.get('LEMUR_DEFAULT_ORGANIZATIONAL_UNIT'))
@ -84,9 +85,11 @@ class CertificateInputSchema(CertificateCreationSchema):
class CertificateEditInputSchema(CertificateSchema): class CertificateEditInputSchema(CertificateSchema):
notify = fields.Boolean()
owner = fields.String() owner = fields.String()
notify = fields.Boolean()
rotation = fields.Boolean()
destinations = fields.Nested(AssociatedDestinationSchema, missing=[], many=True) destinations = fields.Nested(AssociatedDestinationSchema, missing=[], many=True)
notifications = fields.Nested(AssociatedNotificationSchema, missing=[], many=True) notifications = fields.Nested(AssociatedNotificationSchema, missing=[], many=True)
replaces = fields.Nested(AssociatedCertificateSchema, missing=[], many=True) replaces = fields.Nested(AssociatedCertificateSchema, missing=[], many=True)
@ -116,12 +119,20 @@ class CertificateEditInputSchema(CertificateSchema):
class CertificateNestedOutputSchema(LemurOutputSchema): class CertificateNestedOutputSchema(LemurOutputSchema):
__envelope__ = False __envelope__ = False
id = fields.Integer() id = fields.Integer()
active = fields.Boolean() name = fields.String()
owner = fields.Email()
creator = fields.Nested(UserNestedOutputSchema)
description = fields.String()
status = fields.Boolean()
bits = fields.Integer() bits = fields.Integer()
body = fields.String() body = fields.String()
chain = fields.String() chain = fields.String()
description = fields.String() active = fields.Boolean()
name = fields.String()
rotation = fields.Boolean()
notify = fields.Boolean()
# Note aliasing is the first step in deprecating these fields. # Note aliasing is the first step in deprecating these fields.
cn = fields.String() # deprecated cn = fields.String() # deprecated
@ -133,9 +144,6 @@ class CertificateNestedOutputSchema(LemurOutputSchema):
not_before = fields.DateTime() # deprecated not_before = fields.DateTime() # deprecated
validity_start = ArrowDateTime(attribute='not_before') validity_start = ArrowDateTime(attribute='not_before')
owner = fields.Email()
status = fields.Boolean()
creator = fields.Nested(UserNestedOutputSchema)
issuer = fields.Nested(AuthorityNestedOutputSchema) issuer = fields.Nested(AuthorityNestedOutputSchema)
@ -155,6 +163,8 @@ class CertificateOutputSchema(LemurOutputSchema):
issuer = fields.String() issuer = fields.String()
name = fields.String() name = fields.String()
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() notify = fields.Boolean()
active = fields.Boolean(attribute='notify') active = fields.Boolean(attribute='notify')

View File

@ -126,26 +126,16 @@ def export(cert, export_plugin):
return plugin.export(cert.body, cert.chain, cert.private_key, export_plugin['pluginOptions']) return plugin.export(cert.body, cert.chain, cert.private_key, export_plugin['pluginOptions'])
def update(cert_id, owner, description, notify, destinations, notifications, replaces, roles): def update(cert_id, **kwargs):
""" """
Updates a certificate Updates a certificate
:param cert_id: :param cert_id:
:param owner:
:param description:
:param notify:
:param destinations:
:param notifications:
:param replaces:
:return: :return:
""" """
cert = get(cert_id) cert = get(cert_id)
cert.notify = notify
cert.description = description for key, value in kwargs.items():
cert.destinations = destinations setattr(cert, key, value)
cert.notifications = notifications
cert.roles = roles
cert.replaces = replaces
cert.owner = owner
return database.update(cert) return database.update(cert)
@ -555,7 +545,7 @@ def reissue_certificate(certificate, replace=None, user=None):
primitives['creator'] = user primitives['creator'] = user
if replace: if replace:
primitives['replacements'] = [certificate] primitives['replaces'] = [certificate]
new_cert = create(**primitives) new_cert = create(**primitives)

View File

@ -638,18 +638,13 @@ class Certificates(AuthenticatedResource):
for destination in data['destinations']: for destination in data['destinations']:
if destination.plugin.requires_key: if destination.plugin.requires_key:
if not cert.private_key: if not cert.private_key:
return dict(message='Unable to add destination: {0}. Certificate does not have required private key.'.format(destination.label)), 400 return dict(
message='Unable to add destination: {0}. Certificate does not have required private key.'.format(
return service.update( destination.label
certificate_id,
data['owner'],
data['description'],
data['notify'],
data['destinations'],
data['notifications'],
data['replacements'],
data['roles']
) )
), 400
return service.update(certificate_id)
class NotificationCertificatesList(AuthenticatedResource): class NotificationCertificatesList(AuthenticatedResource):

View File

@ -10,7 +10,6 @@
'restangular', 'restangular',
'angular-loading-bar', 'angular-loading-bar',
'ui.bootstrap', 'ui.bootstrap',
'angular-spinkit',
'toaster', 'toaster',
'uiSwitch', 'uiSwitch',
'mgo-angular-wizard', 'mgo-angular-wizard',

View File

@ -8,12 +8,12 @@
<wz-step title="Tracking" canexit="trackingForm.$valid"> <wz-step title="Tracking" canexit="trackingForm.$valid">
<ng-include src="'angular/certificates/certificate/tracking.tpl.html'"></ng-include> <ng-include src="'angular/certificates/certificate/tracking.tpl.html'"></ng-include>
</wz-step> </wz-step>
<wz-step title="Distinguished Name" canenter="exitTracking" canexit="exitDN"> <wz-step title="Options" canenter="exitTracking">
<ng-include src="'angular/certificates/certificate/distinguishedName.tpl.html'"></ng-include>
</wz-step>
<wz-step title="Options" canenter="enterValidation">
<ng-include src="'angular/certificates/certificate/options.tpl.html'"></ng-include> <ng-include src="'angular/certificates/certificate/options.tpl.html'"></ng-include>
</wz-step> </wz-step>
<wz-step title="Distinguished Name" canenter="exitValidation">
<ng-include src="'angular/certificates/certificate/distinguishedName.tpl.html'"></ng-include>
</wz-step>
</wizard> </wizard>
</div> </div>
</div> </div>

View File

@ -1,5 +1,16 @@
<form name="dnForm" novalidate> <form name="dnForm" novalidate>
<div class="form-horizontal"> <div class="form-horizontal">
<div class="form-group"
ng-class="{'has-error': dnForm.name.$invalid, 'has-success': !dnForm.name.$invalid&&dnForm.name.$dirty}">
<label class="control-label col-sm-2">
Custom Certificate Name
</label>
<div class="col-sm-10">
<input name="name" ng-model="certificate.name"
placeholder="the.example.net-SymantecCorporation-20150828-20160830" class="form-control"
uib-tooltip="If no name is provided, Lemur will generate a name for you">
</div>
</div>
<div class="form-group" <div class="form-group"
ng-class="{'has-error': dnForm.country.$invalid, 'has-success': !dnForm.country.$invalid&&dnForm.country.$dirty}"> ng-class="{'has-error': dnForm.country.$invalid, 'has-success': !dnForm.country.$invalid&&dnForm.country.$dirty}">
<label class="control-label col-sm-2"> <label class="control-label col-sm-2">
@ -7,7 +18,8 @@
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<input name="country" ng-model="certificate.country" placeholder="Country" class="form-control" required/> <input name="country" ng-model="certificate.country" placeholder="Country" class="form-control" required/>
<p ng-show="dnForm.country.$invalid && !dnForm.country.$pristine" class="help-block">You must enter a country</p> <p ng-show="dnForm.country.$invalid && !dnForm.country.$pristine" class="help-block">You must enter a
country</p>
</div> </div>
</div> </div>
<div class="form-group" <div class="form-group"
@ -27,7 +39,8 @@
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<input name="location" ng-model="certificate.location" placeholder="Location" class="form-control" required/> <input name="location" ng-model="certificate.location" placeholder="Location" class="form-control" required/>
<p ng-show="dnForm.location.$invalid && !dnForm.location.$pristine" class="help-block">You must enter a location</p> <p ng-show="dnForm.location.$invalid && !dnForm.location.$pristine" class="help-block">You must enter a
location</p>
</div> </div>
</div> </div>
<div class="form-group" <div class="form-group"
@ -36,8 +49,10 @@
Organization Organization
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<input name="organization" ng-model="certificate.organization" placeholder="Organization" class="form-control" required/> <input name="organization" ng-model="certificate.organization" placeholder="Organization" class="form-control"
<p ng-show="dnForm.organization.$invalid && !dnForm.organization.$pristine" class="help-block">You must enter a organization</p> required/>
<p ng-show="dnForm.organization.$invalid && !dnForm.organization.$pristine" class="help-block">You must enter a
organization</p>
</div> </div>
</div> </div>
<div class="form-group" <div class="form-group"
@ -46,8 +61,10 @@
Organizational Unit Organizational Unit
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<input name="organizationalUnit" ng-model="certificate.organizationalUnit" placeholder="Organizational Unit" class="form-control" required/> <input name="organizationalUnit" ng-model="certificate.organizationalUnit" placeholder="Organizational Unit"
<p ng-show="dnForm.organization.$invalid && !dnForm.organizationalUnit.$pristine" class="help-block">You must enter a organizational unit</p> class="form-control" required/>
<p ng-show="dnForm.organization.$invalid && !dnForm.organizationalUnit.$pristine" class="help-block">You must
enter a organizational unit</p>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,5 +1,6 @@
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" ng-click="cancel()" aria-label="Close"><span aria-hidden="true">&times;</span></button> <button type="button" class="close" ng-click="cancel()" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
<h3 class="modal-title">Edit <span class="text-muted"><small>{{ certificate.name }}</small></span></h3> <h3 class="modal-title">Edit <span class="text-muted"><small>{{ certificate.name }}</small></span></h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">
@ -23,8 +24,11 @@
Description Description
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<textarea name="description" ng-model="certificate.description" placeholder="Something elegant" class="form-control" required></textarea> <textarea name="description" ng-model="certificate.description" placeholder="Something elegant"
<p ng-show="editForm.description.$invalid && !editForm.description.$pristine" class="help-block">You must give a short description about this authority will be used for, this description should only include alphanumeric characters</p> class="form-control" required></textarea>
<p ng-show="editForm.description.$invalid && !editForm.description.$pristine" class="help-block">You must give a
short description about this authority will be used for, this description should only include alphanumeric
characters</p>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -35,10 +39,18 @@
</div> </div>
<div ng-include="'angular/certificates/certificate/replaces.tpl.html'"></div> <div ng-include="'angular/certificates/certificate/replaces.tpl.html'"></div>
<div ng-include="'angular/certificates/certificate/notifications.tpl.html'"></div> <div ng-include="'angular/certificates/certificate/notifications.tpl.html'"></div>
<div ng-include="'angular/certificates/certificate/destinations.tpl.html'"></div>
<div class="form-group">
<label class="control-label col-sm-2">Auto Rotate</label>
<div class="col-sm-10">
<switch ng-model="certificate.rotation" id="active" name="active" class="green small"
uib-tooltip="If selected, new certificates will be automatically re-issued and re-deployed onto known endpoints."></switch>
</div>
</div>
</form> </form>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="submit" ng-click="save(certificate)" ng-disabled="editForm.$invalid" class="btn btn-success">Save</button> <button type="submit" ng-click="save(certificate)" ng-disabled="editForm.$invalid" class="btn btn-success">Save
</button>
<button ng-click="cancel()" class="btn btn-danger">Cancel</button> <button ng-click="cancel()" class="btn btn-danger">Cancel</button>
</div> </div>

View File

@ -1,16 +1,44 @@
<form name="optionsForm" novalidate> <form name="optionsForm" novalidate>
<div class="form-horizontal"> <div class="form-horizontal">
<div> <div>
<div class="form-group">
<label class="control-label col-sm-2">
Certificate Template
</label>
<div class="col-sm-10">
<select class="form-control" ng-change="certificate.useTemplate()" name="certificateTemplate"
ng-model="certificate.template" ng-options="template.name for template in templates"></select>
</div>
</div>
<div class="form-group"
ng-class="{'has-error': trackingForm.csr.$invalid&&trackingForm.csr.$dirty, 'has-success': !trackingForm.csr.$invalid&&trackingForm.csr.$dirty}">
<label class="control-label col-sm-2">
Certificate Signing Request (CSR)
</label>
<div class="col-sm-10">
<textarea uib-tooltip="Values defined in the CSR will take precedence"
name="certificate signing request"
ng-model="certificate.csr"
placeholder="PEM encoded string..." class="form-control"
ng-pattern="/^-----BEGIN CERTIFICATE REQUEST-----/"></textarea>
<p ng-show="trackingForm.csr.$invalid && !trackingForm.csr.$pristine"
class="help-block">Enter a valid certificate signing request.</p>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2"> <label class="control-label col-sm-2">
Subject Alternate Names Subject Alternate Names
</label> </label>
<div class="col-sm-3"> <div class="col-sm-3">
<select class="form-control" ng-model="certificate.subAltType" ng-options="item for item in ['DNSName', 'IPAddress', 'uniformResourceIdentifier', 'directoryName','rfc822Name', 'registeredID', 'otherName', 'x400Address', 'EDIPartyName']"></select> <select class="form-control" ng-model="certificate.subAltType"
ng-options="item for item in ['DNSName', 'IPAddress', 'uniformResourceIdentifier', 'directoryName','rfc822Name', 'registeredID', 'otherName', 'x400Address', 'EDIPartyName']"></select>
</div> </div>
<div class="col-sm-6"> <div class="col-sm-6">
<div class="input-group"> <div class="input-group">
<input tooltip-trigger="focus" tooltip-placement="top" uib-tooltip="String or Base64-encoded DER ASN.1 structure for the value" class="form-control" name="value" ng-model="certificate.subAltValue" placeholder="Value" class="form-control" required/> <input tooltip-trigger="focus" tooltip-placement="top"
uib-tooltip="String or Base64-encoded DER ASN.1 structure for the value" class="form-control"
name="value" ng-model="certificate.subAltValue" placeholder="Value" class="form-control" required/>
<span class="input-group-btn"> <span class="input-group-btn">
<button ng-click="certificate.attachSubAltName()" class="btn btn-info">Add</button> <button ng-click="certificate.attachSubAltName()" class="btn btn-info">Add</button>
</span> </span>
@ -24,7 +52,9 @@
<td>{{ alt.nameType }}</td> <td>{{ alt.nameType }}</td>
<td>{{ alt.value }}</td> <td>{{ alt.value }}</td>
<td> <td>
<button type="button" ng-click="certificate.removeSubAltName($index)" class="btn btn-danger btn-sm pull-right">Remove</button> <button type="button" ng-click="certificate.removeSubAltName($index)"
class="btn btn-danger btn-sm pull-right">Remove
</button>
</td> </td>
</tr> </tr>
</table> </table>
@ -35,7 +65,9 @@
Key Type Key Type
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<select class="form-control" ng-model="certificate.keyType" ng-options="option for option in ['RSA2048', 'RSA4096']" ng-init="certificate.keyType = 'RSA2048'"></select> <select class="form-control" ng-model="certificate.keyType"
ng-options="option for option in ['RSA2048', 'RSA4096']"
ng-init="certificate.keyType = 'RSA2048'"></select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -99,12 +131,14 @@
<div class="col-sm-3"> <div class="col-sm-3">
<div class="checkbox"> <div class="checkbox">
<label> <label>
<input type="checkbox" ng-model="certificate.extensions.extendedKeyUsage.useServerAuthentication">Server Authentication <input type="checkbox" ng-model="certificate.extensions.extendedKeyUsage.useServerAuthentication">Server
Authentication
</label> </label>
</div> </div>
<div class="checkbox"> <div class="checkbox">
<label> <label>
<input type="checkbox" ng-model="certificate.extensions.extendedKeyUsage.useClientAuthentication">Client Authentication <input type="checkbox" ng-model="certificate.extensions.extendedKeyUsage.useClientAuthentication">Client
Authentication
</label> </label>
</div> </div>
<div class="checkbox"> <div class="checkbox">
@ -131,7 +165,8 @@
</div> </div>
<div class="checkbox"> <div class="checkbox">
<label> <label>
<input type="checkbox" ng-model="certificate.extensions.extendedKeyUsage.useSmartCardLogon">Smartcard Logon <input type="checkbox" ng-model="certificate.extensions.extendedKeyUsage.useSmartCardLogon">Smartcard
Logon
</label> </label>
</div> </div>
<div class="checkbox"> <div class="checkbox">
@ -147,13 +182,17 @@
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<div class="checkbox"> <div class="checkbox">
<label tooltip-trigger="mouseenter" tooltip-placement="top" uib-tooltip="Put Issuer's keyIdentifier in this extension" > <label tooltip-trigger="mouseenter" tooltip-placement="top"
<input type="checkbox" ng-model="certificate.extensions.authorityKeyIdentifier.useKeyIdentifier">Key Identifier uib-tooltip="Put Issuer's keyIdentifier in this extension">
<input type="checkbox" ng-model="certificate.extensions.authorityKeyIdentifier.useKeyIdentifier">Key
Identifier
</label> </label>
</div> </div>
<div class="checkbox"> <div class="checkbox">
<label tooltip-trigger="mouseenter" tooltip-placement="top" uib-tooltip="Put Issuer's Name and Serial number" > <label tooltip-trigger="mouseenter" tooltip-placement="top"
<input type="checkbox" ng-model="certificate.extensions.authorityIdentifier.useAuthorityCert">Authority Certificate uib-tooltip="Put Issuer's Name and Serial number">
<input type="checkbox" ng-model="certificate.extensions.authorityIdentifier.useAuthorityCert">Authority
Certificate
</label> </label>
</div> </div>
</div> </div>
@ -164,7 +203,8 @@
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<div class="checkbox"> <div class="checkbox">
<label tooltip-trigger="mouseenter" tooltip-placement="top" uib-tooltip="Ask CA to include/not include AIA extension" > <label tooltip-trigger="mouseenter" tooltip-placement="top"
uib-tooltip="Ask CA to include/not include AIA extension">
<input type="checkbox" ng-model="certificate.extensions.certificateInfoAccess.includeAIA">Include AIA <input type="checkbox" ng-model="certificate.extensions.certificateInfoAccess.includeAIA">Include AIA
</label> </label>
</div> </div>
@ -176,7 +216,8 @@
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<div class="checkbox"> <div class="checkbox">
<label tooltip-trigger="mouseenter" tooltip-placement="top" uib-tooltip="Ask CA to include/not include Subject Key Identifier" > <label tooltip-trigger="mouseenter" tooltip-placement="top"
uib-tooltip="Ask CA to include/not include Subject Key Identifier">
<input type="checkbox" ng-model="certificate.extensions.subjectKeyIdentifier.includeSKI">Include SKI <input type="checkbox" ng-model="certificate.extensions.subjectKeyIdentifier.includeSKI">Include SKI
</label> </label>
</div> </div>
@ -187,7 +228,8 @@
cRL Distribution Points cRL Distribution Points
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<select class="form-control" ng-model="certificate.extensions.cRLDistributionPoints.includeCRLDP" ng-options="item for item in ['yes', 'no', 'default']"></select> <select class="form-control" ng-model="certificate.extensions.cRLDistributionPoints.includeCRLDP"
ng-options="item for item in ['yes', 'no', 'default']"></select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -195,14 +237,20 @@
Custom Custom
</label> </label>
<div class="col-sm-2"> <div class="col-sm-2">
<input tooltip-trigger="focus" tooltip-placement="top" uib-tooltip="OID for the custom extension e.g. 1.12.123.12.10" class="form-control" name="oid" ng-model="certificate.customOid" placeholder="Oid" class="form-control" required/> <input tooltip-trigger="focus" tooltip-placement="top"
uib-tooltip="OID for the custom extension e.g. 1.12.123.12.10" class="form-control" name="oid"
ng-model="certificate.customOid" placeholder="Oid" class="form-control" required/>
</div> </div>
<div class="col-sm-2"> <div class="col-sm-2">
<select tooltip-trigger="focus" tooltip-placement="top" uib-tooltip="Encoding for value" class="form-control col-sm-2" ng-model="certificate.customEncoding" ng-options="item for item in ['b64asn1', 'string', 'ia5string']"></select> <select tooltip-trigger="focus" tooltip-placement="top" uib-tooltip="Encoding for value"
class="form-control col-sm-2" ng-model="certificate.customEncoding"
ng-options="item for item in ['b64asn1', 'string', 'ia5string']"></select>
</div> </div>
<div class="col-sm-4"> <div class="col-sm-4">
<div class="input-group"> <div class="input-group">
<input tooltip-trigger="focus" tooltip-placement="top" uib-tooltip="String or Base64-encoded DER ASN.1 structure for the value" class="form-control" name="value" ng-model="certificate.customValue" placeholder="Value" class="form-control" required/> <input tooltip-trigger="focus" tooltip-placement="top"
uib-tooltip="String or Base64-encoded DER ASN.1 structure for the value" class="form-control"
name="value" ng-model="certificate.customValue" placeholder="Value" class="form-control" required/>
<span class="input-group-btn"> <span class="input-group-btn">
<button ng-click="certificate.attachCustom()" class="btn btn-info">Add</button> <button ng-click="certificate.attachCustom()" class="btn btn-info">Add</button>
</span> </span>
@ -226,7 +274,9 @@
<td>{{ custom.value }}</td> <td>{{ custom.value }}</td>
<td>{{ custom.isCritical }}</td> <td>{{ custom.isCritical }}</td>
<td> <td>
<button type="button" ng-click="certificate.removeCustom($index)" class="btn btn-danger btn-sm pull-right">Remove</button> <button type="button" ng-click="certificate.removeCustom($index)"
class="btn btn-danger btn-sm pull-right">Remove
</button>
</td> </td>
</tr> </tr>
</table> </table>

View File

@ -16,14 +16,28 @@
You must enter an Certificate owner</p> You must enter an Certificate owner</p>
</div> </div>
</div> </div>
<div class="form-group">
<label class="control-label col-sm-2">
Roles
</label>
<div class="col-sm-10" ng-model="certificate" role-select></div>
</div>
<div ng-include="'angular/certificates/certificate/notifications.tpl.html'"></div>
<div class="form-group" <div class="form-group"
ng-class="{'has-error': trackingForm.name.$invalid, 'has-success': !trackingForm.name.$invalid&&trackingForm.name.$dirty}"> ng-class="{'has-error': trackingForm.commonName.$invalid, 'has-success': !trackingForm.$invalid&&trackingForm.commonName.$dirty}">
<label class="control-label col-sm-2" uib-tooltip="If no name is provided, Lemur will generate a name for you"> <label class="control-label col-sm-2">
Custom Name <span class="glyphicon glyphicon-question-sign"></span> Common Name
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<input name="name" ng-model="certificate.name" <input name="commonName"
placeholder="the.example.net-SymantecCorporation-20150828-20160830" class="form-control"/> uib-tooltip="If you need a certificate with multiple domains enter your primary domain here and the rest under 'Subject Alternate Names' by clicking 'More Options'"
ng-model="certificate.commonName" placeholder="Common Name" class="form-control"
ng-maxlength="64"
required/>
<p ng-show="trackingForm.commonName.$invalid && !trackingForm.commonName.$pristine" class="help-block">
You must
enter a common name and it must be less than 64 characters</p>
</div> </div>
</div> </div>
<div class="form-group" <div class="form-group"
@ -59,34 +73,6 @@
</ui-select> </ui-select>
</div> </div>
</div> </div>
<div class="form-group">
<label class="control-label col-sm-2">
Certificate Template
</label>
<div class="col-sm-10">
<select class="form-control" ng-change="certificate.useTemplate()" name="certificateTemplate"
ng-model="certificate.template" ng-options="template.name for template in templates"></select>
</div>
</div>
<div class="form-group"
ng-class="{'has-error': trackingForm.commonName.$invalid, 'has-success': !trackingForm.$invalid&&trackingForm.commonName.$dirty}">
<label class="control-label col-sm-2">
Common Name
</label>
<div class="col-sm-10">
<input name="commonName"
uib-tooltip="If you need a certificate with multiple domains enter your primary domain here and the rest under 'Subject Alternate Names' in the next few panels"
ng-model="certificate.commonName" placeholder="Common Name" class="form-control"
ng-maxlength="64"
required/>
<p ng-show="trackingForm.commonName.$invalid && !trackingForm.commonName.$pristine" class="help-block">
You must
enter a common name and it must be less than 64 characters</p>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2" <label class="control-label col-sm-2"
uib-tooltip="If no date is selected Lemur attempts to issue a 2 year certificate"> uib-tooltip="If no date is selected Lemur attempts to issue a 2 year certificate">
@ -145,32 +131,18 @@
</div> </div>
</div> </div>
<div class="col-sm-1"> <div class="col-sm-1">
<button uib-tooltip="Clear Validity" ng-click="clearDates()" class="btn btn-default"><i class="glyphicon glyphicon-remove"></i></button> <button uib-tooltip="Clear Validity" ng-click="clearDates()" class="btn btn-default"><i
</div> class="glyphicon glyphicon-remove"></i></button>
</div>
<div class="form-group"
ng-class="{'has-error': trackingForm.csr.$invalid&&trackingForm.csr.$dirty, 'has-success': !trackingForm.csr.$invalid&&trackingForm.csr.$dirty}">
<label class="control-label col-sm-2">
Certificate Signing Request (CSR)
</label>
<div class="col-sm-10">
<textarea uib-tooltip="Values defined in the CSR will take precedence" name="certificate signing request"
ng-model="certificate.csr"
placeholder="PEM encoded string..." class="form-control"
ng-pattern="/^-----BEGIN CERTIFICATE REQUEST-----/"></textarea>
<p ng-show="trackingForm.csr.$invalid && !trackingForm.csr.$pristine"
class="help-block">Enter a valid certificate signing request.</p>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2"> <label class="control-label col-sm-2">Auto Rotate</label>
Roles <div class="col-sm-10">
</label> <switch ng-model="certificate.rotation" id="active" name="active" class="green small"
<div class="col-sm-10" ng-model="certificate" role-select></div> uib-tooltip="If selected, new certificates will be automatically re-issued and re-deployed onto known endpoints."></switch>
</div>
</div> </div>
<div ng-include="'angular/certificates/certificate/replaces.tpl.html'"></div> <div ng-include="'angular/certificates/certificate/replaces.tpl.html'"></div>
<div ng-include="'angular/certificates/certificate/notifications.tpl.html'"></div>
<div ng-include="'angular/certificates/certificate/destinations.tpl.html'"></div> <div ng-include="'angular/certificates/certificate/destinations.tpl.html'"></div>
</div> </div>
</form> </form>

View File

@ -1,7 +1,6 @@
<div class="modal-header"> <div class="modal-header">
<div class="modal-title">
<button type="button" class="close" ng-click="cancel()" aria-label="Close"><span aria-hidden="true">&times;</span></button> <button type="button" class="close" ng-click="cancel()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-header">Upload a certificate <span class="text-muted"><small>encrypt all the things</small></span></h3> <h3 class="modal-title">Import a certificate <span class="text-muted"><small>encrypt all the things</small></span></h3>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form name="uploadForm" class="form-horizontal" role="form" novalidate> <form name="uploadForm" class="form-horizontal" role="form" novalidate>
@ -10,7 +9,6 @@
<label class="control-label col-sm-2"> <label class="control-label col-sm-2">
Owner Owner
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="email" name="owner" ng-model="certificate.owner" placeholder="owner@example.com" <input type="email" name="owner" ng-model="certificate.owner" placeholder="owner@example.com"
class="form-control" required/> class="form-control" required/>
@ -19,23 +17,23 @@
email.</p> email.</p>
</div> </div>
</div> </div>
<div class="form-group" <div class="form-group">
ng-class="{'has-error': uploadForm.name.$invalid, 'has-success': !uploadForm.name.$invalid&&uploadForm.name.$dirty}"> <label class="control-label col-sm-2">
<label class="control-label col-sm-2" uib-tooltip="If no name is provided, Lemur will generate a name for you"> Roles
Custom Name <span class="glyphicon glyphicon-question-sign"></span>
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10" ng-model="certificate" role-select></div>
<input name="name" ng-model="certificate.name" placeholder="the.example.net-SymantecCorporation-20150828-20160830" class="form-control"/>
</div>
</div> </div>
<div ng-include="'angular/certificates/certificate/notifications.tpl.html'"></div>
<div class="form-group" <div class="form-group"
ng-class="{'has-error': uploadForm.description.$invalid, 'has-success': !uploadForm.$invalid&&uploadForm.description.$dirty}"> ng-class="{'has-error': uploadForm.description.$invalid, 'has-success': !uploadForm.$invalid&&uploadForm.description.$dirty}">
<label class="control-label col-sm-2"> <label class="control-label col-sm-2">
Description Description
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<textarea name="description" ng-model="certificate.description" placeholder="Something elegant" class="form-control" required></textarea> <textarea name="description" ng-model="certificate.description" placeholder="Something elegant"
<p ng-show="uploadForm.description.$invalid && !uploadForm.description.$pristine" class="help-block">You must give a short description about this authority will be used for.</p> class="form-control" required></textarea>
<p ng-show="uploadForm.description.$invalid && !uploadForm.description.$pristine" class="help-block">You must
give a short description about this authority will be used for.</p>
</div> </div>
</div> </div>
<div class="form-group" <div class="form-group"
@ -43,11 +41,9 @@
<label class="control-label col-sm-2"> <label class="control-label col-sm-2">
Public Certificate Public Certificate
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<textarea name="publicCert" ng-model="certificate.body" placeholder="PEM encoded string..." <textarea name="publicCert" ng-model="certificate.body" placeholder="PEM encoded string..."
class="form-control" ng-pattern="/^-----BEGIN CERTIFICATE-----/" required></textarea> class="form-control" ng-pattern="/^-----BEGIN CERTIFICATE-----/" required></textarea>
<p ng-show="uploadForm.publicCert.$invalid && !uploadForm.publicCert.$pristine" class="help-block">Enter <p ng-show="uploadForm.publicCert.$invalid && !uploadForm.publicCert.$pristine" class="help-block">Enter
a valid certificate.</p> a valid certificate.</p>
</div> </div>
@ -57,10 +53,10 @@
<label class="control-label col-sm-2"> <label class="control-label col-sm-2">
Private Key Private Key
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<textarea name="privateKey" ng-model="certificate.privateKey" placeholder="PEM encoded string..." <textarea name="privateKey" ng-model="certificate.privateKey" placeholder="PEM encoded string..."
class="form-control" ng-pattern="/(^-----BEGIN PRIVATE KEY-----[\S\s]*-----END PRIVATE KEY-----)|(^-----BEGIN RSA PRIVATE KEY-----[\S\s]*-----END RSA PRIVATE KEY-----)/"></textarea> class="form-control"
ng-pattern="/(^-----BEGIN PRIVATE KEY-----[\S\s]*-----END PRIVATE KEY-----)|(^-----BEGIN RSA PRIVATE KEY-----[\S\s]*-----END RSA PRIVATE KEY-----)/"></textarea>
<p ng-show="uploadForm.privateKey.$invalid && !uploadForm.privateKey.$pristine" class="help-block">Enter <p ng-show="uploadForm.privateKey.$invalid && !uploadForm.privateKey.$pristine" class="help-block">Enter
a valid certificate.</p> a valid certificate.</p>
@ -71,29 +67,33 @@
<label class="control-label col-sm-2"> <label class="control-label col-sm-2">
Intermediate Certificate Intermediate Certificate
</label> </label>
<div class="col-sm-10"> <div class="col-sm-10">
<textarea name="intermediateCert" ng-model="certificate.chain" <textarea name="intermediateCert" ng-model="certificate.chain"
placeholder="PEM encoded string..." class="form-control" placeholder="PEM encoded string..." class="form-control"
ng-pattern="/^-----BEGIN CERTIFICATE-----/"></textarea> ng-pattern="/^-----BEGIN CERTIFICATE-----/"></textarea>
<p ng-show="uploadForm.intermediateCert.$invalid && !uploadForm.intemediateCert.$pristine" <p ng-show="uploadForm.intermediateCert.$invalid && !uploadForm.intemediateCert.$pristine"
class="help-block">Enter a valid certificate.</p> class="help-block">Enter a valid certificate.</p>
</div> </div>
</div> </div>
<div class="form-group">
<label class="control-label col-sm-2">
Roles
</label>
<div class="col-sm-10" ng-model="certificate" role-select></div>
</div>
<div ng-include="'angular/certificates/certificate/replaces.tpl.html'"></div> <div ng-include="'angular/certificates/certificate/replaces.tpl.html'"></div>
<div ng-include="'angular/certificates/certificate/notifications.tpl.html'"></div>
<div ng-include="'angular/certificates/certificate/destinations.tpl.html'"></div> <div ng-include="'angular/certificates/certificate/destinations.tpl.html'"></div>
<div class="form-group"
ng-class="{'has-error': uploadForm.name.$invalid, 'has-success': !uploadForm.name.$invalid&&uploadForm.name.$dirty}">
<label class="control-label col-sm-2">
Custom Certificate Name
</label>
<div class="col-sm-10">
<input name="name" ng-model="certificate.name"
placeholder="the.example.net-SymantecCorporation-20150828-20160830" class="form-control"
uib-tooltip="If no name is provided, Lemur will generate a name for you">
</div>
</div>
</form> </form>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="submit" ng-click="save(certificate)" ng-disabled="uploadForm.$invalid" class="btn btn-success">Import</button> <button type="submit" ng-click="save(certificate)" ng-disabled="uploadForm.$invalid" class="btn btn-success">
Import
</button>
<button ng-click="cancel()" class="btn btn-danger">Cancel</button> <button ng-click="cancel()" class="btn btn-danger">Cancel</button>
</div> </div>
</div> </div>

View File

@ -4,7 +4,7 @@
uib-typeahead="role.name for role in findRoleByName($viewValue)" typeahead-loading="loadingRoles" uib-typeahead="role.name for role in findRoleByName($viewValue)" typeahead-loading="loadingRoles"
class="form-control input-md" typeahead-on-select="ngModel.attachRole($item)" typeahead-wait-ms="500" class="form-control input-md" typeahead-on-select="ngModel.attachRole($item)" typeahead-wait-ms="500"
uib-tooltip="Roles control who can access this resource" uib-tooltip="Roles control who can access this resource"
tooltip-trigger="focus" tooltip-placement="top"> tooltip-placement="top">
<span class="input-group-btn"> <span class="input-group-btn">
<button ng-model="roles.show" class="btn btn-md btn-default" uib-btn-checkbox btn-checkbox-true="1" btn-checkbox-false="0"> <button ng-model="roles.show" class="btn btn-md btn-default" uib-btn-checkbox btn-checkbox-true="1" btn-checkbox-false="0">
<span class="badge">{{ ngModel.roles.length || 0 }}</span> <span class="badge">{{ ngModel.roles.length || 0 }}</span>

View File

@ -4,9 +4,10 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<input ng-hide="currentStepNumber() == 1" class="btn btn-default pull-left" type="submit" wz-previous value="Previous" /> <input ng-hide="currentStepNumber() == 1" class="btn btn-default pull-left" type="submit" wz-previous value="Previous" />
<input ng-show="currentStepNumber() != steps.length" class="btn btn-default pull-right" type="submit" wz-next value="Next" /> <input ng-show="currentStepNumber() != steps.length" class="btn btn-default pull-right" type="submit" wz-next value="More Options" />
<input ng-show="!context.loading" ng-class="{disabled: trackingForm.invalid}" class="btn btn-success pull-right" type="submit" wz-finish value="Create" /> <input ng-show="!context.loading" ng-class="{disabled: trackingForm.invalid}" class="btn btn-success pull-right" type="submit" wz-finish value="Create" />
<button ng-show="context.loading" class="btn btn-success pull-right disabled"><wave-spinner></wave-spinner></button> <button ng-show="context.loading" class="btn btn-success pull-right disabled">Working... <i class="fa fa-spin fa-circle-o-notch" aria-hidden="true"></i>
</button>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
</div> </div>

View File

@ -72,10 +72,10 @@
<ul ng-show="currentUser.username" class="nav navbar-nav navbar-right"> <ul ng-show="currentUser.username" class="nav navbar-nav navbar-right">
<li class="dropdown" uib-dropdown on-toggle="toggled(open)"> <li class="dropdown" uib-dropdown on-toggle="toggled(open)">
<a href class="dropdown-toggle profile-nav" uib-dropdown-toggle> <a href class="dropdown-toggle profile-nav" uib-dropdown-toggle>
<span ng-if="currentUser.profileImage"> <span ng-if="currentUser.profilePicture">
{{ currentUser.username }}<img ng-src="{{ currentUser.profileImage }}" class="profile img-circle"> {{ currentUser.username }} <img ng-src="{{ currentUser.profilePicture }}" class="profile img-circle">
</span> </span>
<span ng-if="!currentUser.profileImage"> <span ng-if="!currentUser.profilePicture">
{{ currentUser.username }} <ng-letter-avatar height="35" width="35" data="currentUser.username" shape="round"></ng-letter-avatar> {{ currentUser.username }} <ng-letter-avatar height="35" width="35" data="currentUser.username" shape="round"></ng-letter-avatar>
</span> </span>
</a> </a>

View File

@ -68,14 +68,6 @@ body { padding-top: 70px; }
left: 50%; left: 50%;
} }
.wave-spinner {
margin: auto;
width: 100px;
height: 60px;
text-align: center;
font-size: 20px;
}
html { html {
position: relative; position: relative;
min-height: 100%; min-height: 100%;
@ -159,16 +151,6 @@ a {
margin-top: 10px; margin-top: 10px;
} }
.wave-spinner {
margin: 5px auto !important;
width: 40px !important;
height: 12px !important;
}
.wave-spinner>div {
background-color: #FFFFFF !important;
}
.clipboard-btn { .clipboard-btn {
border-width: 0; border-width: 0;
background-color: transparent; background-color: transparent;

View File

@ -26,10 +26,7 @@ class UserOutputSchema(LemurOutputSchema):
username = fields.String() username = fields.String()
email = fields.Email() email = fields.Email()
active = fields.Boolean() active = fields.Boolean()
roles = fields.Nested(AssociatedRoleSchema, many=True) profile_picture = fields.String()
certificates = fields.Nested(AssociatedCertificateSchema, many=True)
authorities = fields.Nested(AssociatedAuthoritySchema, many=True)
profileImage = fields.String()
user_input_schema = UserInputSchema() user_input_schema = UserInputSchema()