This commit is contained in:
kevgliss 2016-04-01 14:27:57 -07:00
parent 675d10c8a6
commit bfcfdb83a7
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('replacements', type=list, default=[], location='json')
self.reqparse.add_argument('validityStart', type=str, location='json') # TODO validate 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('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('authority', type=valid_authority, location='json', required=True)
self.reqparse.add_argument('description', type=str, location='json') self.reqparse.add_argument('description', type=str, location='json')
self.reqparse.add_argument('country', type=str, location='json', required=True) 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['specificEndDate'] = str(end_date)
data['validityPeriod'] = period 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 return data

View File

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