Beispiel #1
0
def delete_service_key(kid):
  try:
    key = ServiceKey.get(kid=kid)
    ServiceKey.delete().where(ServiceKey.kid == kid).execute()
  except ServiceKey.DoesNotExist:
    raise ServiceKeyDoesNotExist

  delete_all_notifications_by_path_prefix('/service_key_approval/{0}'.format(kid))
  _gc_expired(key.service)
  return key
Beispiel #2
0
def _gc_expired(service):
    ServiceKey.delete().where(
        _stale_expired_keys_service_clause(service)
        | _stale_unapproved_keys_clause(service)).execute()