Remove get_pending_certificates from verisign issuer
This commit is contained in:
parent
a316cbba73
commit
b814a4f009
|
@ -518,19 +518,6 @@ def publish_verisign_units():
|
||||||
requests.post('http://localhost:8078/metrics', data=json.dumps(metric))
|
requests.post('http://localhost:8078/metrics', data=json.dumps(metric))
|
||||||
|
|
||||||
|
|
||||||
@manager.command
|
|
||||||
def publish_unapproved_verisign_certificates():
|
|
||||||
"""
|
|
||||||
Query the Verisign for any certificates that need to be approved.
|
|
||||||
:return:
|
|
||||||
"""
|
|
||||||
from lemur.plugins import plugins
|
|
||||||
from lemur.extensions import metrics
|
|
||||||
v = plugins.get('verisign-issuer')
|
|
||||||
certs = v.get_pending_certificates()
|
|
||||||
metrics.send('pending_certificates', 'gauge', certs)
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
manager.add_command("start", LemurServer())
|
manager.add_command("start", LemurServer())
|
||||||
manager.add_command("runserver", Server(host='127.0.0.1', threaded=True))
|
manager.add_command("runserver", Server(host='127.0.0.1', threaded=True))
|
||||||
|
|
|
@ -221,25 +221,6 @@ class VerisignIssuerPlugin(IssuerPlugin):
|
||||||
response = self.session.post(url, headers={'content-type': 'application/x-www-form-urlencoded'})
|
response = self.session.post(url, headers={'content-type': 'application/x-www-form-urlencoded'})
|
||||||
return handle_response(response.content)['Response']['Order']
|
return handle_response(response.content)['Response']['Order']
|
||||||
|
|
||||||
def get_pending_certificates(self):
|
|
||||||
"""
|
|
||||||
Uses Verisign to fetch the number of certificate awaiting approval.
|
|
||||||
|
|
||||||
:return:
|
|
||||||
"""
|
|
||||||
url = current_app.config.get("VERISIGN_URL") + '/reportingws'
|
|
||||||
|
|
||||||
end = arrow.now()
|
|
||||||
start = end.replace(days=-7)
|
|
||||||
data = {
|
|
||||||
'reportType': 'summary',
|
|
||||||
'certProductType': 'Server',
|
|
||||||
'startDate': start.format("MM/DD/YYYY"),
|
|
||||||
'endDate': end.format("MM/DD/YYYY"),
|
|
||||||
}
|
|
||||||
response = self.session.post(url, data=data)
|
|
||||||
return response.json()['certificateSummary'][0]['Pending']
|
|
||||||
|
|
||||||
def clear_pending_certificates(self):
|
def clear_pending_certificates(self):
|
||||||
"""
|
"""
|
||||||
Uses Verisign to clear the pending certificates awaiting approval.
|
Uses Verisign to clear the pending certificates awaiting approval.
|
||||||
|
|
Loading…
Reference in New Issue