Merge pull request #271 from kevgliss/195

Closes #195
This commit is contained in:
kevgliss 2016-04-08 12:01:10 -07:00
commit 3f89d6d009
3 changed files with 29 additions and 14 deletions

View File

@ -357,6 +357,7 @@ class CertificatesList(AuthenticatedResource):
self.reqparse.add_argument('replacements', type=list, default=[], location='json')
self.reqparse.add_argument('validityStart', type=str, location='json') # TODO validate
self.reqparse.add_argument('validityEnd', type=str, location='json') # TODO validate
self.reqparse.add_argument('validityYears', type=int, location='json') # TODO validate
self.reqparse.add_argument('authority', type=valid_authority, location='json', required=True)
self.reqparse.add_argument('description', type=str, location='json')
self.reqparse.add_argument('country', type=str, location='json', required=True)

View File

@ -82,6 +82,12 @@ def process_options(options):
data['specificEndDate'] = str(end_date)
data['validityPeriod'] = period
elif options.get('validityYears'):
if options['validityYears'] in [1, 2]:
data['validityPeriod'] = str(options['validityYears']) + 'Y'
else:
raise Exception("Verisign issued certificates cannot exceed two years in validity")
return data

View File

@ -79,9 +79,18 @@
tooltip="If no date is selected Lemur attempts to issue a 2 year certificate">
Validity Range <span class="glyphicon glyphicon-question-sign"></span>
</label>
<div class="col-sm-4">
<div>
<div class="col-sm-2">
<select ng-model="certificate.validityYears" class="form-control">
<option value="1">1 year</option>
<option value="2">2 years</option>
<option value="3">3 years</option>
<option value="4">4 years</option>
</select>
</div>
<span style="padding-top: 15px" class="text-center col-sm-1">
<strong>- or -</strong>
</span>
<div class="col-sm-3">
<div class="input-group">
<input tooltip="Starting Date (yyyy/MM/dd)" class="form-control" datepicker-popup="yyyy/MM/dd"
is-open="$parent.openNotBefore.isOpen" min-date="certificate.authority.notBefore"
@ -92,11 +101,10 @@
</span>
</div>
</div>
</div>
<span style="padding-top: 15px" class="text-center col-sm-2"><label><span
<span style="padding-top: 15px" class="text-center col-sm-1"><label><span
class="glyphicon glyphicon-resize-horizontal"></span></label></span>
<div class="col-sm-4">
<div class="col-sm-3">
<div>
<div class="input-group">
<input tooltip="Ending Date (yyyy/MM/dd)" class="form-control" datepicker-popup="yyyy/MM/dd"