From ff08a9a806319002d2bddbfdeac53a9925bb1b1d Mon Sep 17 00:00:00 2001 From: Clivern Date: Tue, 17 Sep 2019 22:00:44 +0200 Subject: [PATCH 01/15] Add phone validation --- app/controllers/api/private/v1/status.py | 28 +++++++++++++--- app/modules/validation/extension.py | 33 +++++++++++-------- .../controllers/api/private/v1/test_status.py | 2 +- 3 files changed, 45 insertions(+), 18 deletions(-) diff --git a/app/controllers/api/private/v1/status.py b/app/controllers/api/private/v1/status.py index d17efeac..e0dc6d2b 100644 --- a/app/controllers/api/private/v1/status.py +++ b/app/controllers/api/private/v1/status.py @@ -55,9 +55,14 @@ def post(self, request): 'email': { 'value': request_data["email"], 'sanitize': { + 'escape': {}, 'strip': {} }, - 'validate': {} + 'validate': { + 'sv_email': { + 'error': _('Error! Email is invalid.') + } + } } }) @@ -67,9 +72,14 @@ def post(self, request): 'phone': { 'value': request_data["phone"], 'sanitize': { + 'escape': {}, 'strip': {} }, - 'validate': {} + 'validate': { + 'sv_phone': { + 'error': _('Error! Phone number is invalid.') + } + } } }) @@ -79,16 +89,26 @@ def post(self, request): 'email': { 'value': request_data["email"], 'sanitize': { + 'escape': {}, 'strip': {} }, - 'validate': {} + 'validate': { + 'sv_email': { + 'error': _('Error! Email is invalid.') + } + } }, 'endpoint': { 'value': request_data["endpoint"], 'sanitize': { + 'escape': {}, 'strip': {} }, - 'validate': {} + 'validate': { + 'sv_url': { + 'error': _('Error! Endpoint URL is invalid.') + } + } }, 'auth_token': { 'value': request_data["auth_token"], diff --git a/app/modules/validation/extension.py b/app/modules/validation/extension.py index 53d6d04d..fe5b4f32 100644 --- a/app/modules/validation/extension.py +++ b/app/modules/validation/extension.py @@ -4,11 +4,15 @@ # Standard Library import re +import os # Third Party Library -from django.core.signing import Signer +from twilio.rest import Client from pyvalitron.validator import Validator +from twilio.base.exceptions import TwilioRestException +from django.core.signing import Signer from django.core.validators import URLValidator +from django.core.validators import validate_slug from django.core.validators import validate_email from django.core.validators import validate_ipv4_address from django.core.validators import validate_ipv6_address @@ -97,19 +101,22 @@ def sv_numeric(self): regex = re.compile(r'^[0-9]+$') return bool(regex.match(self._input)) - def sv_host_slug(self): - regex = re.compile(r'^[a-z0-9-_]+$') - return bool(regex.match(self._input)) - - def sv_host_name(self): - regex = re.compile(r'^[a-zA-Z0-9-_\s]+$') - return bool(regex.match(self._input)) - - def sv_host_server(self): - return True + def sv_slug(self): + return True if validate_slug(self._input) is None else False - def sv_tls_certificate(self): - return True + def sv_phone(self): + if os.getenv("TEXT_MESSAGING_DRIVER", "twilio") == "twilio" and os.getenv("TWILIO_ACCOUNT_SID") and os.getenv("TWILIO_AUTH_TOKEN"): + client = Client(os.getenv("TWILIO_ACCOUNT_SID"), os.getenv("TWILIO_AUTH_TOKEN")) + try: + client.lookups.phone_numbers(self._input).fetch(type="carrier") + return True + except TwilioRestException as e: + if e.code == 20404: + return False + else: + raise e + else: + return self.sv_numeric() and len(self._input) >= 9 def optional(self): return self._input == "" diff --git a/app/tests/functional/controllers/api/private/v1/test_status.py b/app/tests/functional/controllers/api/private/v1/test_status.py index b6abffb2..ab38e311 100644 --- a/app/tests/functional/controllers/api/private/v1/test_status.py +++ b/app/tests/functional/controllers/api/private/v1/test_status.py @@ -59,7 +59,7 @@ def test_subscribe_success02(self): response = self.client.post(reverse("app.api.private.v1.status_subscribe.endpoint"), { "type": "phone", "email": "", - "phone": "+12345678", + "phone": "00312345678", "endpoint": "", "auth_token": "" }) From 45397258922bb624955aff65bc7df225c1d86fa3 Mon Sep 17 00:00:00 2001 From: Clivern Date: Tue, 17 Sep 2019 22:38:59 +0200 Subject: [PATCH 02/15] add default limit & offset --- app/controllers/api/private/v1/admin/activity.py | 6 +++--- app/controllers/api/private/v1/admin/component.py | 6 +++--- app/controllers/api/private/v1/admin/component_group.py | 6 +++--- app/controllers/api/private/v1/admin/incident.py | 6 +++--- app/controllers/api/private/v1/admin/incident_update.py | 6 +++--- app/controllers/api/private/v1/admin/metric.py | 6 +++--- app/controllers/api/private/v1/admin/notifications.py | 6 +++--- app/controllers/api/private/v1/admin/subscriber.py | 6 +++--- app/controllers/api/private/v1/admin/user.py | 6 +++--- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/app/controllers/api/private/v1/admin/activity.py b/app/controllers/api/private/v1/admin/activity.py index 2dc70dce..61dc44ac 100644 --- a/app/controllers/api/private/v1/admin/activity.py +++ b/app/controllers/api/private/v1/admin/activity.py @@ -44,8 +44,8 @@ def get(self, request): self.__request.set_request(request) request_data = self.__request.get_request_data("get", { - "offset": "", - "limit": "" + "offset": 0, + "limit": 20 }) try: @@ -53,7 +53,7 @@ def get(self, request): limit = int(request_data["limit"]) except Exception: offset = 0 - limit = 0 + limit = 20 return JsonResponse(self.__response.send_private_success([], { 'activities': self.__format_activities(self.__activity.get(self.__user_id, offset, limit)), diff --git a/app/controllers/api/private/v1/admin/component.py b/app/controllers/api/private/v1/admin/component.py index f2b97003..5b640ba9 100644 --- a/app/controllers/api/private/v1/admin/component.py +++ b/app/controllers/api/private/v1/admin/component.py @@ -117,8 +117,8 @@ def get(self, request): self.__request.set_request(request) request_data = self.__request.get_request_data("get", { - "offset": "", - "limit": "" + "offset": 0, + "limit": 20 }) try: @@ -126,7 +126,7 @@ def get(self, request): limit = int(request_data["limit"]) except Exception: offset = 0 - limit = 0 + limit = 20 return JsonResponse(self.__response.send_private_success([], { 'components': self.__format_components(self.__component.get_all(offset, limit)), diff --git a/app/controllers/api/private/v1/admin/component_group.py b/app/controllers/api/private/v1/admin/component_group.py index 589f35f9..01c0ae2f 100644 --- a/app/controllers/api/private/v1/admin/component_group.py +++ b/app/controllers/api/private/v1/admin/component_group.py @@ -110,8 +110,8 @@ def get(self, request): self.__request.set_request(request) request_data = self.__request.get_request_data("get", { - "offset": "", - "limit": "" + "offset": 0, + "limit": 20 }) try: @@ -119,7 +119,7 @@ def get(self, request): limit = int(request_data["limit"]) except Exception: offset = 0 - limit = 0 + limit = 20 return JsonResponse(self.__response.send_private_success([], { 'groups': self.__format_groups(self.__component_group.get_all(offset, limit)), diff --git a/app/controllers/api/private/v1/admin/incident.py b/app/controllers/api/private/v1/admin/incident.py index c403a550..bd0c8419 100644 --- a/app/controllers/api/private/v1/admin/incident.py +++ b/app/controllers/api/private/v1/admin/incident.py @@ -112,8 +112,8 @@ def get(self, request): self.__request.set_request(request) request_data = self.__request.get_request_data("get", { - "offset": "", - "limit": "" + "offset": 0, + "limit": 20 }) try: @@ -121,7 +121,7 @@ def get(self, request): limit = int(request_data["limit"]) except Exception: offset = 0 - limit = 0 + limit = 20 return JsonResponse(self.__response.send_private_success([], { 'incidents': self.__format_incidents(self.__incident.get_all(offset, limit)), diff --git a/app/controllers/api/private/v1/admin/incident_update.py b/app/controllers/api/private/v1/admin/incident_update.py index 2cdfad79..6f37f021 100644 --- a/app/controllers/api/private/v1/admin/incident_update.py +++ b/app/controllers/api/private/v1/admin/incident_update.py @@ -145,8 +145,8 @@ def get(self, request, incident_id): self.__request.set_request(request) request_data = self.__request.get_request_data("get", { - "offset": "", - "limit": "" + "offset": 0, + "limit": 20 }) try: @@ -154,7 +154,7 @@ def get(self, request, incident_id): limit = int(request_data["limit"]) except Exception: offset = 0 - limit = 0 + limit = 20 return JsonResponse(self.__response.send_private_success([], { 'updates': self.__format_incident_updates(self.__incident_update.get_all(incident_id, offset, limit), incident_id), diff --git a/app/controllers/api/private/v1/admin/metric.py b/app/controllers/api/private/v1/admin/metric.py index 0663ff98..67fd6e82 100644 --- a/app/controllers/api/private/v1/admin/metric.py +++ b/app/controllers/api/private/v1/admin/metric.py @@ -143,8 +143,8 @@ def get(self, request): self.__request.set_request(request) request_data = self.__request.get_request_data("get", { - "offset": "", - "limit": "" + "offset": 0, + "limit": 20 }) try: @@ -152,7 +152,7 @@ def get(self, request): limit = int(request_data["limit"]) except Exception: offset = 0 - limit = 0 + limit = 20 return JsonResponse(self.__response.send_private_success([], { 'metrics': self.__format_metrics(self.__metric.get_all(offset, limit)), diff --git a/app/controllers/api/private/v1/admin/notifications.py b/app/controllers/api/private/v1/admin/notifications.py index 4648816d..d8c75b6a 100644 --- a/app/controllers/api/private/v1/admin/notifications.py +++ b/app/controllers/api/private/v1/admin/notifications.py @@ -100,8 +100,8 @@ def get(self, request): self.__request.set_request(request) request_data = self.__request.get_request_data("get", { - "offset": "", - "limit": "" + "offset": 0, + "limit": 20 }) try: @@ -109,7 +109,7 @@ def get(self, request): limit = int(request_data["limit"]) except Exception: offset = 0 - limit = 0 + limit = 20 return JsonResponse(self.__response.send_private_success([], { 'notifications': self.__format_notification(self.__notification.get(self.__user_id, offset, limit)), diff --git a/app/controllers/api/private/v1/admin/subscriber.py b/app/controllers/api/private/v1/admin/subscriber.py index cdc4e197..6feb3d98 100644 --- a/app/controllers/api/private/v1/admin/subscriber.py +++ b/app/controllers/api/private/v1/admin/subscriber.py @@ -238,8 +238,8 @@ def get(self, request): self.__request.set_request(request) request_data = self.__request.get_request_data("get", { - "offset": "", - "limit": "" + "offset": 0, + "limit": 20 }) try: @@ -247,7 +247,7 @@ def get(self, request): limit = int(request_data["limit"]) except Exception: offset = 0 - limit = 0 + limit = 20 return JsonResponse(self.__response.send_private_success([], { 'subscribers': self.__format_subscribers(self.__subscriber.get_all(offset, limit)), diff --git a/app/controllers/api/private/v1/admin/user.py b/app/controllers/api/private/v1/admin/user.py index 1b79e4df..8d8c2424 100644 --- a/app/controllers/api/private/v1/admin/user.py +++ b/app/controllers/api/private/v1/admin/user.py @@ -239,8 +239,8 @@ def get(self, request): self.__request.set_request(request) request_data = self.__request.get_request_data("get", { - "offset": "", - "limit": "" + "offset": 0, + "limit": 20 }) try: @@ -248,7 +248,7 @@ def get(self, request): limit = int(request_data["limit"]) except Exception: offset = 0 - limit = 0 + limit = 20 return JsonResponse(self.__response.send_private_success([], { 'users': self.__format_users(self.__user.get_all(offset, limit)), From 8bdbac31ed5e97b95e8b29785681e20ee45fb6dd Mon Sep 17 00:00:00 2001 From: Clivern Date: Wed, 18 Sep 2019 00:46:28 +0200 Subject: [PATCH 03/15] Add @TODO flag --- .../api/private/v1/admin/builder.py | 2 + .../api/private/v1/admin/component.py | 6 ++ .../api/private/v1/admin/component_group.py | 4 ++ .../api/private/v1/admin/incident.py | 4 ++ .../api/private/v1/admin/incident_update.py | 4 ++ .../api/private/v1/admin/metric.py | 12 ++++ .../api/private/v1/admin/profile.py | 3 + .../api/private/v1/admin/settings.py | 4 ++ .../api/private/v1/admin/subscriber.py | 59 ++++++++++++++++--- app/controllers/api/private/v1/status.py | 1 + 10 files changed, 91 insertions(+), 8 deletions(-) diff --git a/app/controllers/api/private/v1/admin/builder.py b/app/controllers/api/private/v1/admin/builder.py index 51002c86..54cc3319 100644 --- a/app/controllers/api/private/v1/admin/builder.py +++ b/app/controllers/api/private/v1/admin/builder.py @@ -272,6 +272,7 @@ def post(self, request): }) self.__form.add_inputs({ + # @TODO add validate filter 'builder_headline': { 'value': request_data["builder_headline"], 'sanitize': { @@ -309,6 +310,7 @@ def post(self, request): } } }, + # @TODO add validate filter 'builder_about': { 'value': request_data["builder_about"], 'sanitize': { diff --git a/app/controllers/api/private/v1/admin/component.py b/app/controllers/api/private/v1/admin/component.py index 5b640ba9..b1f666d6 100644 --- a/app/controllers/api/private/v1/admin/component.py +++ b/app/controllers/api/private/v1/admin/component.py @@ -52,6 +52,7 @@ def post(self, request): }) self.__form.add_inputs({ + # @TODO add validate filter 'name': { 'value': request_data["name"], 'sanitize': { @@ -64,6 +65,7 @@ def post(self, request): } } }, + # @TODO add validate filter 'description': { 'value': request_data["description"], 'sanitize': { @@ -80,6 +82,7 @@ def post(self, request): } } }, + # @TODO add validate filter 'group': { 'value': request_data["group"], 'sanitize': {}, @@ -189,6 +192,7 @@ def post(self, request, component_id): }) self.__form.add_inputs({ + # @TODO add validate filter 'name': { 'value': request_data["name"], 'sanitize': { @@ -201,6 +205,7 @@ def post(self, request, component_id): } } }, + # @TODO add validate filter 'description': { 'value': request_data["description"], 'sanitize': { @@ -217,6 +222,7 @@ def post(self, request, component_id): } } }, + # @TODO add validate filter 'group': { 'value': request_data["group"], 'sanitize': {}, diff --git a/app/controllers/api/private/v1/admin/component_group.py b/app/controllers/api/private/v1/admin/component_group.py index 01c0ae2f..94da4bf4 100644 --- a/app/controllers/api/private/v1/admin/component_group.py +++ b/app/controllers/api/private/v1/admin/component_group.py @@ -51,6 +51,7 @@ def post(self, request): }) self.__form.add_inputs({ + # @TODO add validate filter 'name': { 'value': request_data["name"], 'sanitize': { @@ -63,6 +64,7 @@ def post(self, request): } } }, + # @TODO add validate filter 'description': { 'value': request_data["description"], 'sanitize': { @@ -180,6 +182,7 @@ def post(self, request, group_id): }) self.__form.add_inputs({ + # @TODO add validate filter 'name': { 'value': request_data["name"], 'sanitize': { @@ -192,6 +195,7 @@ def post(self, request, group_id): } } }, + # @TODO add validate filter 'description': { 'value': request_data["description"], 'sanitize': { diff --git a/app/controllers/api/private/v1/admin/incident.py b/app/controllers/api/private/v1/admin/incident.py index bd0c8419..43dca158 100644 --- a/app/controllers/api/private/v1/admin/incident.py +++ b/app/controllers/api/private/v1/admin/incident.py @@ -52,6 +52,7 @@ def post(self, request): }) self.__form.add_inputs({ + # @TODO add validate filter 'name': { 'value': request_data["name"], 'sanitize': { @@ -64,6 +65,7 @@ def post(self, request): } } }, + # @TODO add validate filter 'datetime': { 'value': request_data["datetime"], 'sanitize': { @@ -184,6 +186,7 @@ def post(self, request, incident_id): }) self.__form.add_inputs({ + # @TODO add validate filter 'name': { 'value': request_data["name"], 'sanitize': { @@ -196,6 +199,7 @@ def post(self, request, incident_id): } } }, + # @TODO add validate filter 'datetime': { 'value': request_data["datetime"], 'sanitize': { diff --git a/app/controllers/api/private/v1/admin/incident_update.py b/app/controllers/api/private/v1/admin/incident_update.py index 6f37f021..9b12eda1 100644 --- a/app/controllers/api/private/v1/admin/incident_update.py +++ b/app/controllers/api/private/v1/admin/incident_update.py @@ -70,6 +70,7 @@ def post(self, request, incident_id): }) self.__form.add_inputs({ + # @TODO add validate filter 'message': { 'value': request_data["message"], 'sanitize': { @@ -77,6 +78,7 @@ def post(self, request, incident_id): }, 'validate': {} }, + # @TODO add validate filter 'datetime': { 'value': request_data["datetime"], 'sanitize': { @@ -225,6 +227,7 @@ def post(self, request, incident_id, update_id): }) self.__form.add_inputs({ + # @TODO add validate filter 'message': { 'value': request_data["message"], 'sanitize': { @@ -232,6 +235,7 @@ def post(self, request, incident_id, update_id): }, 'validate': {} }, + # @TODO add validate filter 'datetime': { 'value': request_data["datetime"], 'sanitize': { diff --git a/app/controllers/api/private/v1/admin/metric.py b/app/controllers/api/private/v1/admin/metric.py index 67fd6e82..11884217 100644 --- a/app/controllers/api/private/v1/admin/metric.py +++ b/app/controllers/api/private/v1/admin/metric.py @@ -55,6 +55,7 @@ def post(self, request): }) self.__form.add_inputs({ + # @TODO add validate filter 'title': { 'value': request_data["title"], 'sanitize': { @@ -62,6 +63,7 @@ def post(self, request): }, 'validate': {} }, + # @TODO add validate filter 'description': { 'value': request_data["description"], 'sanitize': { @@ -78,6 +80,7 @@ def post(self, request): } } }, + # @TODO add validate filter 'application': { 'value': request_data["application"], 'sanitize': { @@ -85,6 +88,7 @@ def post(self, request): }, 'validate': {} }, + # @TODO add validate filter 'metric': { 'value': request_data["metric"], 'sanitize': { @@ -92,6 +96,7 @@ def post(self, request): }, 'validate': {} }, + # @TODO add validate filter 'x_axis': { 'value': request_data["x_axis"], 'sanitize': { @@ -99,6 +104,7 @@ def post(self, request): }, 'validate': {} }, + # @TODO add validate filter 'y_axis': { 'value': request_data["y_axis"], 'sanitize': { @@ -216,6 +222,7 @@ def post(self, request, metric_id): }) self.__form.add_inputs({ + # @TODO add validate filter 'title': { 'value': request_data["title"], 'sanitize': { @@ -223,6 +230,7 @@ def post(self, request, metric_id): }, 'validate': {} }, + # @TODO add validate filter 'description': { 'value': request_data["description"], 'sanitize': { @@ -239,6 +247,7 @@ def post(self, request, metric_id): } } }, + # @TODO add validate filter 'application': { 'value': request_data["application"], 'sanitize': { @@ -246,6 +255,7 @@ def post(self, request, metric_id): }, 'validate': {} }, + # @TODO add validate filter 'metric': { 'value': request_data["metric"], 'sanitize': { @@ -253,6 +263,7 @@ def post(self, request, metric_id): }, 'validate': {} }, + # @TODO add validate filter 'x_axis': { 'value': request_data["x_axis"], 'sanitize': { @@ -260,6 +271,7 @@ def post(self, request, metric_id): }, 'validate': {} }, + # @TODO add validate filter 'y_axis': { 'value': request_data["y_axis"], 'sanitize': { diff --git a/app/controllers/api/private/v1/admin/profile.py b/app/controllers/api/private/v1/admin/profile.py index ba33656d..d140e511 100644 --- a/app/controllers/api/private/v1/admin/profile.py +++ b/app/controllers/api/private/v1/admin/profile.py @@ -150,6 +150,7 @@ def __update_profile(self, request): } } }, + # @TODO add validate filter 'job_title': { 'value': request_data["job_title"], 'sanitize': { @@ -163,6 +164,7 @@ def __update_profile(self, request): 'optional': {} } }, + # @TODO add validate filter 'company': { 'value': request_data["company"], 'sanitize': { @@ -176,6 +178,7 @@ def __update_profile(self, request): 'optional': {} } }, + # @TODO add validate filter 'address': { 'value': request_data["address"], 'sanitize': { diff --git a/app/controllers/api/private/v1/admin/settings.py b/app/controllers/api/private/v1/admin/settings.py index 2938f73c..b0f09529 100644 --- a/app/controllers/api/private/v1/admin/settings.py +++ b/app/controllers/api/private/v1/admin/settings.py @@ -101,6 +101,7 @@ def post(self, request): } } }, + # @TODO add validate filter 'app_description': { 'value': request_data["app_description"], 'sanitize': { @@ -114,6 +115,7 @@ def post(self, request): 'optional': {} } }, + # @TODO add validate filter "prometheus_token": { 'value': request_data["prometheus_token"], 'sanitize': { @@ -127,6 +129,7 @@ def post(self, request): 'optional': {} } }, + # @TODO add validate filter "newrelic_api_key": { 'value': request_data["newrelic_api_key"], 'sanitize': { @@ -140,6 +143,7 @@ def post(self, request): 'optional': {} } }, + # @TODO add validate filter 'google_analytics_account': { 'value': request_data["google_analytics_account"], 'sanitize': { diff --git a/app/controllers/api/private/v1/admin/subscriber.py b/app/controllers/api/private/v1/admin/subscriber.py index 6feb3d98..3089fcbf 100644 --- a/app/controllers/api/private/v1/admin/subscriber.py +++ b/app/controllers/api/private/v1/admin/subscriber.py @@ -71,9 +71,14 @@ def post(self, request): 'email': { 'value': request_data["email"], 'sanitize': { + 'escape': {}, 'strip': {} }, - 'validate': {} + 'validate': { + 'sv_email': { + 'error': _('Error! Email is invalid.') + } + } }, 'status': { 'value': request_data["status"], @@ -107,9 +112,14 @@ def post(self, request): 'phone': { 'value': request_data["phone"], 'sanitize': { + 'escape': {}, 'strip': {} }, - 'validate': {} + 'validate': { + 'sv_phone': { + 'error': _('Error! Phone number is invalid.') + } + } }, 'status': { 'value': request_data["status"], @@ -143,17 +153,28 @@ def post(self, request): 'email': { 'value': request_data["email"], 'sanitize': { + 'escape': {}, 'strip': {} }, - 'validate': {} + 'validate': { + 'sv_email': { + 'error': _('Error! Email is invalid.') + } + } }, 'endpoint': { 'value': request_data["endpoint"], 'sanitize': { + 'escape': {}, 'strip': {} }, - 'validate': {} + 'validate': { + 'sv_url': { + 'error': _('Error! Endpoint URL is invalid.') + } + } }, + # @TODO add validate filter 'auth_token': { 'value': request_data["auth_token"], 'sanitize': { @@ -196,6 +217,7 @@ def post(self, request): "auth_token": "", "external_id": external_id }) + elif request_data["type"] == "phone": result = self.__subscriber.insert_one({ @@ -331,9 +353,14 @@ def post(self, request, subscriber_id): 'email': { 'value': request_data["email"], 'sanitize': { + 'escape': {}, 'strip': {} }, - 'validate': {} + 'validate': { + 'sv_email': { + 'error': _('Error! Email is invalid.') + } + } }, 'status': { 'value': request_data["status"], @@ -367,9 +394,14 @@ def post(self, request, subscriber_id): 'phone': { 'value': request_data["phone"], 'sanitize': { + 'escape': {}, 'strip': {} }, - 'validate': {} + 'validate': { + 'sv_phone': { + 'error': _('Error! Phone number is invalid.') + } + } }, 'status': { 'value': request_data["status"], @@ -403,17 +435,28 @@ def post(self, request, subscriber_id): 'email': { 'value': request_data["email"], 'sanitize': { + 'escape': {}, 'strip': {} }, - 'validate': {} + 'validate': { + 'sv_email': { + 'error': _('Error! Email is invalid.') + } + } }, 'endpoint': { 'value': request_data["endpoint"], 'sanitize': { + 'escape': {}, 'strip': {} }, - 'validate': {} + 'validate': { + 'sv_url': { + 'error': _('Error! Endpoint URL is invalid.') + } + } }, + # @TODO add validate filter 'auth_token': { 'value': request_data["auth_token"], 'sanitize': { diff --git a/app/controllers/api/private/v1/status.py b/app/controllers/api/private/v1/status.py index e0dc6d2b..9c5043ed 100644 --- a/app/controllers/api/private/v1/status.py +++ b/app/controllers/api/private/v1/status.py @@ -110,6 +110,7 @@ def post(self, request): } } }, + # @TODO add validate filter 'auth_token': { 'value': request_data["auth_token"], 'sanitize': { From 39ea7b1c23318aab7ead233c5e99d52630db6d25 Mon Sep 17 00:00:00 2001 From: Clivern Date: Wed, 18 Sep 2019 11:58:31 +0200 Subject: [PATCH 04/15] Remove escape in case of validation --- app/controllers/api/private/v1/admin/builder.py | 2 -- app/controllers/api/private/v1/admin/profile.py | 5 ----- app/controllers/api/private/v1/admin/settings.py | 3 --- app/controllers/api/private/v1/admin/subscriber.py | 8 -------- app/controllers/api/private/v1/admin/user.py | 7 ------- app/controllers/api/private/v1/forgot_password.py | 1 - app/controllers/api/private/v1/install.py | 5 ----- app/controllers/api/private/v1/login.py | 1 - app/controllers/api/private/v1/register.py | 2 -- app/controllers/api/private/v1/status.py | 4 ---- 10 files changed, 38 deletions(-) diff --git a/app/controllers/api/private/v1/admin/builder.py b/app/controllers/api/private/v1/admin/builder.py index 54cc3319..7b79de83 100644 --- a/app/controllers/api/private/v1/admin/builder.py +++ b/app/controllers/api/private/v1/admin/builder.py @@ -289,7 +289,6 @@ def post(self, request): 'builder_favicon_url': { 'value': request_data["builder_favicon_url"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -301,7 +300,6 @@ def post(self, request): 'builder_logo_url': { 'value': request_data["builder_logo_url"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { diff --git a/app/controllers/api/private/v1/admin/profile.py b/app/controllers/api/private/v1/admin/profile.py index d140e511..1d1fe6e5 100644 --- a/app/controllers/api/private/v1/admin/profile.py +++ b/app/controllers/api/private/v1/admin/profile.py @@ -125,7 +125,6 @@ def __update_profile(self, request): 'username': { 'value': request_data["username"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -141,7 +140,6 @@ def __update_profile(self, request): 'email': { 'value': request_data["email"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -195,7 +193,6 @@ def __update_profile(self, request): 'github_url': { 'value': request_data["github_url"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -212,7 +209,6 @@ def __update_profile(self, request): 'twitter_url': { 'value': request_data["twitter_url"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -229,7 +225,6 @@ def __update_profile(self, request): 'facebook_url': { 'value': request_data["facebook_url"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { diff --git a/app/controllers/api/private/v1/admin/settings.py b/app/controllers/api/private/v1/admin/settings.py index b0f09529..9096f6a1 100644 --- a/app/controllers/api/private/v1/admin/settings.py +++ b/app/controllers/api/private/v1/admin/settings.py @@ -64,7 +64,6 @@ def post(self, request): 'app_name': { 'value': request_data["app_name"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -80,7 +79,6 @@ def post(self, request): 'app_email': { 'value': request_data["app_email"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -92,7 +90,6 @@ def post(self, request): 'app_url': { 'value': request_data["app_url"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { diff --git a/app/controllers/api/private/v1/admin/subscriber.py b/app/controllers/api/private/v1/admin/subscriber.py index 3089fcbf..032b37fd 100644 --- a/app/controllers/api/private/v1/admin/subscriber.py +++ b/app/controllers/api/private/v1/admin/subscriber.py @@ -71,7 +71,6 @@ def post(self, request): 'email': { 'value': request_data["email"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -112,7 +111,6 @@ def post(self, request): 'phone': { 'value': request_data["phone"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -153,7 +151,6 @@ def post(self, request): 'email': { 'value': request_data["email"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -165,7 +162,6 @@ def post(self, request): 'endpoint': { 'value': request_data["endpoint"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -353,7 +349,6 @@ def post(self, request, subscriber_id): 'email': { 'value': request_data["email"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -394,7 +389,6 @@ def post(self, request, subscriber_id): 'phone': { 'value': request_data["phone"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -435,7 +429,6 @@ def post(self, request, subscriber_id): 'email': { 'value': request_data["email"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -447,7 +440,6 @@ def post(self, request, subscriber_id): 'endpoint': { 'value': request_data["endpoint"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { diff --git a/app/controllers/api/private/v1/admin/user.py b/app/controllers/api/private/v1/admin/user.py index 8d8c2424..d636d779 100644 --- a/app/controllers/api/private/v1/admin/user.py +++ b/app/controllers/api/private/v1/admin/user.py @@ -90,7 +90,6 @@ def post(self, request): 'username': { 'value': request_data["username"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -106,7 +105,6 @@ def post(self, request): 'email': { 'value': request_data["email"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -144,7 +142,6 @@ def post(self, request): 'email': { 'value': request_data["email"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -349,7 +346,6 @@ def post(self, request, user_id): 'username': { 'value': request_data["username"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -365,7 +361,6 @@ def post(self, request, user_id): 'email': { 'value': request_data["email"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -419,7 +414,6 @@ def post(self, request, user_id): 'username': { 'value': request_data["username"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -435,7 +429,6 @@ def post(self, request, user_id): 'email': { 'value': request_data["email"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { diff --git a/app/controllers/api/private/v1/forgot_password.py b/app/controllers/api/private/v1/forgot_password.py index cf11c5e8..a8b1bd7b 100644 --- a/app/controllers/api/private/v1/forgot_password.py +++ b/app/controllers/api/private/v1/forgot_password.py @@ -50,7 +50,6 @@ def post(self, request): 'email': { 'value': request_data["email"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { diff --git a/app/controllers/api/private/v1/install.py b/app/controllers/api/private/v1/install.py index c6899828..704dfbf4 100644 --- a/app/controllers/api/private/v1/install.py +++ b/app/controllers/api/private/v1/install.py @@ -65,7 +65,6 @@ def post(self, request): 'app_name': { 'value': request_data["app_name"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -81,7 +80,6 @@ def post(self, request): 'app_email': { 'value': request_data["app_email"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -93,7 +91,6 @@ def post(self, request): 'app_url': { 'value': request_data["app_url"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -105,7 +102,6 @@ def post(self, request): 'admin_username': { 'value': request_data["admin_username"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -121,7 +117,6 @@ def post(self, request): 'admin_email': { 'value': request_data["admin_email"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { diff --git a/app/controllers/api/private/v1/login.py b/app/controllers/api/private/v1/login.py index f3d0264e..5047ad45 100644 --- a/app/controllers/api/private/v1/login.py +++ b/app/controllers/api/private/v1/login.py @@ -58,7 +58,6 @@ def post(self, request): 'username': { 'value': request_data["username"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { diff --git a/app/controllers/api/private/v1/register.py b/app/controllers/api/private/v1/register.py index 2338e542..998813eb 100644 --- a/app/controllers/api/private/v1/register.py +++ b/app/controllers/api/private/v1/register.py @@ -89,7 +89,6 @@ def post(self, request): 'username': { 'value': request_data["username"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -105,7 +104,6 @@ def post(self, request): 'email': { 'value': request_data["email"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { diff --git a/app/controllers/api/private/v1/status.py b/app/controllers/api/private/v1/status.py index 9c5043ed..4c640a61 100644 --- a/app/controllers/api/private/v1/status.py +++ b/app/controllers/api/private/v1/status.py @@ -55,7 +55,6 @@ def post(self, request): 'email': { 'value': request_data["email"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -72,7 +71,6 @@ def post(self, request): 'phone': { 'value': request_data["phone"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -89,7 +87,6 @@ def post(self, request): 'email': { 'value': request_data["email"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { @@ -101,7 +98,6 @@ def post(self, request): 'endpoint': { 'value': request_data["endpoint"], 'sanitize': { - 'escape': {}, 'strip': {} }, 'validate': { From d0f9603e042c0379fe973da06387bac623b889dd Mon Sep 17 00:00:00 2001 From: Clivern Date: Wed, 18 Sep 2019 13:05:35 +0200 Subject: [PATCH 05/15] add file header --- app/celery.py | 6 +++++- app/context_processors.py | 6 +++++- app/controllers/api/private/v1/admin/activity.py | 6 +++++- app/controllers/api/private/v1/admin/builder.py | 6 +++++- app/controllers/api/private/v1/admin/component.py | 6 +++++- app/controllers/api/private/v1/admin/component_group.py | 6 +++++- app/controllers/api/private/v1/admin/incident.py | 6 +++++- app/controllers/api/private/v1/admin/incident_update.py | 6 +++++- app/controllers/api/private/v1/admin/metric.py | 6 +++++- app/controllers/api/private/v1/admin/notifications.py | 6 +++++- app/controllers/api/private/v1/admin/profile.py | 6 +++++- app/controllers/api/private/v1/admin/settings.py | 6 +++++- app/controllers/api/private/v1/admin/subscriber.py | 6 +++++- app/controllers/api/private/v1/admin/user.py | 6 +++++- app/controllers/api/private/v1/forbidden.py | 6 +++++- app/controllers/api/private/v1/forgot_password.py | 6 +++++- app/controllers/api/private/v1/install.py | 7 ++++++- app/controllers/api/private/v1/login.py | 6 +++++- app/controllers/api/private/v1/register.py | 6 +++++- app/controllers/api/private/v1/reset_password.py | 6 +++++- app/controllers/api/private/v1/status.py | 6 +++++- app/controllers/api/public/v1/auth.py | 6 +++++- app/controllers/web/admin/activity.py | 6 +++++- app/controllers/web/admin/builder.py | 6 +++++- app/controllers/web/admin/component.py | 6 +++++- app/controllers/web/admin/component_group.py | 6 +++++- app/controllers/web/admin/dashboard.py | 6 +++++- app/controllers/web/admin/incident.py | 6 +++++- app/controllers/web/admin/incident_update.py | 6 +++++- app/controllers/web/admin/logout.py | 6 +++++- app/controllers/web/admin/metric.py | 6 +++++- app/controllers/web/admin/notification.py | 6 +++++- app/controllers/web/admin/profile.py | 6 +++++- app/controllers/web/admin/settings.py | 6 +++++- app/controllers/web/admin/subscriber.py | 6 +++++- app/controllers/web/admin/user.py | 6 +++++- app/controllers/web/error.py | 6 +++++- app/controllers/web/forgot_password.py | 6 +++++- app/controllers/web/health_check.py | 6 +++++- app/controllers/web/history.py | 6 +++++- app/controllers/web/install.py | 6 +++++- app/controllers/web/login.py | 6 +++++- app/controllers/web/not_found.py | 6 +++++- app/controllers/web/register.py | 6 +++++- app/controllers/web/reset_password.py | 6 +++++- app/controllers/web/statistics.py | 6 +++++- app/controllers/web/status_page.py | 6 +++++- app/exceptions/missing_argument.py | 6 +++++- app/exceptions/sanitization_rule_not_found.py | 6 +++++- app/exceptions/validation_rule_not_found.py | 6 +++++- app/management/commands/health.py | 8 ++++++-- app/management/commands/silverback.py | 8 ++++++-- app/middleware/api_funnel.py | 6 +++++- app/middleware/correlation.py | 6 +++++- app/middleware/errors.py | 6 +++++- app/middleware/logging.py | 6 +++++- app/middleware/web_funnel.py | 6 +++++- app/models/activity.py | 6 +++++- app/models/component.py | 6 +++++- app/models/component_group.py | 6 +++++- app/models/custom_lookup.py | 6 +++++- app/models/incident.py | 6 +++++- app/models/incident_update.py | 6 +++++- app/models/incident_update_component.py | 6 +++++- app/models/incident_update_notification.py | 6 +++++- app/models/metric.py | 6 +++++- app/models/notification.py | 6 +++++- app/models/option.py | 6 +++++- app/models/profile.py | 6 +++++- app/models/register_request.py | 6 +++++- app/models/reset_request.py | 6 +++++- app/models/subscriber.py | 6 +++++- app/models/task.py | 6 +++++- app/models/user_meta.py | 6 +++++- app/modules/core/acl.py | 6 +++++- app/modules/core/activity.py | 6 +++++- app/modules/core/component.py | 6 +++++- app/modules/core/component_group.py | 6 +++++- app/modules/core/context.py | 6 +++++- app/modules/core/dashboard.py | 6 +++++- app/modules/core/decorators.py | 6 +++++- app/modules/core/forgot_password.py | 6 +++++- app/modules/core/funnel.py | 6 +++++- app/modules/core/health.py | 6 +++++- app/modules/core/incident.py | 6 +++++- app/modules/core/incident_update.py | 6 +++++- app/modules/core/incident_update_component.py | 6 +++++- app/modules/core/incident_update_notification.py | 6 +++++- app/modules/core/install.py | 6 +++++- app/modules/core/login.py | 6 +++++- app/modules/core/metric.py | 6 +++++- app/modules/core/notification.py | 6 +++++- app/modules/core/profile.py | 6 +++++- app/modules/core/request.py | 6 +++++- app/modules/core/reset_password.py | 6 +++++- app/modules/core/response.py | 6 +++++- app/modules/core/settings.py | 6 +++++- app/modules/core/statistics.py | 6 +++++- app/modules/core/status_page.py | 6 +++++- app/modules/core/subscriber.py | 6 +++++- app/modules/core/task.py | 6 +++++- app/modules/core/upgrade.py | 6 +++++- app/modules/core/user.py | 6 +++++- app/modules/entity/activity_entity.py | 6 +++++- app/modules/entity/component_entity.py | 6 +++++- app/modules/entity/component_group_entity.py | 6 +++++- app/modules/entity/incident_entity.py | 6 +++++- app/modules/entity/incident_update_component_entity.py | 6 +++++- app/modules/entity/incident_update_entity.py | 6 +++++- .../entity/incident_update_notification_entity.py | 6 +++++- app/modules/entity/metric_entity.py | 6 +++++- app/modules/entity/notification_entity.py | 6 +++++- app/modules/entity/option_entity.py | 6 +++++- app/modules/entity/profile_entity.py | 6 +++++- app/modules/entity/register_request_entity.py | 6 +++++- app/modules/entity/reset_request_entity.py | 6 +++++- app/modules/entity/subscriber_entity.py | 6 +++++- app/modules/entity/task_entity.py | 6 +++++- app/modules/entity/user_entity.py | 6 +++++- app/modules/service/prometheus.py | 6 +++++- app/modules/util/crypto.py | 6 +++++- app/modules/util/gravatar.py | 6 +++++- app/modules/util/helpers.py | 6 +++++- app/modules/util/humanize.py | 6 +++++- app/modules/util/io.py | 6 +++++- app/modules/util/token.py | 6 +++++- app/modules/validation/extension.py | 6 +++++- app/settings/info.py | 6 +++++- app/tasks/__init__.py | 6 +++++- app/tasks/forgot_password.py | 6 +++++- app/tasks/incident_update.py | 6 +++++- app/tasks/notify_subscriber.py | 6 +++++- app/tasks/ping.py | 6 +++++- app/tasks/register_request.py | 6 +++++- app/tasks/verify_subscription.py | 6 +++++- app/templatetags/extras.py | 9 ++++++--- app/tests/unit/modules/entity/test_option_entity.py | 6 +++++- app/urls.py | 6 +++++- 138 files changed, 694 insertions(+), 142 deletions(-) diff --git a/app/celery.py b/app/celery.py index 94cf508a..b09426e9 100644 --- a/app/celery.py +++ b/app/celery.py @@ -1,5 +1,9 @@ """ -Celery Configs + Celery Configs + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/context_processors.py b/app/context_processors.py index b0bfc290..ff45b3df 100644 --- a/app/context_processors.py +++ b/app/context_processors.py @@ -1,5 +1,9 @@ """ -Global Template Variables + Global Template Variables + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/api/private/v1/admin/activity.py b/app/controllers/api/private/v1/admin/activity.py index 61dc44ac..c637074d 100644 --- a/app/controllers/api/private/v1/admin/activity.py +++ b/app/controllers/api/private/v1/admin/activity.py @@ -1,5 +1,9 @@ """ -Activities API Endpoint + Activities API Endpoint + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/controllers/api/private/v1/admin/builder.py b/app/controllers/api/private/v1/admin/builder.py index 7b79de83..84d45e1d 100644 --- a/app/controllers/api/private/v1/admin/builder.py +++ b/app/controllers/api/private/v1/admin/builder.py @@ -1,5 +1,9 @@ """ -Builder API Endpoint + Builder API Endpoint + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/api/private/v1/admin/component.py b/app/controllers/api/private/v1/admin/component.py index b1f666d6..353daeba 100644 --- a/app/controllers/api/private/v1/admin/component.py +++ b/app/controllers/api/private/v1/admin/component.py @@ -1,5 +1,9 @@ """ -Component API Endpoint + Component API Endpoint + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/controllers/api/private/v1/admin/component_group.py b/app/controllers/api/private/v1/admin/component_group.py index 94da4bf4..d9c1baf0 100644 --- a/app/controllers/api/private/v1/admin/component_group.py +++ b/app/controllers/api/private/v1/admin/component_group.py @@ -1,5 +1,9 @@ """ -Component Groups API Endpoint + Component Groups API Endpoint + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/controllers/api/private/v1/admin/incident.py b/app/controllers/api/private/v1/admin/incident.py index 43dca158..793289fc 100644 --- a/app/controllers/api/private/v1/admin/incident.py +++ b/app/controllers/api/private/v1/admin/incident.py @@ -1,5 +1,9 @@ """ -Incident API Endpoint + Incident API Endpoint + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/controllers/api/private/v1/admin/incident_update.py b/app/controllers/api/private/v1/admin/incident_update.py index 9b12eda1..31cce524 100644 --- a/app/controllers/api/private/v1/admin/incident_update.py +++ b/app/controllers/api/private/v1/admin/incident_update.py @@ -1,5 +1,9 @@ """ -Incident Updates API Endpoint + Incident Updates API Endpoint + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/controllers/api/private/v1/admin/metric.py b/app/controllers/api/private/v1/admin/metric.py index 11884217..9a38f74c 100644 --- a/app/controllers/api/private/v1/admin/metric.py +++ b/app/controllers/api/private/v1/admin/metric.py @@ -1,5 +1,9 @@ """ -Metrics API Endpoint + Metrics API Endpoint + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/controllers/api/private/v1/admin/notifications.py b/app/controllers/api/private/v1/admin/notifications.py index d8c75b6a..cf6988d8 100644 --- a/app/controllers/api/private/v1/admin/notifications.py +++ b/app/controllers/api/private/v1/admin/notifications.py @@ -1,5 +1,9 @@ """ -Notifications API Endpoint + Notifications API Endpoint + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/controllers/api/private/v1/admin/profile.py b/app/controllers/api/private/v1/admin/profile.py index 1d1fe6e5..4f24c5b9 100644 --- a/app/controllers/api/private/v1/admin/profile.py +++ b/app/controllers/api/private/v1/admin/profile.py @@ -1,5 +1,9 @@ """ -Profile API Endpoint + Profile API Endpoint + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/controllers/api/private/v1/admin/settings.py b/app/controllers/api/private/v1/admin/settings.py index 9096f6a1..e1090433 100644 --- a/app/controllers/api/private/v1/admin/settings.py +++ b/app/controllers/api/private/v1/admin/settings.py @@ -1,5 +1,9 @@ """ -Settings API Endpoint + Settings API Endpoint + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/controllers/api/private/v1/admin/subscriber.py b/app/controllers/api/private/v1/admin/subscriber.py index 032b37fd..300478a7 100644 --- a/app/controllers/api/private/v1/admin/subscriber.py +++ b/app/controllers/api/private/v1/admin/subscriber.py @@ -1,5 +1,9 @@ """ -Subscriber API Endpoint + Subscriber API Endpoint + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/controllers/api/private/v1/admin/user.py b/app/controllers/api/private/v1/admin/user.py index d636d779..0c2f6dc2 100644 --- a/app/controllers/api/private/v1/admin/user.py +++ b/app/controllers/api/private/v1/admin/user.py @@ -1,5 +1,9 @@ """ -User API Endpoint + User API Endpoint + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/controllers/api/private/v1/forbidden.py b/app/controllers/api/private/v1/forbidden.py index eaf5bc73..7bc32248 100644 --- a/app/controllers/api/private/v1/forbidden.py +++ b/app/controllers/api/private/v1/forbidden.py @@ -1,5 +1,9 @@ """ -Forbidden Access Views + Forbidden Access Views + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/controllers/api/private/v1/forgot_password.py b/app/controllers/api/private/v1/forgot_password.py index a8b1bd7b..de2bfc32 100644 --- a/app/controllers/api/private/v1/forgot_password.py +++ b/app/controllers/api/private/v1/forgot_password.py @@ -1,5 +1,9 @@ """ -Forgot Password API Endpoint + Forgot Password API Endpoint + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/controllers/api/private/v1/install.py b/app/controllers/api/private/v1/install.py index 704dfbf4..657751e3 100644 --- a/app/controllers/api/private/v1/install.py +++ b/app/controllers/api/private/v1/install.py @@ -1,5 +1,9 @@ """ -Install API Endpoint + Install API Endpoint + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library @@ -19,6 +23,7 @@ class Install(View): + """Install Endpoints Controller""" __request = None __response = None diff --git a/app/controllers/api/private/v1/login.py b/app/controllers/api/private/v1/login.py index 5047ad45..737c3a27 100644 --- a/app/controllers/api/private/v1/login.py +++ b/app/controllers/api/private/v1/login.py @@ -1,5 +1,9 @@ """ -Login API Endpoint + Login API Endpoint + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/controllers/api/private/v1/register.py b/app/controllers/api/private/v1/register.py index 998813eb..f172864b 100644 --- a/app/controllers/api/private/v1/register.py +++ b/app/controllers/api/private/v1/register.py @@ -1,5 +1,9 @@ """ -Register API Endpoint + Register API Endpoint + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/api/private/v1/reset_password.py b/app/controllers/api/private/v1/reset_password.py index fab4d26f..6a8aa23a 100644 --- a/app/controllers/api/private/v1/reset_password.py +++ b/app/controllers/api/private/v1/reset_password.py @@ -1,5 +1,9 @@ """ -Reset Password API Endpoint + Reset Password API Endpoint + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/controllers/api/private/v1/status.py b/app/controllers/api/private/v1/status.py index 4c640a61..0693914c 100644 --- a/app/controllers/api/private/v1/status.py +++ b/app/controllers/api/private/v1/status.py @@ -1,5 +1,9 @@ """ -Status Page API Endpoint + Status Page API Endpoint + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/controllers/api/public/v1/auth.py b/app/controllers/api/public/v1/auth.py index 7e2a92d9..f54a4df3 100644 --- a/app/controllers/api/public/v1/auth.py +++ b/app/controllers/api/public/v1/auth.py @@ -1,5 +1,9 @@ """ -Auth API Endpoint + Auth API Endpoint + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/controllers/web/admin/activity.py b/app/controllers/web/admin/activity.py index 6d6dca1a..addc7831 100644 --- a/app/controllers/web/admin/activity.py +++ b/app/controllers/web/admin/activity.py @@ -1,5 +1,9 @@ """ -Activity Web Controller + Activity Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/web/admin/builder.py b/app/controllers/web/admin/builder.py index 722061a3..55ade5d4 100644 --- a/app/controllers/web/admin/builder.py +++ b/app/controllers/web/admin/builder.py @@ -1,5 +1,9 @@ """ -Builder Web Controller + Builder Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/web/admin/component.py b/app/controllers/web/admin/component.py index b78bfe00..c5c3c9e1 100644 --- a/app/controllers/web/admin/component.py +++ b/app/controllers/web/admin/component.py @@ -1,5 +1,9 @@ """ -Component Web Controller + Component Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/web/admin/component_group.py b/app/controllers/web/admin/component_group.py index 3f4d7a3b..2b67fa17 100644 --- a/app/controllers/web/admin/component_group.py +++ b/app/controllers/web/admin/component_group.py @@ -1,5 +1,9 @@ """ -Component Group Web Controller + Component Group Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/web/admin/dashboard.py b/app/controllers/web/admin/dashboard.py index 8c80f121..2f2306e4 100644 --- a/app/controllers/web/admin/dashboard.py +++ b/app/controllers/web/admin/dashboard.py @@ -1,5 +1,9 @@ """ -Dashboard Web Controller + Dashboard Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/web/admin/incident.py b/app/controllers/web/admin/incident.py index 27905bc3..08279250 100644 --- a/app/controllers/web/admin/incident.py +++ b/app/controllers/web/admin/incident.py @@ -1,5 +1,9 @@ """ -Incident Web Controller + Incident Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/web/admin/incident_update.py b/app/controllers/web/admin/incident_update.py index 04ca01b7..394d79aa 100644 --- a/app/controllers/web/admin/incident_update.py +++ b/app/controllers/web/admin/incident_update.py @@ -1,5 +1,9 @@ """ -Incident Update Web Controller + Incident Update Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/web/admin/logout.py b/app/controllers/web/admin/logout.py index 67c3d2f3..bc695155 100644 --- a/app/controllers/web/admin/logout.py +++ b/app/controllers/web/admin/logout.py @@ -1,5 +1,9 @@ """ -Logout Web Controller + Logout Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/controllers/web/admin/metric.py b/app/controllers/web/admin/metric.py index 288debde..46db8ae3 100644 --- a/app/controllers/web/admin/metric.py +++ b/app/controllers/web/admin/metric.py @@ -1,5 +1,9 @@ """ -Metric Web Controller + Metric Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/web/admin/notification.py b/app/controllers/web/admin/notification.py index 94b3c698..e5e11202 100644 --- a/app/controllers/web/admin/notification.py +++ b/app/controllers/web/admin/notification.py @@ -1,5 +1,9 @@ """ -Notification Web Controller + Notification Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/web/admin/profile.py b/app/controllers/web/admin/profile.py index f034dd88..bf36a526 100644 --- a/app/controllers/web/admin/profile.py +++ b/app/controllers/web/admin/profile.py @@ -1,5 +1,9 @@ """ -Profile Web Controller + Profile Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/web/admin/settings.py b/app/controllers/web/admin/settings.py index 617fcc4f..fb8fc506 100644 --- a/app/controllers/web/admin/settings.py +++ b/app/controllers/web/admin/settings.py @@ -1,5 +1,9 @@ """ -Settings Web Controller + Settings Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/web/admin/subscriber.py b/app/controllers/web/admin/subscriber.py index 06060284..36b2c7be 100644 --- a/app/controllers/web/admin/subscriber.py +++ b/app/controllers/web/admin/subscriber.py @@ -1,5 +1,9 @@ """ -Subscriber Web Controller + Subscriber Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/web/admin/user.py b/app/controllers/web/admin/user.py index d4d798ae..3f7aa827 100644 --- a/app/controllers/web/admin/user.py +++ b/app/controllers/web/admin/user.py @@ -1,5 +1,9 @@ """ -User Web Controller + User Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/web/error.py b/app/controllers/web/error.py index 905ed15c..528b24c1 100644 --- a/app/controllers/web/error.py +++ b/app/controllers/web/error.py @@ -1,5 +1,9 @@ """ -Error Web Controller + Error Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/web/forgot_password.py b/app/controllers/web/forgot_password.py index 79001f7d..0c157d50 100644 --- a/app/controllers/web/forgot_password.py +++ b/app/controllers/web/forgot_password.py @@ -1,5 +1,9 @@ """ -Forgot Password Web Controller + Forgot Password Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/web/health_check.py b/app/controllers/web/health_check.py index 546c1f43..f2faaf79 100644 --- a/app/controllers/web/health_check.py +++ b/app/controllers/web/health_check.py @@ -1,5 +1,9 @@ """ -Health Check Web Controller + Health Check Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/controllers/web/history.py b/app/controllers/web/history.py index 41de04a5..78203ad8 100644 --- a/app/controllers/web/history.py +++ b/app/controllers/web/history.py @@ -1,5 +1,9 @@ """ -History Web Controller + History Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/web/install.py b/app/controllers/web/install.py index 06854415..ef325a8b 100644 --- a/app/controllers/web/install.py +++ b/app/controllers/web/install.py @@ -1,5 +1,9 @@ """ -Install Web Controller + Install Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/web/login.py b/app/controllers/web/login.py index 3b065fea..1b72601b 100644 --- a/app/controllers/web/login.py +++ b/app/controllers/web/login.py @@ -1,5 +1,9 @@ """ -Login Web Controller + Login Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/web/not_found.py b/app/controllers/web/not_found.py index bb5a4112..a8d9271e 100644 --- a/app/controllers/web/not_found.py +++ b/app/controllers/web/not_found.py @@ -1,5 +1,9 @@ """ -Not Found Web Controller + Not Found Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/web/register.py b/app/controllers/web/register.py index a82c7b65..887b5f1a 100644 --- a/app/controllers/web/register.py +++ b/app/controllers/web/register.py @@ -1,5 +1,9 @@ """ -Register Web Controller + Register Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/web/reset_password.py b/app/controllers/web/reset_password.py index f3055a88..4d09cb03 100644 --- a/app/controllers/web/reset_password.py +++ b/app/controllers/web/reset_password.py @@ -1,5 +1,9 @@ """ -Reset Password Web Controller + Reset Password Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/controllers/web/statistics.py b/app/controllers/web/statistics.py index c073681b..a6af30ce 100644 --- a/app/controllers/web/statistics.py +++ b/app/controllers/web/statistics.py @@ -1,5 +1,9 @@ """ -Statistics Web Controller + Statistics Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/controllers/web/status_page.py b/app/controllers/web/status_page.py index 3b5347d2..c5295c18 100644 --- a/app/controllers/web/status_page.py +++ b/app/controllers/web/status_page.py @@ -1,5 +1,9 @@ """ -Status Page Web Controller + Status Page Web Controller + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/exceptions/missing_argument.py b/app/exceptions/missing_argument.py index b3ff9cad..b45b404d 100644 --- a/app/exceptions/missing_argument.py +++ b/app/exceptions/missing_argument.py @@ -1,5 +1,9 @@ """ -Missing Argument Exception + Missing Argument Exception + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ diff --git a/app/exceptions/sanitization_rule_not_found.py b/app/exceptions/sanitization_rule_not_found.py index 2f3e2f97..8be54229 100644 --- a/app/exceptions/sanitization_rule_not_found.py +++ b/app/exceptions/sanitization_rule_not_found.py @@ -1,5 +1,9 @@ """ -Sanitization Rule Not Found + Sanitization Rule Not Found + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ diff --git a/app/exceptions/validation_rule_not_found.py b/app/exceptions/validation_rule_not_found.py index 89aafb7f..3e3934cd 100644 --- a/app/exceptions/validation_rule_not_found.py +++ b/app/exceptions/validation_rule_not_found.py @@ -1,5 +1,9 @@ """ -Validation Rule Not Found + Validation Rule Not Found + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ diff --git a/app/management/commands/health.py b/app/management/commands/health.py index 16be5125..4acb100f 100644 --- a/app/management/commands/health.py +++ b/app/management/commands/health.py @@ -1,7 +1,11 @@ """ -Health Check Command + Health Check Command + ~~~~~~~~~~~~~~ -see https://docs.djangoproject.com/en/2.0/howto/custom-management-commands/ + see https://docs.djangoproject.com/en/2.0/howto/custom-management-commands/ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/management/commands/silverback.py b/app/management/commands/silverback.py index 6c485332..8b1285d9 100644 --- a/app/management/commands/silverback.py +++ b/app/management/commands/silverback.py @@ -1,7 +1,11 @@ """ -Silverback Info Command + Silverback Info Command + ~~~~~~~~~~~~~~ -see https://docs.djangoproject.com/en/2.0/howto/custom-management-commands/ + see https://docs.djangoproject.com/en/2.0/howto/custom-management-commands/ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/middleware/api_funnel.py b/app/middleware/api_funnel.py index 61eeabad..7c437c9d 100644 --- a/app/middleware/api_funnel.py +++ b/app/middleware/api_funnel.py @@ -1,5 +1,9 @@ """ -API Funnel Middleware + API Funnel Middleware + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Local Library diff --git a/app/middleware/correlation.py b/app/middleware/correlation.py index 2ad109d2..a6fcda61 100644 --- a/app/middleware/correlation.py +++ b/app/middleware/correlation.py @@ -1,5 +1,9 @@ """ -Correlation Middleware + Correlation Middleware + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Local Library diff --git a/app/middleware/errors.py b/app/middleware/errors.py index 9c9df147..9fb34e28 100644 --- a/app/middleware/errors.py +++ b/app/middleware/errors.py @@ -1,5 +1,9 @@ """ -Errors Middleware + Errors Middleware + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/middleware/logging.py b/app/middleware/logging.py index e286a501..c4865d3d 100644 --- a/app/middleware/logging.py +++ b/app/middleware/logging.py @@ -1,5 +1,9 @@ """ -Logging Middleware + Logging Middleware + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/middleware/web_funnel.py b/app/middleware/web_funnel.py index 10efc5ee..98ab217c 100644 --- a/app/middleware/web_funnel.py +++ b/app/middleware/web_funnel.py @@ -1,5 +1,9 @@ """ -Web Funnel Middleware + Web Funnel Middleware + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Local Library diff --git a/app/models/activity.py b/app/models/activity.py index 8882e207..055d4d7e 100644 --- a/app/models/activity.py +++ b/app/models/activity.py @@ -1,5 +1,9 @@ """ -Activity Model + Activity Model + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/models/component.py b/app/models/component.py index 37a959de..3bede05b 100644 --- a/app/models/component.py +++ b/app/models/component.py @@ -1,5 +1,9 @@ """ -Component Model + Component Model + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/models/component_group.py b/app/models/component_group.py index bb46e430..e37bfeba 100644 --- a/app/models/component_group.py +++ b/app/models/component_group.py @@ -1,5 +1,9 @@ """ -Component Model + Component Model + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/models/custom_lookup.py b/app/models/custom_lookup.py index e11556e0..47bdeee4 100644 --- a/app/models/custom_lookup.py +++ b/app/models/custom_lookup.py @@ -1,5 +1,9 @@ """ -Custom Lookup + Custom Lookup + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/models/incident.py b/app/models/incident.py index af202a49..11cfcaaa 100644 --- a/app/models/incident.py +++ b/app/models/incident.py @@ -1,5 +1,9 @@ """ -Incident Model + Incident Model + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/models/incident_update.py b/app/models/incident_update.py index a6ee3b05..b11c39e8 100644 --- a/app/models/incident_update.py +++ b/app/models/incident_update.py @@ -1,5 +1,9 @@ """ -Incident Update Model + Incident Update Model + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/models/incident_update_component.py b/app/models/incident_update_component.py index e9ffb3e4..440fbfdc 100644 --- a/app/models/incident_update_component.py +++ b/app/models/incident_update_component.py @@ -1,5 +1,9 @@ """ -Incident Update Notification Model + Incident Update Notification Model + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/models/incident_update_notification.py b/app/models/incident_update_notification.py index 27caf10d..543f004a 100644 --- a/app/models/incident_update_notification.py +++ b/app/models/incident_update_notification.py @@ -1,5 +1,9 @@ """ -Incident Update Notification Model + Incident Update Notification Model + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/models/metric.py b/app/models/metric.py index e134a320..8abdf749 100644 --- a/app/models/metric.py +++ b/app/models/metric.py @@ -1,5 +1,9 @@ """ -Metric Model + Metric Model + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/models/notification.py b/app/models/notification.py index a39f962e..5f69ae62 100644 --- a/app/models/notification.py +++ b/app/models/notification.py @@ -1,5 +1,9 @@ """ -Notification Model + Notification Model + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/models/option.py b/app/models/option.py index e9de6280..b6730ba8 100644 --- a/app/models/option.py +++ b/app/models/option.py @@ -1,5 +1,9 @@ """ -Option Model + Option Model + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/models/profile.py b/app/models/profile.py index ae613040..68947af5 100644 --- a/app/models/profile.py +++ b/app/models/profile.py @@ -1,5 +1,9 @@ """ -Profile Model + Profile Model + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/models/register_request.py b/app/models/register_request.py index 5f28bcbc..bcb4fe29 100644 --- a/app/models/register_request.py +++ b/app/models/register_request.py @@ -1,5 +1,9 @@ """ -Register Request Model + Register Request Model + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/models/reset_request.py b/app/models/reset_request.py index 93e8d22a..8db8017d 100644 --- a/app/models/reset_request.py +++ b/app/models/reset_request.py @@ -1,5 +1,9 @@ """ -Reset Request Model + Reset Request Model + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/models/subscriber.py b/app/models/subscriber.py index bbbe46ac..e4856bed 100644 --- a/app/models/subscriber.py +++ b/app/models/subscriber.py @@ -1,5 +1,9 @@ """ -Subscriber Model + Subscriber Model + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/models/task.py b/app/models/task.py index 41170199..7e3786a7 100644 --- a/app/models/task.py +++ b/app/models/task.py @@ -1,5 +1,9 @@ """ -Task Model + Task Model + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/models/user_meta.py b/app/models/user_meta.py index c052b7e3..075df3db 100644 --- a/app/models/user_meta.py +++ b/app/models/user_meta.py @@ -1,5 +1,9 @@ """ -User Meta Model + User Meta Model + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/modules/core/acl.py b/app/modules/core/acl.py index 07292bb4..8a307e4b 100644 --- a/app/modules/core/acl.py +++ b/app/modules/core/acl.py @@ -1,5 +1,9 @@ """ -ACL Module + ACL Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/modules/core/activity.py b/app/modules/core/activity.py index 974c101d..c92cd27f 100644 --- a/app/modules/core/activity.py +++ b/app/modules/core/activity.py @@ -1,5 +1,9 @@ """ -Activity Module + Activity Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Local Library diff --git a/app/modules/core/component.py b/app/modules/core/component.py index f9c0ecfa..c2514521 100644 --- a/app/modules/core/component.py +++ b/app/modules/core/component.py @@ -1,5 +1,9 @@ """ -Component Module + Component Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Local Library diff --git a/app/modules/core/component_group.py b/app/modules/core/component_group.py index 4eae4ea6..03447fbe 100644 --- a/app/modules/core/component_group.py +++ b/app/modules/core/component_group.py @@ -1,5 +1,9 @@ """ -Component Group Module + Component Group Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Local Library diff --git a/app/modules/core/context.py b/app/modules/core/context.py index 94f48f05..71fc44ef 100644 --- a/app/modules/core/context.py +++ b/app/modules/core/context.py @@ -1,5 +1,9 @@ """ -Context Module + Context Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Local Library diff --git a/app/modules/core/dashboard.py b/app/modules/core/dashboard.py index dd15d56a..35af66b8 100644 --- a/app/modules/core/dashboard.py +++ b/app/modules/core/dashboard.py @@ -1,5 +1,9 @@ """ -Dashboard Module + Dashboard Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/modules/core/decorators.py b/app/modules/core/decorators.py index 5bff4381..ed25b747 100644 --- a/app/modules/core/decorators.py +++ b/app/modules/core/decorators.py @@ -1,5 +1,9 @@ """ -Custom Decorators + Custom Decorators + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/modules/core/forgot_password.py b/app/modules/core/forgot_password.py index 547cb59d..6a4dce0e 100644 --- a/app/modules/core/forgot_password.py +++ b/app/modules/core/forgot_password.py @@ -1,5 +1,9 @@ """ -Forgot Password Module + Forgot Password Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/modules/core/funnel.py b/app/modules/core/funnel.py index 5c05d92a..8d6d107b 100644 --- a/app/modules/core/funnel.py +++ b/app/modules/core/funnel.py @@ -1,5 +1,9 @@ """ -Funnel Module + Funnel Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ diff --git a/app/modules/core/health.py b/app/modules/core/health.py index f8c43d02..d10d7cf7 100644 --- a/app/modules/core/health.py +++ b/app/modules/core/health.py @@ -1,5 +1,9 @@ """ -Health Module + Health Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/modules/core/incident.py b/app/modules/core/incident.py index b231ec1c..34c6f1ee 100644 --- a/app/modules/core/incident.py +++ b/app/modules/core/incident.py @@ -1,5 +1,9 @@ """ -Incident Module + Incident Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Local Library diff --git a/app/modules/core/incident_update.py b/app/modules/core/incident_update.py index 265a3b18..29009744 100644 --- a/app/modules/core/incident_update.py +++ b/app/modules/core/incident_update.py @@ -1,5 +1,9 @@ """ -Incident Update Module + Incident Update Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Local Library diff --git a/app/modules/core/incident_update_component.py b/app/modules/core/incident_update_component.py index 9f4a81e5..b4758d9e 100644 --- a/app/modules/core/incident_update_component.py +++ b/app/modules/core/incident_update_component.py @@ -1,5 +1,9 @@ """ -Incident Update Component Module + Incident Update Component Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Local Library diff --git a/app/modules/core/incident_update_notification.py b/app/modules/core/incident_update_notification.py index 7cc46f8b..6a41df8d 100644 --- a/app/modules/core/incident_update_notification.py +++ b/app/modules/core/incident_update_notification.py @@ -1,5 +1,9 @@ """ -Incident Update Notification Module + Incident Update Notification Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Local Library diff --git a/app/modules/core/install.py b/app/modules/core/install.py index 4a47f5df..760b4240 100644 --- a/app/modules/core/install.py +++ b/app/modules/core/install.py @@ -1,5 +1,9 @@ """ -Install Module + Install Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/modules/core/login.py b/app/modules/core/login.py index 3aac9581..c8f328f5 100644 --- a/app/modules/core/login.py +++ b/app/modules/core/login.py @@ -1,5 +1,9 @@ """ -Login Module + Login Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/modules/core/metric.py b/app/modules/core/metric.py index 991ccd2f..69ab4b61 100644 --- a/app/modules/core/metric.py +++ b/app/modules/core/metric.py @@ -1,5 +1,9 @@ """ -Metric Module + Metric Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/modules/core/notification.py b/app/modules/core/notification.py index 91ebf934..8edf0bb9 100644 --- a/app/modules/core/notification.py +++ b/app/modules/core/notification.py @@ -1,5 +1,9 @@ """ -Task Module + Task Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Local Library diff --git a/app/modules/core/profile.py b/app/modules/core/profile.py index b03d1bbc..4dc854a2 100644 --- a/app/modules/core/profile.py +++ b/app/modules/core/profile.py @@ -1,5 +1,9 @@ """ -Profile Module + Profile Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/modules/core/request.py b/app/modules/core/request.py index 06cc94c7..f779e606 100644 --- a/app/modules/core/request.py +++ b/app/modules/core/request.py @@ -1,5 +1,9 @@ """ -Request Module + Request Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/modules/core/reset_password.py b/app/modules/core/reset_password.py index d3e63511..1ced7a3e 100644 --- a/app/modules/core/reset_password.py +++ b/app/modules/core/reset_password.py @@ -1,5 +1,9 @@ """ -Reset Password Module + Reset Password Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/modules/core/response.py b/app/modules/core/response.py index 406ab8bf..9b51ea73 100644 --- a/app/modules/core/response.py +++ b/app/modules/core/response.py @@ -1,5 +1,9 @@ """ -Response Module + Response Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/modules/core/settings.py b/app/modules/core/settings.py index d7045fcf..73abf8ec 100644 --- a/app/modules/core/settings.py +++ b/app/modules/core/settings.py @@ -1,5 +1,9 @@ """ -Settings Module + Settings Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Local Library diff --git a/app/modules/core/statistics.py b/app/modules/core/statistics.py index 90cb42f0..6932a1b5 100644 --- a/app/modules/core/statistics.py +++ b/app/modules/core/statistics.py @@ -1,5 +1,9 @@ """ -Statistics Module + Statistics Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Local Library diff --git a/app/modules/core/status_page.py b/app/modules/core/status_page.py index ff973c64..272b7db9 100644 --- a/app/modules/core/status_page.py +++ b/app/modules/core/status_page.py @@ -1,5 +1,9 @@ """ -Status Page Module + Status Page Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/modules/core/subscriber.py b/app/modules/core/subscriber.py index 865c6a77..e8ba38ec 100644 --- a/app/modules/core/subscriber.py +++ b/app/modules/core/subscriber.py @@ -1,5 +1,9 @@ """ -Subscriber Module + Subscriber Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Local Library diff --git a/app/modules/core/task.py b/app/modules/core/task.py index 6608608b..13ad908f 100644 --- a/app/modules/core/task.py +++ b/app/modules/core/task.py @@ -1,5 +1,9 @@ """ -Task Module + Task Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/modules/core/upgrade.py b/app/modules/core/upgrade.py index ae6fa056..8ddc2d7b 100644 --- a/app/modules/core/upgrade.py +++ b/app/modules/core/upgrade.py @@ -1,5 +1,9 @@ """ -Upgrade Module + Upgrade Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/modules/core/user.py b/app/modules/core/user.py index 679cb126..ad55be8c 100644 --- a/app/modules/core/user.py +++ b/app/modules/core/user.py @@ -1,5 +1,9 @@ """ -User Module + User Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/modules/entity/activity_entity.py b/app/modules/entity/activity_entity.py index 83573c6c..e55fb5e5 100644 --- a/app/modules/entity/activity_entity.py +++ b/app/modules/entity/activity_entity.py @@ -1,5 +1,9 @@ """ -Activity Entity Module + Activity Entity + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/modules/entity/component_entity.py b/app/modules/entity/component_entity.py index ff039288..9f574846 100644 --- a/app/modules/entity/component_entity.py +++ b/app/modules/entity/component_entity.py @@ -1,5 +1,9 @@ """ -Component Entity Module + Component Entity + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Local Library diff --git a/app/modules/entity/component_group_entity.py b/app/modules/entity/component_group_entity.py index 7ad8243b..10ee99a9 100644 --- a/app/modules/entity/component_group_entity.py +++ b/app/modules/entity/component_group_entity.py @@ -1,5 +1,9 @@ """ -Component Group Entity Module + Component Group Entity + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Local Library diff --git a/app/modules/entity/incident_entity.py b/app/modules/entity/incident_entity.py index 593a9c20..b5131807 100644 --- a/app/modules/entity/incident_entity.py +++ b/app/modules/entity/incident_entity.py @@ -1,5 +1,9 @@ """ -Incident Entity Module + Incident Entity + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/modules/entity/incident_update_component_entity.py b/app/modules/entity/incident_update_component_entity.py index 84063061..7ccca9bc 100644 --- a/app/modules/entity/incident_update_component_entity.py +++ b/app/modules/entity/incident_update_component_entity.py @@ -1,5 +1,9 @@ """ -Incident Update Component Module + Incident Update Component Entity + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/modules/entity/incident_update_entity.py b/app/modules/entity/incident_update_entity.py index 39ee492f..e37747a9 100644 --- a/app/modules/entity/incident_update_entity.py +++ b/app/modules/entity/incident_update_entity.py @@ -1,5 +1,9 @@ """ -Incident Update Entity Module + Incident Update Entity + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/modules/entity/incident_update_notification_entity.py b/app/modules/entity/incident_update_notification_entity.py index b425cde2..d10707c2 100644 --- a/app/modules/entity/incident_update_notification_entity.py +++ b/app/modules/entity/incident_update_notification_entity.py @@ -1,5 +1,9 @@ """ -Incident Update Notification Module + Incident Update Notification Entity + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/modules/entity/metric_entity.py b/app/modules/entity/metric_entity.py index 0d6406b1..284fe8ea 100644 --- a/app/modules/entity/metric_entity.py +++ b/app/modules/entity/metric_entity.py @@ -1,5 +1,9 @@ """ -Metric Entity Module + Metric Entity + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Local Library diff --git a/app/modules/entity/notification_entity.py b/app/modules/entity/notification_entity.py index c6649d4b..7e77de25 100644 --- a/app/modules/entity/notification_entity.py +++ b/app/modules/entity/notification_entity.py @@ -1,5 +1,9 @@ """ -Notification Entity Module + Notification Entity + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/modules/entity/option_entity.py b/app/modules/entity/option_entity.py index 9a2405bb..8cfae7d7 100644 --- a/app/modules/entity/option_entity.py +++ b/app/modules/entity/option_entity.py @@ -1,5 +1,9 @@ """ -Option Entity Module + Option Entity + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Local Library diff --git a/app/modules/entity/profile_entity.py b/app/modules/entity/profile_entity.py index 872c91a1..f74b14a6 100644 --- a/app/modules/entity/profile_entity.py +++ b/app/modules/entity/profile_entity.py @@ -1,5 +1,9 @@ """ -User Entity Module + Profile Entity + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/modules/entity/register_request_entity.py b/app/modules/entity/register_request_entity.py index 71958eb7..1a31b074 100644 --- a/app/modules/entity/register_request_entity.py +++ b/app/modules/entity/register_request_entity.py @@ -1,5 +1,9 @@ """ -Register Request Entity Module + Register Request Entity + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/modules/entity/reset_request_entity.py b/app/modules/entity/reset_request_entity.py index 95e79e5f..b65b0b03 100644 --- a/app/modules/entity/reset_request_entity.py +++ b/app/modules/entity/reset_request_entity.py @@ -1,5 +1,9 @@ """ -Reset Request Entity Module + Reset Request Entity + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/modules/entity/subscriber_entity.py b/app/modules/entity/subscriber_entity.py index 418b4798..2d05c1d5 100644 --- a/app/modules/entity/subscriber_entity.py +++ b/app/modules/entity/subscriber_entity.py @@ -1,5 +1,9 @@ """ -Subscriber Entity Module + Subscriber Entity + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/modules/entity/task_entity.py b/app/modules/entity/task_entity.py index 56d703ff..479f42e8 100644 --- a/app/modules/entity/task_entity.py +++ b/app/modules/entity/task_entity.py @@ -1,5 +1,9 @@ """ -Task Entity Module + Task Entity + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/modules/entity/user_entity.py b/app/modules/entity/user_entity.py index f437201a..ab2b77be 100644 --- a/app/modules/entity/user_entity.py +++ b/app/modules/entity/user_entity.py @@ -1,5 +1,9 @@ """ -User Entity Module + User Entity + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/modules/service/prometheus.py b/app/modules/service/prometheus.py index 59ff7262..324fd2d2 100644 --- a/app/modules/service/prometheus.py +++ b/app/modules/service/prometheus.py @@ -1,5 +1,9 @@ """ -Prometheus Service + Prometheus Service + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ diff --git a/app/modules/util/crypto.py b/app/modules/util/crypto.py index b203f87a..768ba2ce 100644 --- a/app/modules/util/crypto.py +++ b/app/modules/util/crypto.py @@ -1,5 +1,9 @@ """ -Crypto Module + Crypto Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/modules/util/gravatar.py b/app/modules/util/gravatar.py index 9e270a23..6e2cf044 100644 --- a/app/modules/util/gravatar.py +++ b/app/modules/util/gravatar.py @@ -1,5 +1,9 @@ """ -Gravatar Module + Gravatar Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/modules/util/helpers.py b/app/modules/util/helpers.py index d62393b3..d10ce55e 100644 --- a/app/modules/util/helpers.py +++ b/app/modules/util/helpers.py @@ -1,5 +1,9 @@ """ -Helpers Module + Helpers Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/modules/util/humanize.py b/app/modules/util/humanize.py index de527d54..50104b29 100644 --- a/app/modules/util/humanize.py +++ b/app/modules/util/humanize.py @@ -1,5 +1,9 @@ """ -Humanize Module + Humanize Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/modules/util/io.py b/app/modules/util/io.py index a5641081..061b0dba 100644 --- a/app/modules/util/io.py +++ b/app/modules/util/io.py @@ -1,5 +1,9 @@ """ -Crypto Module + Crypto Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/modules/util/token.py b/app/modules/util/token.py index 962a27fb..e75ec479 100644 --- a/app/modules/util/token.py +++ b/app/modules/util/token.py @@ -1,5 +1,9 @@ """ -Token Module + Token Module + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/modules/validation/extension.py b/app/modules/validation/extension.py index fe5b4f32..b46eb547 100644 --- a/app/modules/validation/extension.py +++ b/app/modules/validation/extension.py @@ -1,5 +1,9 @@ """ -Validation Extensions + Validation Extensions + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/settings/info.py b/app/settings/info.py index 5b8651e9..c627ae3e 100644 --- a/app/settings/info.py +++ b/app/settings/info.py @@ -1,5 +1,9 @@ """ -Silverback Info + Silverback Info + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/tasks/__init__.py b/app/tasks/__init__.py index 48ce0b60..ac083ddc 100644 --- a/app/tasks/__init__.py +++ b/app/tasks/__init__.py @@ -1,5 +1,9 @@ """ -Load Tasks + Load Tasks + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ from .forgot_password import * # noqa: F401 F403 diff --git a/app/tasks/forgot_password.py b/app/tasks/forgot_password.py index c9ec302a..298c9bf4 100644 --- a/app/tasks/forgot_password.py +++ b/app/tasks/forgot_password.py @@ -1,5 +1,9 @@ """ -Forgot Password Tasks + Forgot Password Tasks + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/tasks/incident_update.py b/app/tasks/incident_update.py index 8328c45b..2f71e503 100644 --- a/app/tasks/incident_update.py +++ b/app/tasks/incident_update.py @@ -1,5 +1,9 @@ """ -Incident Update Tasks + Incident Update Tasks + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/tasks/notify_subscriber.py b/app/tasks/notify_subscriber.py index 80e2ea6b..801d9ba3 100644 --- a/app/tasks/notify_subscriber.py +++ b/app/tasks/notify_subscriber.py @@ -1,5 +1,9 @@ """ -Notify Subscriber Tasks + Notify Subscriber Tasks + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Standard Library diff --git a/app/tasks/ping.py b/app/tasks/ping.py index 3d1f29d4..3e8cc178 100644 --- a/app/tasks/ping.py +++ b/app/tasks/ping.py @@ -1,5 +1,9 @@ """ -Test Tasks + Test Tasks + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/tasks/register_request.py b/app/tasks/register_request.py index 22a558a7..0dc695ce 100644 --- a/app/tasks/register_request.py +++ b/app/tasks/register_request.py @@ -1,5 +1,9 @@ """ -Register Request Tasks + Register Request Tasks + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/tasks/verify_subscription.py b/app/tasks/verify_subscription.py index a8795a96..5f44d809 100644 --- a/app/tasks/verify_subscription.py +++ b/app/tasks/verify_subscription.py @@ -1,5 +1,9 @@ """ -Verify Subscription Tasks + Verify Subscription Tasks + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/templatetags/extras.py b/app/templatetags/extras.py index 76272057..177b1ded 100644 --- a/app/templatetags/extras.py +++ b/app/templatetags/extras.py @@ -1,9 +1,12 @@ """ -Template Extra Tags + Template Extra Tags + ~~~~~~~~~~~~~~ -{% load extras %} + {% load extras %} + {{ somevariable|cut:"0" }} -{{ somevariable|cut:"0" }} + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library diff --git a/app/tests/unit/modules/entity/test_option_entity.py b/app/tests/unit/modules/entity/test_option_entity.py index eaa7ad67..88417d42 100644 --- a/app/tests/unit/modules/entity/test_option_entity.py +++ b/app/tests/unit/modules/entity/test_option_entity.py @@ -1,5 +1,9 @@ """ -Option Entity Test Cases + Option Entity Test Cases + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ from django.test import TestCase diff --git a/app/urls.py b/app/urls.py index 43da0bfd..2c919566 100644 --- a/app/urls.py +++ b/app/urls.py @@ -1,5 +1,9 @@ """ -Routes For Silverback + Routes For Silverback + ~~~~~~~~~~~~~~ + + :copyright: silverbackhq + :license: BSD-3-Clause """ # Third Party Library From a753cc41b3b3c99dd5eeeb10e51153af41e28425 Mon Sep 17 00:00:00 2001 From: Clivern Date: Wed, 18 Sep 2019 20:12:07 +0200 Subject: [PATCH 06/15] drop validation for text boxes --- .../api/private/v1/admin/builder.py | 2 -- .../api/private/v1/admin/profile.py | 3 --- .../api/private/v1/admin/settings.py | 4 ---- .../api/private/v1/admin/subscriber.py | 18 ++++++++++++++---- app/controllers/api/private/v1/status.py | 9 +++++++-- 5 files changed, 21 insertions(+), 15 deletions(-) diff --git a/app/controllers/api/private/v1/admin/builder.py b/app/controllers/api/private/v1/admin/builder.py index 84d45e1d..92b2fe21 100644 --- a/app/controllers/api/private/v1/admin/builder.py +++ b/app/controllers/api/private/v1/admin/builder.py @@ -276,7 +276,6 @@ def post(self, request): }) self.__form.add_inputs({ - # @TODO add validate filter 'builder_headline': { 'value': request_data["builder_headline"], 'sanitize': { @@ -312,7 +311,6 @@ def post(self, request): } } }, - # @TODO add validate filter 'builder_about': { 'value': request_data["builder_about"], 'sanitize': { diff --git a/app/controllers/api/private/v1/admin/profile.py b/app/controllers/api/private/v1/admin/profile.py index 4f24c5b9..870aa60e 100644 --- a/app/controllers/api/private/v1/admin/profile.py +++ b/app/controllers/api/private/v1/admin/profile.py @@ -152,7 +152,6 @@ def __update_profile(self, request): } } }, - # @TODO add validate filter 'job_title': { 'value': request_data["job_title"], 'sanitize': { @@ -166,7 +165,6 @@ def __update_profile(self, request): 'optional': {} } }, - # @TODO add validate filter 'company': { 'value': request_data["company"], 'sanitize': { @@ -180,7 +178,6 @@ def __update_profile(self, request): 'optional': {} } }, - # @TODO add validate filter 'address': { 'value': request_data["address"], 'sanitize': { diff --git a/app/controllers/api/private/v1/admin/settings.py b/app/controllers/api/private/v1/admin/settings.py index e1090433..963e67a4 100644 --- a/app/controllers/api/private/v1/admin/settings.py +++ b/app/controllers/api/private/v1/admin/settings.py @@ -102,7 +102,6 @@ def post(self, request): } } }, - # @TODO add validate filter 'app_description': { 'value': request_data["app_description"], 'sanitize': { @@ -116,7 +115,6 @@ def post(self, request): 'optional': {} } }, - # @TODO add validate filter "prometheus_token": { 'value': request_data["prometheus_token"], 'sanitize': { @@ -130,7 +128,6 @@ def post(self, request): 'optional': {} } }, - # @TODO add validate filter "newrelic_api_key": { 'value': request_data["newrelic_api_key"], 'sanitize': { @@ -144,7 +141,6 @@ def post(self, request): 'optional': {} } }, - # @TODO add validate filter 'google_analytics_account': { 'value': request_data["google_analytics_account"], 'sanitize': { diff --git a/app/controllers/api/private/v1/admin/subscriber.py b/app/controllers/api/private/v1/admin/subscriber.py index 300478a7..24b9bd8c 100644 --- a/app/controllers/api/private/v1/admin/subscriber.py +++ b/app/controllers/api/private/v1/admin/subscriber.py @@ -174,13 +174,18 @@ def post(self, request): } } }, - # @TODO add validate filter 'auth_token': { 'value': request_data["auth_token"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'length_between': { + 'param': [0, 80], + 'error': _('Error! Token is very long.') + }, + 'optional': {} + } }, 'status': { 'value': request_data["status"], @@ -452,13 +457,18 @@ def post(self, request, subscriber_id): } } }, - # @TODO add validate filter 'auth_token': { 'value': request_data["auth_token"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'length_between': { + 'param': [0, 80], + 'error': _('Error! Token is very long.') + }, + 'optional': {} + } }, 'status': { 'value': request_data["status"], diff --git a/app/controllers/api/private/v1/status.py b/app/controllers/api/private/v1/status.py index 0693914c..05f1c3fe 100644 --- a/app/controllers/api/private/v1/status.py +++ b/app/controllers/api/private/v1/status.py @@ -110,13 +110,18 @@ def post(self, request): } } }, - # @TODO add validate filter 'auth_token': { 'value': request_data["auth_token"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'length_between': { + 'param': [0, 80], + 'error': _('Error! Token is very long.') + }, + 'optional': {} + } } }) From 10b26973dd49b6e8ffcb5393e172e9ad000c307a Mon Sep 17 00:00:00 2001 From: Clivern Date: Wed, 18 Sep 2019 20:39:07 +0200 Subject: [PATCH 07/15] add sv_datetime validation rule --- app/controllers/api/private/v1/admin/incident.py | 14 ++++++++++---- .../api/private/v1/admin/incident_update.py | 14 ++++++++++---- app/modules/validation/extension.py | 8 ++++++++ 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/app/controllers/api/private/v1/admin/incident.py b/app/controllers/api/private/v1/admin/incident.py index 793289fc..abf620d3 100644 --- a/app/controllers/api/private/v1/admin/incident.py +++ b/app/controllers/api/private/v1/admin/incident.py @@ -69,13 +69,16 @@ def post(self, request): } } }, - # @TODO add validate filter 'datetime': { 'value': request_data["datetime"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'sv_datetime': { + 'error': _('Error! Datetime is invalid.') + } + } }, 'status': { 'value': request_data["status"], @@ -203,13 +206,16 @@ def post(self, request, incident_id): } } }, - # @TODO add validate filter 'datetime': { 'value': request_data["datetime"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'sv_datetime': { + 'error': _('Error! Datetime is invalid.') + } + } }, 'status': { 'value': request_data["status"], diff --git a/app/controllers/api/private/v1/admin/incident_update.py b/app/controllers/api/private/v1/admin/incident_update.py index 31cce524..87d6be80 100644 --- a/app/controllers/api/private/v1/admin/incident_update.py +++ b/app/controllers/api/private/v1/admin/incident_update.py @@ -82,13 +82,16 @@ def post(self, request, incident_id): }, 'validate': {} }, - # @TODO add validate filter 'datetime': { 'value': request_data["datetime"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'sv_datetime': { + 'error': _('Error! Datetime is invalid.') + } + } }, 'status': { 'value': request_data["status"], @@ -239,13 +242,16 @@ def post(self, request, incident_id, update_id): }, 'validate': {} }, - # @TODO add validate filter 'datetime': { 'value': request_data["datetime"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'sv_datetime': { + 'error': _('Error! Datetime is invalid.') + } + } }, 'status': { 'value': request_data["status"], diff --git a/app/modules/validation/extension.py b/app/modules/validation/extension.py index b46eb547..52e48fdc 100644 --- a/app/modules/validation/extension.py +++ b/app/modules/validation/extension.py @@ -9,6 +9,7 @@ # Standard Library import re import os +import datetime # Third Party Library from twilio.rest import Client @@ -108,6 +109,13 @@ def sv_numeric(self): def sv_slug(self): return True if validate_slug(self._input) is None else False + def sv_datetime(self, date_format='%Y-%m-%d %H:%M:%S'): + try: + datetime.datetime.strptime(self._input, date_format) + return True + except ValueError: + return False + def sv_phone(self): if os.getenv("TEXT_MESSAGING_DRIVER", "twilio") == "twilio" and os.getenv("TWILIO_ACCOUNT_SID") and os.getenv("TWILIO_AUTH_TOKEN"): client = Client(os.getenv("TWILIO_ACCOUNT_SID"), os.getenv("TWILIO_AUTH_TOKEN")) From d3f3abc5ebc7df54431f51b829da17c978c6d809 Mon Sep 17 00:00:00 2001 From: Clivern Date: Thu, 19 Sep 2019 14:50:08 +0200 Subject: [PATCH 08/15] BSD to apache v2 --- LICENSE | 203 +++++++++++++++++- README.md | 2 +- app/celery.py | 20 +- app/context_processors.py | 20 +- .../api/private/v1/admin/activity.py | 20 +- .../api/private/v1/admin/builder.py | 20 +- .../api/private/v1/admin/component.py | 20 +- .../api/private/v1/admin/component_group.py | 20 +- .../api/private/v1/admin/incident.py | 20 +- .../api/private/v1/admin/incident_update.py | 20 +- .../api/private/v1/admin/metric.py | 20 +- .../api/private/v1/admin/notifications.py | 20 +- .../api/private/v1/admin/profile.py | 20 +- .../api/private/v1/admin/settings.py | 20 +- .../api/private/v1/admin/subscriber.py | 20 +- app/controllers/api/private/v1/admin/user.py | 20 +- app/controllers/api/private/v1/forbidden.py | 20 +- .../api/private/v1/forgot_password.py | 20 +- app/controllers/api/private/v1/install.py | 20 +- app/controllers/api/private/v1/login.py | 20 +- app/controllers/api/private/v1/register.py | 20 +- .../api/private/v1/reset_password.py | 20 +- app/controllers/api/private/v1/status.py | 20 +- app/controllers/api/public/v1/auth.py | 20 +- app/controllers/web/admin/activity.py | 20 +- app/controllers/web/admin/builder.py | 20 +- app/controllers/web/admin/component.py | 20 +- app/controllers/web/admin/component_group.py | 20 +- app/controllers/web/admin/dashboard.py | 20 +- app/controllers/web/admin/incident.py | 20 +- app/controllers/web/admin/incident_update.py | 20 +- app/controllers/web/admin/logout.py | 20 +- app/controllers/web/admin/metric.py | 20 +- app/controllers/web/admin/notification.py | 20 +- app/controllers/web/admin/profile.py | 20 +- app/controllers/web/admin/settings.py | 20 +- app/controllers/web/admin/subscriber.py | 20 +- app/controllers/web/admin/user.py | 20 +- app/controllers/web/error.py | 20 +- app/controllers/web/forgot_password.py | 20 +- app/controllers/web/health_check.py | 20 +- app/controllers/web/history.py | 20 +- app/controllers/web/install.py | 20 +- app/controllers/web/login.py | 20 +- app/controllers/web/not_found.py | 20 +- app/controllers/web/register.py | 20 +- app/controllers/web/reset_password.py | 20 +- app/controllers/web/statistics.py | 20 +- app/controllers/web/status_page.py | 20 +- app/exceptions/missing_argument.py | 20 +- app/exceptions/sanitization_rule_not_found.py | 20 +- app/exceptions/validation_rule_not_found.py | 20 +- app/management/commands/health.py | 22 +- app/management/commands/silverback.py | 22 +- app/middleware/api_funnel.py | 20 +- app/middleware/correlation.py | 20 +- app/middleware/errors.py | 20 +- app/middleware/logging.py | 20 +- app/middleware/web_funnel.py | 20 +- app/models/activity.py | 20 +- app/models/component.py | 20 +- app/models/component_group.py | 20 +- app/models/custom_lookup.py | 20 +- app/models/incident.py | 20 +- app/models/incident_update.py | 20 +- app/models/incident_update_component.py | 20 +- app/models/incident_update_notification.py | 20 +- app/models/metric.py | 20 +- app/models/notification.py | 20 +- app/models/option.py | 20 +- app/models/profile.py | 20 +- app/models/register_request.py | 20 +- app/models/reset_request.py | 20 +- app/models/subscriber.py | 20 +- app/models/task.py | 20 +- app/models/user_meta.py | 20 +- app/modules/core/acl.py | 20 +- app/modules/core/activity.py | 20 +- app/modules/core/component.py | 20 +- app/modules/core/component_group.py | 20 +- app/modules/core/context.py | 20 +- app/modules/core/dashboard.py | 20 +- app/modules/core/decorators.py | 20 +- app/modules/core/forgot_password.py | 20 +- app/modules/core/funnel.py | 20 +- app/modules/core/health.py | 20 +- app/modules/core/incident.py | 20 +- app/modules/core/incident_update.py | 20 +- app/modules/core/incident_update_component.py | 20 +- .../core/incident_update_notification.py | 20 +- app/modules/core/install.py | 20 +- app/modules/core/login.py | 20 +- app/modules/core/metric.py | 20 +- app/modules/core/notification.py | 20 +- app/modules/core/profile.py | 20 +- app/modules/core/request.py | 20 +- app/modules/core/reset_password.py | 20 +- app/modules/core/response.py | 20 +- app/modules/core/settings.py | 20 +- app/modules/core/statistics.py | 20 +- app/modules/core/status_page.py | 20 +- app/modules/core/subscriber.py | 20 +- app/modules/core/task.py | 20 +- app/modules/core/upgrade.py | 20 +- app/modules/core/user.py | 20 +- app/modules/entity/activity_entity.py | 20 +- app/modules/entity/component_entity.py | 20 +- app/modules/entity/component_group_entity.py | 20 +- app/modules/entity/incident_entity.py | 20 +- .../incident_update_component_entity.py | 20 +- app/modules/entity/incident_update_entity.py | 20 +- .../incident_update_notification_entity.py | 20 +- app/modules/entity/metric_entity.py | 20 +- app/modules/entity/notification_entity.py | 20 +- app/modules/entity/option_entity.py | 20 +- app/modules/entity/profile_entity.py | 20 +- app/modules/entity/register_request_entity.py | 20 +- app/modules/entity/reset_request_entity.py | 20 +- app/modules/entity/subscriber_entity.py | 20 +- app/modules/entity/task_entity.py | 20 +- app/modules/entity/user_entity.py | 20 +- app/modules/service/prometheus.py | 20 +- app/modules/util/crypto.py | 20 +- app/modules/util/gravatar.py | 20 +- app/modules/util/helpers.py | 20 +- app/modules/util/humanize.py | 20 +- app/modules/util/io.py | 20 +- app/modules/util/token.py | 20 +- app/modules/validation/extension.py | 20 +- app/settings/info.py | 20 +- app/tasks/__init__.py | 20 +- app/tasks/forgot_password.py | 20 +- app/tasks/incident_update.py | 20 +- app/tasks/notify_subscriber.py | 20 +- app/tasks/ping.py | 20 +- app/tasks/register_request.py | 20 +- app/tasks/verify_subscription.py | 20 +- app/templatetags/extras.py | 30 ++- .../unit/modules/entity/test_option_entity.py | 20 +- app/urls.py | 20 +- 140 files changed, 1997 insertions(+), 982 deletions(-) diff --git a/LICENSE b/LICENSE index 732595ed..db0ebf3f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,12 +1,201 @@ -Copyright (c) 2018-2019 Silverbackhq. -All rights reserved. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + 1. Definitions. - 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. - 3. Neither the name of the Cachet nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2019 Silverbackhq + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index 92b6b214..71db8a35 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,6 @@ Shoutout to these awesome open source projects and their maintainers. ## License -© 2019, Silverback. Released under [BSD-3-Clause License](https://opensource.org/licenses/BSD-3-Clause). +© 2019, Silverback. Released under [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0). **Silverback** is authored and maintained by [@silverbackhq](https://github.com/silverbackhq). diff --git a/app/celery.py b/app/celery.py index b09426e9..c36504ed 100644 --- a/app/celery.py +++ b/app/celery.py @@ -1,10 +1,16 @@ -""" - Celery Configs - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/context_processors.py b/app/context_processors.py index ff45b3df..cb2700b5 100644 --- a/app/context_processors.py +++ b/app/context_processors.py @@ -1,10 +1,16 @@ -""" - Global Template Variables - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/controllers/api/private/v1/admin/activity.py b/app/controllers/api/private/v1/admin/activity.py index c637074d..2479b109 100644 --- a/app/controllers/api/private/v1/admin/activity.py +++ b/app/controllers/api/private/v1/admin/activity.py @@ -1,10 +1,16 @@ -""" - Activities API Endpoint - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.views import View diff --git a/app/controllers/api/private/v1/admin/builder.py b/app/controllers/api/private/v1/admin/builder.py index 92b2fe21..c18618be 100644 --- a/app/controllers/api/private/v1/admin/builder.py +++ b/app/controllers/api/private/v1/admin/builder.py @@ -1,10 +1,16 @@ -""" - Builder API Endpoint - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import json diff --git a/app/controllers/api/private/v1/admin/component.py b/app/controllers/api/private/v1/admin/component.py index 353daeba..2f0673fe 100644 --- a/app/controllers/api/private/v1/admin/component.py +++ b/app/controllers/api/private/v1/admin/component.py @@ -1,10 +1,16 @@ -""" - Component API Endpoint - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.views import View diff --git a/app/controllers/api/private/v1/admin/component_group.py b/app/controllers/api/private/v1/admin/component_group.py index d9c1baf0..cef15b34 100644 --- a/app/controllers/api/private/v1/admin/component_group.py +++ b/app/controllers/api/private/v1/admin/component_group.py @@ -1,10 +1,16 @@ -""" - Component Groups API Endpoint - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.views import View diff --git a/app/controllers/api/private/v1/admin/incident.py b/app/controllers/api/private/v1/admin/incident.py index abf620d3..f96c6d40 100644 --- a/app/controllers/api/private/v1/admin/incident.py +++ b/app/controllers/api/private/v1/admin/incident.py @@ -1,10 +1,16 @@ -""" - Incident API Endpoint - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.views import View diff --git a/app/controllers/api/private/v1/admin/incident_update.py b/app/controllers/api/private/v1/admin/incident_update.py index 87d6be80..88c19bee 100644 --- a/app/controllers/api/private/v1/admin/incident_update.py +++ b/app/controllers/api/private/v1/admin/incident_update.py @@ -1,10 +1,16 @@ -""" - Incident Updates API Endpoint - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.views import View diff --git a/app/controllers/api/private/v1/admin/metric.py b/app/controllers/api/private/v1/admin/metric.py index 9a38f74c..e6941307 100644 --- a/app/controllers/api/private/v1/admin/metric.py +++ b/app/controllers/api/private/v1/admin/metric.py @@ -1,10 +1,16 @@ -""" - Metrics API Endpoint - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.views import View diff --git a/app/controllers/api/private/v1/admin/notifications.py b/app/controllers/api/private/v1/admin/notifications.py index cf6988d8..50c21da9 100644 --- a/app/controllers/api/private/v1/admin/notifications.py +++ b/app/controllers/api/private/v1/admin/notifications.py @@ -1,10 +1,16 @@ -""" - Notifications API Endpoint - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.views import View diff --git a/app/controllers/api/private/v1/admin/profile.py b/app/controllers/api/private/v1/admin/profile.py index 870aa60e..475a1e7a 100644 --- a/app/controllers/api/private/v1/admin/profile.py +++ b/app/controllers/api/private/v1/admin/profile.py @@ -1,10 +1,16 @@ -""" - Profile API Endpoint - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.views import View diff --git a/app/controllers/api/private/v1/admin/settings.py b/app/controllers/api/private/v1/admin/settings.py index 963e67a4..7ea4aa3c 100644 --- a/app/controllers/api/private/v1/admin/settings.py +++ b/app/controllers/api/private/v1/admin/settings.py @@ -1,10 +1,16 @@ -""" - Settings API Endpoint - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.views import View diff --git a/app/controllers/api/private/v1/admin/subscriber.py b/app/controllers/api/private/v1/admin/subscriber.py index 24b9bd8c..e05e1d68 100644 --- a/app/controllers/api/private/v1/admin/subscriber.py +++ b/app/controllers/api/private/v1/admin/subscriber.py @@ -1,10 +1,16 @@ -""" - Subscriber API Endpoint - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.views import View diff --git a/app/controllers/api/private/v1/admin/user.py b/app/controllers/api/private/v1/admin/user.py index 0c2f6dc2..8f6886f4 100644 --- a/app/controllers/api/private/v1/admin/user.py +++ b/app/controllers/api/private/v1/admin/user.py @@ -1,10 +1,16 @@ -""" - User API Endpoint - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.views import View diff --git a/app/controllers/api/private/v1/forbidden.py b/app/controllers/api/private/v1/forbidden.py index 7bc32248..7dfee4cc 100644 --- a/app/controllers/api/private/v1/forbidden.py +++ b/app/controllers/api/private/v1/forbidden.py @@ -1,10 +1,16 @@ -""" - Forbidden Access Views - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.http import JsonResponse diff --git a/app/controllers/api/private/v1/forgot_password.py b/app/controllers/api/private/v1/forgot_password.py index de2bfc32..832cc917 100644 --- a/app/controllers/api/private/v1/forgot_password.py +++ b/app/controllers/api/private/v1/forgot_password.py @@ -1,10 +1,16 @@ -""" - Forgot Password API Endpoint - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.views import View diff --git a/app/controllers/api/private/v1/install.py b/app/controllers/api/private/v1/install.py index 657751e3..36e89bae 100644 --- a/app/controllers/api/private/v1/install.py +++ b/app/controllers/api/private/v1/install.py @@ -1,10 +1,16 @@ -""" - Install API Endpoint - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.views import View diff --git a/app/controllers/api/private/v1/login.py b/app/controllers/api/private/v1/login.py index 737c3a27..78970c9c 100644 --- a/app/controllers/api/private/v1/login.py +++ b/app/controllers/api/private/v1/login.py @@ -1,10 +1,16 @@ -""" - Login API Endpoint - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.views import View diff --git a/app/controllers/api/private/v1/register.py b/app/controllers/api/private/v1/register.py index f172864b..bea0adc0 100644 --- a/app/controllers/api/private/v1/register.py +++ b/app/controllers/api/private/v1/register.py @@ -1,10 +1,16 @@ -""" - Register API Endpoint - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import json diff --git a/app/controllers/api/private/v1/reset_password.py b/app/controllers/api/private/v1/reset_password.py index 6a8aa23a..5b0d76d9 100644 --- a/app/controllers/api/private/v1/reset_password.py +++ b/app/controllers/api/private/v1/reset_password.py @@ -1,10 +1,16 @@ -""" - Reset Password API Endpoint - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.views import View diff --git a/app/controllers/api/private/v1/status.py b/app/controllers/api/private/v1/status.py index 05f1c3fe..1ddb9638 100644 --- a/app/controllers/api/private/v1/status.py +++ b/app/controllers/api/private/v1/status.py @@ -1,10 +1,16 @@ -""" - Status Page API Endpoint - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.views import View diff --git a/app/controllers/api/public/v1/auth.py b/app/controllers/api/public/v1/auth.py index f54a4df3..31a2763c 100644 --- a/app/controllers/api/public/v1/auth.py +++ b/app/controllers/api/public/v1/auth.py @@ -1,10 +1,16 @@ -""" - Auth API Endpoint - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.views import View diff --git a/app/controllers/web/admin/activity.py b/app/controllers/web/admin/activity.py index addc7831..3c438da2 100644 --- a/app/controllers/web/admin/activity.py +++ b/app/controllers/web/admin/activity.py @@ -1,10 +1,16 @@ -""" - Activity Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/controllers/web/admin/builder.py b/app/controllers/web/admin/builder.py index 55ade5d4..c5e209c0 100644 --- a/app/controllers/web/admin/builder.py +++ b/app/controllers/web/admin/builder.py @@ -1,10 +1,16 @@ -""" - Builder Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/controllers/web/admin/component.py b/app/controllers/web/admin/component.py index c5c3c9e1..cddee6f7 100644 --- a/app/controllers/web/admin/component.py +++ b/app/controllers/web/admin/component.py @@ -1,10 +1,16 @@ -""" - Component Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/controllers/web/admin/component_group.py b/app/controllers/web/admin/component_group.py index 2b67fa17..92d4debe 100644 --- a/app/controllers/web/admin/component_group.py +++ b/app/controllers/web/admin/component_group.py @@ -1,10 +1,16 @@ -""" - Component Group Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/controllers/web/admin/dashboard.py b/app/controllers/web/admin/dashboard.py index 2f2306e4..7bb49833 100644 --- a/app/controllers/web/admin/dashboard.py +++ b/app/controllers/web/admin/dashboard.py @@ -1,10 +1,16 @@ -""" - Dashboard Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/controllers/web/admin/incident.py b/app/controllers/web/admin/incident.py index 08279250..8d91e5e6 100644 --- a/app/controllers/web/admin/incident.py +++ b/app/controllers/web/admin/incident.py @@ -1,10 +1,16 @@ -""" - Incident Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/controllers/web/admin/incident_update.py b/app/controllers/web/admin/incident_update.py index 394d79aa..465b7cd3 100644 --- a/app/controllers/web/admin/incident_update.py +++ b/app/controllers/web/admin/incident_update.py @@ -1,10 +1,16 @@ -""" - Incident Update Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/controllers/web/admin/logout.py b/app/controllers/web/admin/logout.py index bc695155..43092e5a 100644 --- a/app/controllers/web/admin/logout.py +++ b/app/controllers/web/admin/logout.py @@ -1,10 +1,16 @@ -""" - Logout Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.views import View diff --git a/app/controllers/web/admin/metric.py b/app/controllers/web/admin/metric.py index 46db8ae3..b46135d0 100644 --- a/app/controllers/web/admin/metric.py +++ b/app/controllers/web/admin/metric.py @@ -1,10 +1,16 @@ -""" - Metric Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/controllers/web/admin/notification.py b/app/controllers/web/admin/notification.py index e5e11202..99126825 100644 --- a/app/controllers/web/admin/notification.py +++ b/app/controllers/web/admin/notification.py @@ -1,10 +1,16 @@ -""" - Notification Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/controllers/web/admin/profile.py b/app/controllers/web/admin/profile.py index bf36a526..35c3c0fd 100644 --- a/app/controllers/web/admin/profile.py +++ b/app/controllers/web/admin/profile.py @@ -1,10 +1,16 @@ -""" - Profile Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/controllers/web/admin/settings.py b/app/controllers/web/admin/settings.py index fb8fc506..cff86620 100644 --- a/app/controllers/web/admin/settings.py +++ b/app/controllers/web/admin/settings.py @@ -1,10 +1,16 @@ -""" - Settings Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/controllers/web/admin/subscriber.py b/app/controllers/web/admin/subscriber.py index 36b2c7be..b993353b 100644 --- a/app/controllers/web/admin/subscriber.py +++ b/app/controllers/web/admin/subscriber.py @@ -1,10 +1,16 @@ -""" - Subscriber Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/controllers/web/admin/user.py b/app/controllers/web/admin/user.py index 3f7aa827..7b093278 100644 --- a/app/controllers/web/admin/user.py +++ b/app/controllers/web/admin/user.py @@ -1,10 +1,16 @@ -""" - User Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/controllers/web/error.py b/app/controllers/web/error.py index 528b24c1..07ffd241 100644 --- a/app/controllers/web/error.py +++ b/app/controllers/web/error.py @@ -1,10 +1,16 @@ -""" - Error Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/controllers/web/forgot_password.py b/app/controllers/web/forgot_password.py index 0c157d50..8967bd60 100644 --- a/app/controllers/web/forgot_password.py +++ b/app/controllers/web/forgot_password.py @@ -1,10 +1,16 @@ -""" - Forgot Password Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/controllers/web/health_check.py b/app/controllers/web/health_check.py index f2faaf79..a3beff99 100644 --- a/app/controllers/web/health_check.py +++ b/app/controllers/web/health_check.py @@ -1,10 +1,16 @@ -""" - Health Check Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.views import View diff --git a/app/controllers/web/history.py b/app/controllers/web/history.py index 78203ad8..af233d93 100644 --- a/app/controllers/web/history.py +++ b/app/controllers/web/history.py @@ -1,10 +1,16 @@ -""" - History Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/controllers/web/install.py b/app/controllers/web/install.py index ef325a8b..91089571 100644 --- a/app/controllers/web/install.py +++ b/app/controllers/web/install.py @@ -1,10 +1,16 @@ -""" - Install Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/controllers/web/login.py b/app/controllers/web/login.py index 1b72601b..c061e8dd 100644 --- a/app/controllers/web/login.py +++ b/app/controllers/web/login.py @@ -1,10 +1,16 @@ -""" - Login Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/controllers/web/not_found.py b/app/controllers/web/not_found.py index a8d9271e..4071bf64 100644 --- a/app/controllers/web/not_found.py +++ b/app/controllers/web/not_found.py @@ -1,10 +1,16 @@ -""" - Not Found Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/controllers/web/register.py b/app/controllers/web/register.py index 887b5f1a..1269efa8 100644 --- a/app/controllers/web/register.py +++ b/app/controllers/web/register.py @@ -1,10 +1,16 @@ -""" - Register Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/controllers/web/reset_password.py b/app/controllers/web/reset_password.py index 4d09cb03..5ca53df3 100644 --- a/app/controllers/web/reset_password.py +++ b/app/controllers/web/reset_password.py @@ -1,10 +1,16 @@ -""" - Reset Password Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/controllers/web/statistics.py b/app/controllers/web/statistics.py index a6af30ce..28d6844c 100644 --- a/app/controllers/web/statistics.py +++ b/app/controllers/web/statistics.py @@ -1,10 +1,16 @@ -""" - Statistics Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.views import View diff --git a/app/controllers/web/status_page.py b/app/controllers/web/status_page.py index c5295c18..4e3a3399 100644 --- a/app/controllers/web/status_page.py +++ b/app/controllers/web/status_page.py @@ -1,10 +1,16 @@ -""" - Status Page Web Controller - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/exceptions/missing_argument.py b/app/exceptions/missing_argument.py index b45b404d..a2113294 100644 --- a/app/exceptions/missing_argument.py +++ b/app/exceptions/missing_argument.py @@ -1,10 +1,16 @@ -""" - Missing Argument Exception - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. class MissingArgument(Exception): diff --git a/app/exceptions/sanitization_rule_not_found.py b/app/exceptions/sanitization_rule_not_found.py index 8be54229..ea646e46 100644 --- a/app/exceptions/sanitization_rule_not_found.py +++ b/app/exceptions/sanitization_rule_not_found.py @@ -1,10 +1,16 @@ -""" - Sanitization Rule Not Found - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. class SanitizationRuleNotFound(Exception): diff --git a/app/exceptions/validation_rule_not_found.py b/app/exceptions/validation_rule_not_found.py index 3e3934cd..8b4a50ea 100644 --- a/app/exceptions/validation_rule_not_found.py +++ b/app/exceptions/validation_rule_not_found.py @@ -1,10 +1,16 @@ -""" - Validation Rule Not Found - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. class ValidationRuleNotFound(Exception): diff --git a/app/management/commands/health.py b/app/management/commands/health.py index 4acb100f..f6ce124b 100644 --- a/app/management/commands/health.py +++ b/app/management/commands/health.py @@ -1,12 +1,16 @@ -""" - Health Check Command - ~~~~~~~~~~~~~~ - - see https://docs.djangoproject.com/en/2.0/howto/custom-management-commands/ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.core.management.base import BaseCommand, CommandError diff --git a/app/management/commands/silverback.py b/app/management/commands/silverback.py index 8b1285d9..b6a01970 100644 --- a/app/management/commands/silverback.py +++ b/app/management/commands/silverback.py @@ -1,12 +1,16 @@ -""" - Silverback Info Command - ~~~~~~~~~~~~~~ - - see https://docs.djangoproject.com/en/2.0/howto/custom-management-commands/ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/middleware/api_funnel.py b/app/middleware/api_funnel.py index 7c437c9d..337c1c74 100644 --- a/app/middleware/api_funnel.py +++ b/app/middleware/api_funnel.py @@ -1,10 +1,16 @@ -""" - API Funnel Middleware - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Local Library from app.modules.core.funnel import Funnel diff --git a/app/middleware/correlation.py b/app/middleware/correlation.py index a6fcda61..c92222b4 100644 --- a/app/middleware/correlation.py +++ b/app/middleware/correlation.py @@ -1,10 +1,16 @@ -""" - Correlation Middleware - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Local Library from app.modules.util.helpers import Helpers diff --git a/app/middleware/errors.py b/app/middleware/errors.py index 9fb34e28..a4d845d8 100644 --- a/app/middleware/errors.py +++ b/app/middleware/errors.py @@ -1,10 +1,16 @@ -""" - Errors Middleware - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.http import JsonResponse diff --git a/app/middleware/logging.py b/app/middleware/logging.py index c4865d3d..fc5b73b7 100644 --- a/app/middleware/logging.py +++ b/app/middleware/logging.py @@ -1,10 +1,16 @@ -""" - Logging Middleware - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.utils.translation import gettext as _ diff --git a/app/middleware/web_funnel.py b/app/middleware/web_funnel.py index 98ab217c..a2ef930a 100644 --- a/app/middleware/web_funnel.py +++ b/app/middleware/web_funnel.py @@ -1,10 +1,16 @@ -""" - Web Funnel Middleware - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Local Library from app.modules.core.funnel import Funnel diff --git a/app/models/activity.py b/app/models/activity.py index 055d4d7e..8d4a980c 100644 --- a/app/models/activity.py +++ b/app/models/activity.py @@ -1,10 +1,16 @@ -""" - Activity Model - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.db import models diff --git a/app/models/component.py b/app/models/component.py index 3bede05b..7b014048 100644 --- a/app/models/component.py +++ b/app/models/component.py @@ -1,10 +1,16 @@ -""" - Component Model - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.db import models diff --git a/app/models/component_group.py b/app/models/component_group.py index e37bfeba..ce7c284a 100644 --- a/app/models/component_group.py +++ b/app/models/component_group.py @@ -1,10 +1,16 @@ -""" - Component Model - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.db import models diff --git a/app/models/custom_lookup.py b/app/models/custom_lookup.py index 47bdeee4..7c230623 100644 --- a/app/models/custom_lookup.py +++ b/app/models/custom_lookup.py @@ -1,10 +1,16 @@ -""" - Custom Lookup - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.db.models import Lookup diff --git a/app/models/incident.py b/app/models/incident.py index 11cfcaaa..64d729ff 100644 --- a/app/models/incident.py +++ b/app/models/incident.py @@ -1,10 +1,16 @@ -""" - Incident Model - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.db import models diff --git a/app/models/incident_update.py b/app/models/incident_update.py index b11c39e8..3907e1eb 100644 --- a/app/models/incident_update.py +++ b/app/models/incident_update.py @@ -1,10 +1,16 @@ -""" - Incident Update Model - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.db import models diff --git a/app/models/incident_update_component.py b/app/models/incident_update_component.py index 440fbfdc..7ac9f4cf 100644 --- a/app/models/incident_update_component.py +++ b/app/models/incident_update_component.py @@ -1,10 +1,16 @@ -""" - Incident Update Notification Model - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.db import models diff --git a/app/models/incident_update_notification.py b/app/models/incident_update_notification.py index 543f004a..8696bd76 100644 --- a/app/models/incident_update_notification.py +++ b/app/models/incident_update_notification.py @@ -1,10 +1,16 @@ -""" - Incident Update Notification Model - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.db import models diff --git a/app/models/metric.py b/app/models/metric.py index 8abdf749..a47697f2 100644 --- a/app/models/metric.py +++ b/app/models/metric.py @@ -1,10 +1,16 @@ -""" - Metric Model - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.db import models diff --git a/app/models/notification.py b/app/models/notification.py index 5f69ae62..b0127924 100644 --- a/app/models/notification.py +++ b/app/models/notification.py @@ -1,10 +1,16 @@ -""" - Notification Model - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.db import models diff --git a/app/models/option.py b/app/models/option.py index b6730ba8..d47a33c6 100644 --- a/app/models/option.py +++ b/app/models/option.py @@ -1,10 +1,16 @@ -""" - Option Model - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.db import models diff --git a/app/models/profile.py b/app/models/profile.py index 68947af5..53c30157 100644 --- a/app/models/profile.py +++ b/app/models/profile.py @@ -1,10 +1,16 @@ -""" - Profile Model - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.db import models diff --git a/app/models/register_request.py b/app/models/register_request.py index bcb4fe29..40e1cdee 100644 --- a/app/models/register_request.py +++ b/app/models/register_request.py @@ -1,10 +1,16 @@ -""" - Register Request Model - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.db import models diff --git a/app/models/reset_request.py b/app/models/reset_request.py index 8db8017d..5cbd1b20 100644 --- a/app/models/reset_request.py +++ b/app/models/reset_request.py @@ -1,10 +1,16 @@ -""" - Reset Request Model - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.db import models diff --git a/app/models/subscriber.py b/app/models/subscriber.py index e4856bed..02c936a6 100644 --- a/app/models/subscriber.py +++ b/app/models/subscriber.py @@ -1,10 +1,16 @@ -""" - Subscriber Model - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.db import models diff --git a/app/models/task.py b/app/models/task.py index 7e3786a7..601c28b4 100644 --- a/app/models/task.py +++ b/app/models/task.py @@ -1,10 +1,16 @@ -""" - Task Model - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.db import models diff --git a/app/models/user_meta.py b/app/models/user_meta.py index 075df3db..203b99c4 100644 --- a/app/models/user_meta.py +++ b/app/models/user_meta.py @@ -1,10 +1,16 @@ -""" - User Meta Model - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.db import models diff --git a/app/modules/core/acl.py b/app/modules/core/acl.py index 8a307e4b..e2373b21 100644 --- a/app/modules/core/acl.py +++ b/app/modules/core/acl.py @@ -1,10 +1,16 @@ -""" - ACL Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.contrib.auth.models import User diff --git a/app/modules/core/activity.py b/app/modules/core/activity.py index c92cd27f..6e70602b 100644 --- a/app/modules/core/activity.py +++ b/app/modules/core/activity.py @@ -1,10 +1,16 @@ -""" - Activity Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Local Library from app.modules.entity.activity_entity import ActivityEntity diff --git a/app/modules/core/component.py b/app/modules/core/component.py index c2514521..36a78328 100644 --- a/app/modules/core/component.py +++ b/app/modules/core/component.py @@ -1,10 +1,16 @@ -""" - Component Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Local Library from app.modules.entity.component_entity import ComponentEntity diff --git a/app/modules/core/component_group.py b/app/modules/core/component_group.py index 03447fbe..c7ec283c 100644 --- a/app/modules/core/component_group.py +++ b/app/modules/core/component_group.py @@ -1,10 +1,16 @@ -""" - Component Group Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Local Library from app.modules.entity.component_entity import ComponentEntity diff --git a/app/modules/core/context.py b/app/modules/core/context.py index 71fc44ef..f609b1da 100644 --- a/app/modules/core/context.py +++ b/app/modules/core/context.py @@ -1,10 +1,16 @@ -""" - Context Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Local Library from app.settings.info import AUTHOR diff --git a/app/modules/core/dashboard.py b/app/modules/core/dashboard.py index 35af66b8..12102c81 100644 --- a/app/modules/core/dashboard.py +++ b/app/modules/core/dashboard.py @@ -1,10 +1,16 @@ -""" - Dashboard Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import datetime diff --git a/app/modules/core/decorators.py b/app/modules/core/decorators.py index ed25b747..9405be78 100644 --- a/app/modules/core/decorators.py +++ b/app/modules/core/decorators.py @@ -1,10 +1,16 @@ -""" - Custom Decorators - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.shortcuts import redirect, reverse diff --git a/app/modules/core/forgot_password.py b/app/modules/core/forgot_password.py index 6a4dce0e..9d44afc4 100644 --- a/app/modules/core/forgot_password.py +++ b/app/modules/core/forgot_password.py @@ -1,10 +1,16 @@ -""" - Forgot Password Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.utils import timezone diff --git a/app/modules/core/funnel.py b/app/modules/core/funnel.py index 8d6d107b..50e89eb3 100644 --- a/app/modules/core/funnel.py +++ b/app/modules/core/funnel.py @@ -1,10 +1,16 @@ -""" - Funnel Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. class Funnel(): diff --git a/app/modules/core/health.py b/app/modules/core/health.py index d10d7cf7..f4c94053 100644 --- a/app/modules/core/health.py +++ b/app/modules/core/health.py @@ -1,10 +1,16 @@ -""" - Health Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/modules/core/incident.py b/app/modules/core/incident.py index 34c6f1ee..4dc93501 100644 --- a/app/modules/core/incident.py +++ b/app/modules/core/incident.py @@ -1,10 +1,16 @@ -""" - Incident Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Local Library from app.modules.util.helpers import Helpers diff --git a/app/modules/core/incident_update.py b/app/modules/core/incident_update.py index 29009744..b78ac71d 100644 --- a/app/modules/core/incident_update.py +++ b/app/modules/core/incident_update.py @@ -1,10 +1,16 @@ -""" - Incident Update Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Local Library from app.modules.entity.incident_entity import IncidentEntity diff --git a/app/modules/core/incident_update_component.py b/app/modules/core/incident_update_component.py index b4758d9e..d4cf7fca 100644 --- a/app/modules/core/incident_update_component.py +++ b/app/modules/core/incident_update_component.py @@ -1,10 +1,16 @@ -""" - Incident Update Component Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Local Library from app.modules.entity.incident_update_component_entity import IncidentUpdateComponentEntity diff --git a/app/modules/core/incident_update_notification.py b/app/modules/core/incident_update_notification.py index 6a41df8d..f07e16a9 100644 --- a/app/modules/core/incident_update_notification.py +++ b/app/modules/core/incident_update_notification.py @@ -1,10 +1,16 @@ -""" - Incident Update Notification Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Local Library from app.modules.entity.incident_update_notification_entity import IncidentUpdateNotificationEntity diff --git a/app/modules/core/install.py b/app/modules/core/install.py index 760b4240..f2c42dc0 100644 --- a/app/modules/core/install.py +++ b/app/modules/core/install.py @@ -1,10 +1,16 @@ -""" - Install Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.core.management import execute_from_command_line diff --git a/app/modules/core/login.py b/app/modules/core/login.py index c8f328f5..5bd5930b 100644 --- a/app/modules/core/login.py +++ b/app/modules/core/login.py @@ -1,10 +1,16 @@ -""" - Login Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.core.validators import validate_email diff --git a/app/modules/core/metric.py b/app/modules/core/metric.py index 69ab4b61..b4ffc0ca 100644 --- a/app/modules/core/metric.py +++ b/app/modules/core/metric.py @@ -1,10 +1,16 @@ -""" - Metric Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import json diff --git a/app/modules/core/notification.py b/app/modules/core/notification.py index 8edf0bb9..bfcf9249 100644 --- a/app/modules/core/notification.py +++ b/app/modules/core/notification.py @@ -1,10 +1,16 @@ -""" - Task Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Local Library from app.modules.util.humanize import Humanize diff --git a/app/modules/core/profile.py b/app/modules/core/profile.py index 4dc854a2..c76f5738 100644 --- a/app/modules/core/profile.py +++ b/app/modules/core/profile.py @@ -1,10 +1,16 @@ -""" - Profile Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.contrib.auth import update_session_auth_hash diff --git a/app/modules/core/request.py b/app/modules/core/request.py index f779e606..22318868 100644 --- a/app/modules/core/request.py +++ b/app/modules/core/request.py @@ -1,10 +1,16 @@ -""" - Request Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.utils.translation import gettext as _ diff --git a/app/modules/core/reset_password.py b/app/modules/core/reset_password.py index 1ced7a3e..5308aa88 100644 --- a/app/modules/core/reset_password.py +++ b/app/modules/core/reset_password.py @@ -1,10 +1,16 @@ -""" - Reset Password Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.utils import timezone diff --git a/app/modules/core/response.py b/app/modules/core/response.py index 9b51ea73..e71a8b11 100644 --- a/app/modules/core/response.py +++ b/app/modules/core/response.py @@ -1,10 +1,16 @@ -""" - Response Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import copy diff --git a/app/modules/core/settings.py b/app/modules/core/settings.py index 73abf8ec..ae720474 100644 --- a/app/modules/core/settings.py +++ b/app/modules/core/settings.py @@ -1,10 +1,16 @@ -""" - Settings Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Local Library from app.modules.entity.option_entity import OptionEntity diff --git a/app/modules/core/statistics.py b/app/modules/core/statistics.py index 6932a1b5..c2c8237c 100644 --- a/app/modules/core/statistics.py +++ b/app/modules/core/statistics.py @@ -1,10 +1,16 @@ -""" - Statistics Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Local Library from app.modules.entity.task_entity import TaskEntity diff --git a/app/modules/core/status_page.py b/app/modules/core/status_page.py index 272b7db9..853dd405 100644 --- a/app/modules/core/status_page.py +++ b/app/modules/core/status_page.py @@ -1,10 +1,16 @@ -""" - Status Page Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/modules/core/subscriber.py b/app/modules/core/subscriber.py index e8ba38ec..ce84d07c 100644 --- a/app/modules/core/subscriber.py +++ b/app/modules/core/subscriber.py @@ -1,10 +1,16 @@ -""" - Subscriber Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Local Library from app.modules.entity.subscriber_entity import SubscriberEntity diff --git a/app/modules/core/task.py b/app/modules/core/task.py index 13ad908f..8e16481c 100644 --- a/app/modules/core/task.py +++ b/app/modules/core/task.py @@ -1,10 +1,16 @@ -""" - Task Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import json diff --git a/app/modules/core/upgrade.py b/app/modules/core/upgrade.py index 8ddc2d7b..29ea3ac9 100644 --- a/app/modules/core/upgrade.py +++ b/app/modules/core/upgrade.py @@ -1,10 +1,16 @@ -""" - Upgrade Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library import requests diff --git a/app/modules/core/user.py b/app/modules/core/user.py index ad55be8c..4b299aab 100644 --- a/app/modules/core/user.py +++ b/app/modules/core/user.py @@ -1,10 +1,16 @@ -""" - User Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import json diff --git a/app/modules/entity/activity_entity.py b/app/modules/entity/activity_entity.py index e55fb5e5..2914ea3e 100644 --- a/app/modules/entity/activity_entity.py +++ b/app/modules/entity/activity_entity.py @@ -1,10 +1,16 @@ -""" - Activity Entity - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.contrib.auth.models import User diff --git a/app/modules/entity/component_entity.py b/app/modules/entity/component_entity.py index 9f574846..63735c91 100644 --- a/app/modules/entity/component_entity.py +++ b/app/modules/entity/component_entity.py @@ -1,10 +1,16 @@ -""" - Component Entity - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Local Library from app.models import Component diff --git a/app/modules/entity/component_group_entity.py b/app/modules/entity/component_group_entity.py index 10ee99a9..3f45da89 100644 --- a/app/modules/entity/component_group_entity.py +++ b/app/modules/entity/component_group_entity.py @@ -1,10 +1,16 @@ -""" - Component Group Entity - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Local Library from app.models import ComponentGroup diff --git a/app/modules/entity/incident_entity.py b/app/modules/entity/incident_entity.py index b5131807..2e6761b0 100644 --- a/app/modules/entity/incident_entity.py +++ b/app/modules/entity/incident_entity.py @@ -1,10 +1,16 @@ -""" - Incident Entity - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/modules/entity/incident_update_component_entity.py b/app/modules/entity/incident_update_component_entity.py index 7ccca9bc..fb938af7 100644 --- a/app/modules/entity/incident_update_component_entity.py +++ b/app/modules/entity/incident_update_component_entity.py @@ -1,10 +1,16 @@ -""" - Incident Update Component Entity - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import datetime diff --git a/app/modules/entity/incident_update_entity.py b/app/modules/entity/incident_update_entity.py index e37747a9..ec86d3f0 100644 --- a/app/modules/entity/incident_update_entity.py +++ b/app/modules/entity/incident_update_entity.py @@ -1,10 +1,16 @@ -""" - Incident Update Entity - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import datetime diff --git a/app/modules/entity/incident_update_notification_entity.py b/app/modules/entity/incident_update_notification_entity.py index d10707c2..311e8b06 100644 --- a/app/modules/entity/incident_update_notification_entity.py +++ b/app/modules/entity/incident_update_notification_entity.py @@ -1,10 +1,16 @@ -""" - Incident Update Notification Entity - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import datetime diff --git a/app/modules/entity/metric_entity.py b/app/modules/entity/metric_entity.py index 284fe8ea..604b4aad 100644 --- a/app/modules/entity/metric_entity.py +++ b/app/modules/entity/metric_entity.py @@ -1,10 +1,16 @@ -""" - Metric Entity - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Local Library from app.models import Metric diff --git a/app/modules/entity/notification_entity.py b/app/modules/entity/notification_entity.py index 7e77de25..a1b9bbef 100644 --- a/app/modules/entity/notification_entity.py +++ b/app/modules/entity/notification_entity.py @@ -1,10 +1,16 @@ -""" - Notification Entity - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.contrib.auth.models import User diff --git a/app/modules/entity/option_entity.py b/app/modules/entity/option_entity.py index 8cfae7d7..2f1ac2ab 100644 --- a/app/modules/entity/option_entity.py +++ b/app/modules/entity/option_entity.py @@ -1,10 +1,16 @@ -""" - Option Entity - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Local Library from app.models import Option diff --git a/app/modules/entity/profile_entity.py b/app/modules/entity/profile_entity.py index f74b14a6..250b037b 100644 --- a/app/modules/entity/profile_entity.py +++ b/app/modules/entity/profile_entity.py @@ -1,10 +1,16 @@ -""" - Profile Entity - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.utils import timezone diff --git a/app/modules/entity/register_request_entity.py b/app/modules/entity/register_request_entity.py index 1a31b074..f908d934 100644 --- a/app/modules/entity/register_request_entity.py +++ b/app/modules/entity/register_request_entity.py @@ -1,10 +1,16 @@ -""" - Register Request Entity - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library from datetime import datetime diff --git a/app/modules/entity/reset_request_entity.py b/app/modules/entity/reset_request_entity.py index b65b0b03..2d265d30 100644 --- a/app/modules/entity/reset_request_entity.py +++ b/app/modules/entity/reset_request_entity.py @@ -1,10 +1,16 @@ -""" - Reset Request Entity - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library from datetime import datetime diff --git a/app/modules/entity/subscriber_entity.py b/app/modules/entity/subscriber_entity.py index 2d05c1d5..d6ca8386 100644 --- a/app/modules/entity/subscriber_entity.py +++ b/app/modules/entity/subscriber_entity.py @@ -1,10 +1,16 @@ -""" - Subscriber Entity - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import datetime diff --git a/app/modules/entity/task_entity.py b/app/modules/entity/task_entity.py index 479f42e8..1e65cd04 100644 --- a/app/modules/entity/task_entity.py +++ b/app/modules/entity/task_entity.py @@ -1,10 +1,16 @@ -""" - Task Entity - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library from datetime import datetime diff --git a/app/modules/entity/user_entity.py b/app/modules/entity/user_entity.py index ab2b77be..345f62ec 100644 --- a/app/modules/entity/user_entity.py +++ b/app/modules/entity/user_entity.py @@ -1,10 +1,16 @@ -""" - User Entity - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import datetime diff --git a/app/modules/service/prometheus.py b/app/modules/service/prometheus.py index 324fd2d2..3a028a9f 100644 --- a/app/modules/service/prometheus.py +++ b/app/modules/service/prometheus.py @@ -1,10 +1,16 @@ -""" - Prometheus Service - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. class Prometheus(): diff --git a/app/modules/util/crypto.py b/app/modules/util/crypto.py index 768ba2ce..75bb931a 100644 --- a/app/modules/util/crypto.py +++ b/app/modules/util/crypto.py @@ -1,10 +1,16 @@ -""" - Crypto Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/modules/util/gravatar.py b/app/modules/util/gravatar.py index 6e2cf044..cb311a9f 100644 --- a/app/modules/util/gravatar.py +++ b/app/modules/util/gravatar.py @@ -1,10 +1,16 @@ -""" - Gravatar Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library from hashlib import md5 diff --git a/app/modules/util/helpers.py b/app/modules/util/helpers.py index d10ce55e..31282461 100644 --- a/app/modules/util/helpers.py +++ b/app/modules/util/helpers.py @@ -1,10 +1,16 @@ -""" - Helpers Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/modules/util/humanize.py b/app/modules/util/humanize.py index 50104b29..8ac2e791 100644 --- a/app/modules/util/humanize.py +++ b/app/modules/util/humanize.py @@ -1,10 +1,16 @@ -""" - Humanize Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.utils import timezone diff --git a/app/modules/util/io.py b/app/modules/util/io.py index 061b0dba..a25a7014 100644 --- a/app/modules/util/io.py +++ b/app/modules/util/io.py @@ -1,10 +1,16 @@ -""" - Crypto Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/modules/util/token.py b/app/modules/util/token.py index e75ec479..92ab5092 100644 --- a/app/modules/util/token.py +++ b/app/modules/util/token.py @@ -1,10 +1,16 @@ -""" - Token Module - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library from random import randrange diff --git a/app/modules/validation/extension.py b/app/modules/validation/extension.py index 52e48fdc..b6cd016a 100644 --- a/app/modules/validation/extension.py +++ b/app/modules/validation/extension.py @@ -1,10 +1,16 @@ -""" - Validation Extensions - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import re diff --git a/app/settings/info.py b/app/settings/info.py index c627ae3e..d8b9a4ec 100644 --- a/app/settings/info.py +++ b/app/settings/info.py @@ -1,10 +1,16 @@ -""" - Silverback Info - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/tasks/__init__.py b/app/tasks/__init__.py index ac083ddc..9ad4bde1 100644 --- a/app/tasks/__init__.py +++ b/app/tasks/__init__.py @@ -1,10 +1,16 @@ -""" - Load Tasks - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. from .forgot_password import * # noqa: F401 F403 from .register_request import * # noqa: F401 F403 diff --git a/app/tasks/forgot_password.py b/app/tasks/forgot_password.py index 298c9bf4..8d49695a 100644 --- a/app/tasks/forgot_password.py +++ b/app/tasks/forgot_password.py @@ -1,10 +1,16 @@ -""" - Forgot Password Tasks - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from celery import shared_task diff --git a/app/tasks/incident_update.py b/app/tasks/incident_update.py index 2f71e503..71928c62 100644 --- a/app/tasks/incident_update.py +++ b/app/tasks/incident_update.py @@ -1,10 +1,16 @@ -""" - Incident Update Tasks - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from celery import shared_task diff --git a/app/tasks/notify_subscriber.py b/app/tasks/notify_subscriber.py index 801d9ba3..65f9a57c 100644 --- a/app/tasks/notify_subscriber.py +++ b/app/tasks/notify_subscriber.py @@ -1,10 +1,16 @@ -""" - Notify Subscriber Tasks - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import os diff --git a/app/tasks/ping.py b/app/tasks/ping.py index 3e8cc178..b9bb97b3 100644 --- a/app/tasks/ping.py +++ b/app/tasks/ping.py @@ -1,10 +1,16 @@ -""" - Test Tasks - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from celery import shared_task diff --git a/app/tasks/register_request.py b/app/tasks/register_request.py index 0dc695ce..3b4ecef5 100644 --- a/app/tasks/register_request.py +++ b/app/tasks/register_request.py @@ -1,10 +1,16 @@ -""" - Register Request Tasks - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from celery import shared_task diff --git a/app/tasks/verify_subscription.py b/app/tasks/verify_subscription.py index 5f44d809..74d44c7f 100644 --- a/app/tasks/verify_subscription.py +++ b/app/tasks/verify_subscription.py @@ -1,10 +1,16 @@ -""" - Verify Subscription Tasks - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from celery import shared_task diff --git a/app/templatetags/extras.py b/app/templatetags/extras.py index 177b1ded..154852d7 100644 --- a/app/templatetags/extras.py +++ b/app/templatetags/extras.py @@ -1,13 +1,16 @@ -""" - Template Extra Tags - ~~~~~~~~~~~~~~ - - {% load extras %} - {{ somevariable|cut:"0" }} - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django import template @@ -18,5 +21,10 @@ @register.filter(name='cut') def cut(value, arg): - """Removes all values of arg from the given string""" + """Removes all values of arg from the given string + + + {% load extras %} + {{ somevariable|cut:"0" }} + """ return value.replace(arg, '') diff --git a/app/tests/unit/modules/entity/test_option_entity.py b/app/tests/unit/modules/entity/test_option_entity.py index 88417d42..d7b6baf4 100644 --- a/app/tests/unit/modules/entity/test_option_entity.py +++ b/app/tests/unit/modules/entity/test_option_entity.py @@ -1,10 +1,16 @@ -""" - Option Entity Test Cases - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. from django.test import TestCase from app.modules.entity.option_entity import OptionEntity diff --git a/app/urls.py b/app/urls.py index 2c919566..8a23059c 100644 --- a/app/urls.py +++ b/app/urls.py @@ -1,10 +1,16 @@ -""" - Routes For Silverback - ~~~~~~~~~~~~~~ - - :copyright: silverbackhq - :license: BSD-3-Clause -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.urls import include, path From f08c1e637d7fd198112c484b09cfae266560341f Mon Sep 17 00:00:00 2001 From: Clivern Date: Thu, 19 Sep 2019 15:14:38 +0200 Subject: [PATCH 09/15] Fix component & group validation --- .../api/private/v1/admin/component.py | 64 +++++++++++++------ .../api/private/v1/admin/component_group.py | 32 +++++++--- .../api/private/v1/admin/incident.py | 2 - .../api/private/v1/admin/incident_update.py | 16 +++-- 4 files changed, 80 insertions(+), 34 deletions(-) diff --git a/app/controllers/api/private/v1/admin/component.py b/app/controllers/api/private/v1/admin/component.py index 2f0673fe..07e88974 100644 --- a/app/controllers/api/private/v1/admin/component.py +++ b/app/controllers/api/private/v1/admin/component.py @@ -62,7 +62,6 @@ def post(self, request): }) self.__form.add_inputs({ - # @TODO add validate filter 'name': { 'value': request_data["name"], 'sanitize': { @@ -70,18 +69,23 @@ def post(self, request): }, 'validate': { 'length_between': { - 'param': [1, 90], - 'error': _('Error! Component name must be 1 to 90 characters long.') + 'param': [1, 60], + 'error': _('Error! Component name must be 1 to 60 characters long.') } } }, - # @TODO add validate filter 'description': { 'value': request_data["description"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'length_between': { + 'param': [0, 150], + 'error': _('Error! Component name description must be less than 150 characters long.') + }, + 'optional': {} + } }, 'uptime': { 'value': request_data["uptime"], @@ -92,11 +96,18 @@ def post(self, request): } } }, - # @TODO add validate filter 'group': { - 'value': request_data["group"], - 'sanitize': {}, - 'validate': {} + 'value': int(request_data["group"]), + 'sanitize': { + 'strip': {} + }, + 'validate': { + 'greater_than': { + 'error': _('Error! Component group is invalid.'), + 'param': [0] + }, + 'optional': {} + } } }) @@ -105,6 +116,9 @@ def post(self, request): if not self.__form.is_passed(): return JsonResponse(self.__response.send_errors_failure(self.__form.get_errors(), {}, self.__correlation_id)) + # @TODO Validate if name not used before + # @TODO Validate group id is valid + result = self.__component.insert_one({ "name": self.__form.get_sinput("name"), "description": self.__form.get_sinput("description"), @@ -202,7 +216,6 @@ def post(self, request, component_id): }) self.__form.add_inputs({ - # @TODO add validate filter 'name': { 'value': request_data["name"], 'sanitize': { @@ -210,18 +223,23 @@ def post(self, request, component_id): }, 'validate': { 'length_between': { - 'param': [1, 90], - 'error': _('Error! Component name must be 1 to 90 characters long.') + 'param': [1, 60], + 'error': _('Error! Component name must be 1 to 60 characters long.') } } }, - # @TODO add validate filter 'description': { 'value': request_data["description"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'length_between': { + 'param': [0, 150], + 'error': _('Error! Component name description must be less than 150 characters long.') + }, + 'optional': {} + } }, 'uptime': { 'value': request_data["uptime"], @@ -232,11 +250,18 @@ def post(self, request, component_id): } } }, - # @TODO add validate filter 'group': { - 'value': request_data["group"], - 'sanitize': {}, - 'validate': {} + 'value': int(request_data["group"]), + 'sanitize': { + 'strip': {} + }, + 'validate': { + 'greater_than': { + 'error': _('Error! Component group is invalid.'), + 'param': [0] + }, + 'optional': {} + } } }) @@ -245,6 +270,9 @@ def post(self, request, component_id): if not self.__form.is_passed(): return JsonResponse(self.__response.send_errors_failure(self.__form.get_errors(), {}, self.__correlation_id)) + # @TODO Validate if name not used before + # @TODO Validate group id is valid + result = self.__component.update_one_by_id(component_id, { "name": self.__form.get_sinput("name"), "description": self.__form.get_sinput("description"), diff --git a/app/controllers/api/private/v1/admin/component_group.py b/app/controllers/api/private/v1/admin/component_group.py index cef15b34..b58d45e7 100644 --- a/app/controllers/api/private/v1/admin/component_group.py +++ b/app/controllers/api/private/v1/admin/component_group.py @@ -61,7 +61,6 @@ def post(self, request): }) self.__form.add_inputs({ - # @TODO add validate filter 'name': { 'value': request_data["name"], 'sanitize': { @@ -69,18 +68,23 @@ def post(self, request): }, 'validate': { 'length_between': { - 'param': [1, 90], - 'error': _('Error! Component group name must be 1 to 90 characters long.') + 'param': [1, 60], + 'error': _('Error! Component name must be 1 to 60 characters long.') } } }, - # @TODO add validate filter 'description': { 'value': request_data["description"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'length_between': { + 'param': [0, 150], + 'error': _('Error! Component name description must be less than 150 characters long.') + }, + 'optional': {} + } }, 'uptime': { 'value': request_data["uptime"], @@ -98,6 +102,8 @@ def post(self, request): if not self.__form.is_passed(): return JsonResponse(self.__response.send_errors_failure(self.__form.get_errors(), {}, self.__correlation_id)) + # @TODO Validate if name not used before + result = self.__component_group.insert_one({ "name": self.__form.get_sinput("name"), "description": self.__form.get_sinput("description"), @@ -192,7 +198,6 @@ def post(self, request, group_id): }) self.__form.add_inputs({ - # @TODO add validate filter 'name': { 'value': request_data["name"], 'sanitize': { @@ -200,18 +205,23 @@ def post(self, request, group_id): }, 'validate': { 'length_between': { - 'param': [1, 90], - 'error': _('Error! Component group name must be 1 to 90 characters long.') + 'param': [1, 60], + 'error': _('Error! Component name must be 1 to 60 characters long.') } } }, - # @TODO add validate filter 'description': { 'value': request_data["description"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'length_between': { + 'param': [0, 150], + 'error': _('Error! Component name description must be less than 150 characters long.') + }, + 'optional': {} + } }, 'uptime': { 'value': request_data["uptime"], @@ -229,6 +239,8 @@ def post(self, request, group_id): if not self.__form.is_passed(): return JsonResponse(self.__response.send_errors_failure(self.__form.get_errors(), {}, self.__correlation_id)) + # @TODO Validate if name not used before + result = self.__component_group.update_one_by_id(group_id, { "name": self.__form.get_sinput("name"), "description": self.__form.get_sinput("description"), diff --git a/app/controllers/api/private/v1/admin/incident.py b/app/controllers/api/private/v1/admin/incident.py index f96c6d40..f2389015 100644 --- a/app/controllers/api/private/v1/admin/incident.py +++ b/app/controllers/api/private/v1/admin/incident.py @@ -62,7 +62,6 @@ def post(self, request): }) self.__form.add_inputs({ - # @TODO add validate filter 'name': { 'value': request_data["name"], 'sanitize': { @@ -199,7 +198,6 @@ def post(self, request, incident_id): }) self.__form.add_inputs({ - # @TODO add validate filter 'name': { 'value': request_data["name"], 'sanitize': { diff --git a/app/controllers/api/private/v1/admin/incident_update.py b/app/controllers/api/private/v1/admin/incident_update.py index 88c19bee..824da98b 100644 --- a/app/controllers/api/private/v1/admin/incident_update.py +++ b/app/controllers/api/private/v1/admin/incident_update.py @@ -80,13 +80,17 @@ def post(self, request, incident_id): }) self.__form.add_inputs({ - # @TODO add validate filter 'message': { 'value': request_data["message"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'length_between': { + 'param': [1, 3000000], + 'error': _('Error! Update message must be 1 to 3M characters long.') + } + } }, 'datetime': { 'value': request_data["datetime"], @@ -240,13 +244,17 @@ def post(self, request, incident_id, update_id): }) self.__form.add_inputs({ - # @TODO add validate filter 'message': { 'value': request_data["message"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'length_between': { + 'param': [1, 3000000], + 'error': _('Error! Update message must be 1 to 3M characters long.') + } + } }, 'datetime': { 'value': request_data["datetime"], From a1f8190ca9952a3ed6a20b06c9f1751e3b26590c Mon Sep 17 00:00:00 2001 From: Clivern Date: Thu, 19 Sep 2019 17:53:55 +0200 Subject: [PATCH 10/15] Update py classes docstring --- app/__init__.py | 18 +++++++++++++----- .../api/private/v1/admin/activity.py | 1 + .../api/private/v1/admin/builder.py | 3 +++ .../api/private/v1/admin/component.py | 2 ++ .../api/private/v1/admin/component_group.py | 2 ++ .../api/private/v1/admin/incident.py | 2 ++ .../api/private/v1/admin/incident_update.py | 5 +++++ app/controllers/api/private/v1/admin/metric.py | 3 +++ .../api/private/v1/admin/notifications.py | 2 ++ .../api/private/v1/admin/profile.py | 1 + .../api/private/v1/admin/settings.py | 1 + .../api/private/v1/admin/subscriber.py | 2 ++ app/controllers/api/private/v1/admin/user.py | 2 ++ .../api/private/v1/forgot_password.py | 1 + app/controllers/api/private/v1/install.py | 2 +- app/controllers/api/private/v1/login.py | 1 + app/controllers/api/private/v1/register.py | 1 + .../api/private/v1/reset_password.py | 1 + app/controllers/api/private/v1/status.py | 1 + .../api/private/v1/admin/test_profile.py | 16 +++++++++++++--- .../api/private/v1/admin/test_settings.py | 16 +++++++++++++--- .../api/private/v1/admin/test_user.py | 16 +++++++++++++--- .../controllers/api/private/v1/test_install.py | 16 +++++++++++++--- .../controllers/api/private/v1/test_status.py | 16 +++++++++++++--- .../functional/controllers/web/test_home.py | 16 +++++++++++++--- app/tests/testing_base.py | 14 +++++++++++++- 26 files changed, 136 insertions(+), 25 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index 54438723..7dbb0d7b 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -1,9 +1,17 @@ -""" -Stuff to be part of Django -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. -# This will make sure the app is always imported when -# Django starts so that shared_task will use this app. from .celery import app as celery_app diff --git a/app/controllers/api/private/v1/admin/activity.py b/app/controllers/api/private/v1/admin/activity.py index 2479b109..09c29351 100644 --- a/app/controllers/api/private/v1/admin/activity.py +++ b/app/controllers/api/private/v1/admin/activity.py @@ -27,6 +27,7 @@ class Activities(View): + """List Activities Private Endpoint Controller""" __request = None __response = None diff --git a/app/controllers/api/private/v1/admin/builder.py b/app/controllers/api/private/v1/admin/builder.py index c18618be..ed032dcd 100644 --- a/app/controllers/api/private/v1/admin/builder.py +++ b/app/controllers/api/private/v1/admin/builder.py @@ -34,6 +34,7 @@ class BuilderSystemMetrics(View): + """Add and Remove Builder System Metrics Private Endpoint Controller""" __request = None __response = None @@ -138,6 +139,7 @@ def delete(self, request, metric_id): class BuilderComponents(View): + """Add and Remove Builder Components Private Endpoint Controller""" __request = None __response = None @@ -250,6 +252,7 @@ def delete(self, request, component_id): class BuilderSettings(View): + """Update Builder Settings Private Endpoint Controller""" __request = None __response = None diff --git a/app/controllers/api/private/v1/admin/component.py b/app/controllers/api/private/v1/admin/component.py index 07e88974..96c65c8e 100644 --- a/app/controllers/api/private/v1/admin/component.py +++ b/app/controllers/api/private/v1/admin/component.py @@ -29,6 +29,7 @@ class Components(View): + """Create and List Components Private Endpoint Controller""" __request = None __response = None @@ -183,6 +184,7 @@ def __format_components(self, components): class Component(View): + """Update and Delete Component Private Endpoint Controller""" __request = None __response = None diff --git a/app/controllers/api/private/v1/admin/component_group.py b/app/controllers/api/private/v1/admin/component_group.py index b58d45e7..5bb8840b 100644 --- a/app/controllers/api/private/v1/admin/component_group.py +++ b/app/controllers/api/private/v1/admin/component_group.py @@ -29,6 +29,7 @@ class ComponentGroups(View): + """Create and List Component Groups Private Endpoint Controller""" __request = None __response = None @@ -166,6 +167,7 @@ def __format_groups(self, groups): class ComponentGroup(View): + """Update and Delete Component Group Private Endpoint Controller""" __request = None __response = None diff --git a/app/controllers/api/private/v1/admin/incident.py b/app/controllers/api/private/v1/admin/incident.py index f2389015..779da219 100644 --- a/app/controllers/api/private/v1/admin/incident.py +++ b/app/controllers/api/private/v1/admin/incident.py @@ -30,6 +30,7 @@ class Incidents(View): + """Create and List Incidents Private Endpoint Controller""" __request = None __response = None @@ -166,6 +167,7 @@ def __format_incidents(self, incidents): class Incident(View): + """Update Incident Private Endpoint Controller""" __request = None __response = None diff --git a/app/controllers/api/private/v1/admin/incident_update.py b/app/controllers/api/private/v1/admin/incident_update.py index 824da98b..c15d0130 100644 --- a/app/controllers/api/private/v1/admin/incident_update.py +++ b/app/controllers/api/private/v1/admin/incident_update.py @@ -36,6 +36,7 @@ class IncidentUpdates(View): + """Create and List Incident Updates Private Endpoint Controller""" __request = None __response = None @@ -211,6 +212,7 @@ def __format_incident_updates(self, updates, incident_id): class IncidentUpdate(View): + """Update and Delete Incident Update Private Endpoint Controller""" __request = None __response = None @@ -330,6 +332,7 @@ def delete(self, request, incident_id, update_id): class IncidentUpdatesNotify(View): + """Notify Subscribers about Incident Update Private Endpoint Controller""" __request = None __response = None @@ -392,6 +395,7 @@ def post(self, request, incident_id, update_id): class IncidentUpdatesComponents(View): + """Link Component to Incident Update Private Endpoint Controller""" __request = None __response = None @@ -475,6 +479,7 @@ def post(self, request, incident_id, update_id): class IncidentUpdatesComponent(View): + """Remove Component from Incident Update Private Endpoint Controller""" __request = None __response = None diff --git a/app/controllers/api/private/v1/admin/metric.py b/app/controllers/api/private/v1/admin/metric.py index e6941307..0393bcf1 100644 --- a/app/controllers/api/private/v1/admin/metric.py +++ b/app/controllers/api/private/v1/admin/metric.py @@ -29,6 +29,7 @@ class Metrics(View): + """Create and List Metrics Private Endpoint Controller""" __request = None __response = None @@ -196,6 +197,7 @@ def __format_metrics(self, metrics): class Metric(View): + """Update and Delete Metric Private Endpoint Controller""" __request = None __response = None @@ -339,6 +341,7 @@ def delete(self, request, metric_id): class NewRelicApps(View): + """List NewRelic Apps Private Endpoint Controller""" __request = None __response = None diff --git a/app/controllers/api/private/v1/admin/notifications.py b/app/controllers/api/private/v1/admin/notifications.py index 50c21da9..20bc6f25 100644 --- a/app/controllers/api/private/v1/admin/notifications.py +++ b/app/controllers/api/private/v1/admin/notifications.py @@ -28,6 +28,7 @@ class LatestNotifications(View): + """List and Update Latest Notifications Private Endpoint Controller""" __request = None __response = None @@ -81,6 +82,7 @@ def post(self, request): class Notifications(View): + """List Notifications Private Endpoint Controller""" __request = None __response = None diff --git a/app/controllers/api/private/v1/admin/profile.py b/app/controllers/api/private/v1/admin/profile.py index 475a1e7a..089f355f 100644 --- a/app/controllers/api/private/v1/admin/profile.py +++ b/app/controllers/api/private/v1/admin/profile.py @@ -28,6 +28,7 @@ class Profile(View): + """Update Profile Private Endpoint Controller""" __request = None __response = None diff --git a/app/controllers/api/private/v1/admin/settings.py b/app/controllers/api/private/v1/admin/settings.py index 7ea4aa3c..7d3ec621 100644 --- a/app/controllers/api/private/v1/admin/settings.py +++ b/app/controllers/api/private/v1/admin/settings.py @@ -30,6 +30,7 @@ class Settings(View): + """Update Settings Private Endpoint Controller""" __request = None __response = None diff --git a/app/controllers/api/private/v1/admin/subscriber.py b/app/controllers/api/private/v1/admin/subscriber.py index e05e1d68..331b93e0 100644 --- a/app/controllers/api/private/v1/admin/subscriber.py +++ b/app/controllers/api/private/v1/admin/subscriber.py @@ -29,6 +29,7 @@ class Subscribers(View): + """Create and List Subscribers Private Endpoint Controller""" __request = None __response = None @@ -312,6 +313,7 @@ def __format_subscribers(self, subscribers): class Subscriber(View): + """Update and Delete Subscriber Private Endpoint Controller""" __request = None __response = None diff --git a/app/controllers/api/private/v1/admin/user.py b/app/controllers/api/private/v1/admin/user.py index 8f6886f4..85d7e71a 100644 --- a/app/controllers/api/private/v1/admin/user.py +++ b/app/controllers/api/private/v1/admin/user.py @@ -29,6 +29,7 @@ class Users(View): + """Create and List Users Private Endpoint Controller""" __request = None __response = None @@ -286,6 +287,7 @@ def __format_users(self, users): class User(View): + """Update and Delete User Private Endpoint Controller""" __request = None __response = None diff --git a/app/controllers/api/private/v1/forgot_password.py b/app/controllers/api/private/v1/forgot_password.py index 832cc917..a6b77c86 100644 --- a/app/controllers/api/private/v1/forgot_password.py +++ b/app/controllers/api/private/v1/forgot_password.py @@ -28,6 +28,7 @@ class ForgotPassword(View): + """Forgot Password Private Endpoint Controller""" __request = None __response = None diff --git a/app/controllers/api/private/v1/install.py b/app/controllers/api/private/v1/install.py index 36e89bae..85120414 100644 --- a/app/controllers/api/private/v1/install.py +++ b/app/controllers/api/private/v1/install.py @@ -29,7 +29,7 @@ class Install(View): - """Install Endpoints Controller""" + """Install Private Endpoint Controller""" __request = None __response = None diff --git a/app/controllers/api/private/v1/login.py b/app/controllers/api/private/v1/login.py index 78970c9c..d3afeba2 100644 --- a/app/controllers/api/private/v1/login.py +++ b/app/controllers/api/private/v1/login.py @@ -28,6 +28,7 @@ class Login(View): + """Login Private Endpoint Controller""" __request = None __response = None diff --git a/app/controllers/api/private/v1/register.py b/app/controllers/api/private/v1/register.py index bea0adc0..87508357 100644 --- a/app/controllers/api/private/v1/register.py +++ b/app/controllers/api/private/v1/register.py @@ -31,6 +31,7 @@ class Register(View): + """Register Private Endpoint Controller""" __request = None __response = None diff --git a/app/controllers/api/private/v1/reset_password.py b/app/controllers/api/private/v1/reset_password.py index 5b0d76d9..21adc512 100644 --- a/app/controllers/api/private/v1/reset_password.py +++ b/app/controllers/api/private/v1/reset_password.py @@ -28,6 +28,7 @@ class ResetPassword(View): + """Reset Password Private Endpoint Controller""" __request = None __response = None diff --git a/app/controllers/api/private/v1/status.py b/app/controllers/api/private/v1/status.py index 1ddb9638..be886bee 100644 --- a/app/controllers/api/private/v1/status.py +++ b/app/controllers/api/private/v1/status.py @@ -27,6 +27,7 @@ class StatusSubscribe(View): + """Subscribe Private Endpoint Controller""" __request = None __response = None diff --git a/app/tests/functional/controllers/api/private/v1/admin/test_profile.py b/app/tests/functional/controllers/api/private/v1/admin/test_profile.py index 40135bfc..a174cc85 100644 --- a/app/tests/functional/controllers/api/private/v1/admin/test_profile.py +++ b/app/tests/functional/controllers/api/private/v1/admin/test_profile.py @@ -1,6 +1,16 @@ -""" -Test Profile Controller -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import json diff --git a/app/tests/functional/controllers/api/private/v1/admin/test_settings.py b/app/tests/functional/controllers/api/private/v1/admin/test_settings.py index d70dc9ec..ff37f514 100644 --- a/app/tests/functional/controllers/api/private/v1/admin/test_settings.py +++ b/app/tests/functional/controllers/api/private/v1/admin/test_settings.py @@ -1,6 +1,16 @@ -""" -Test Settings Controller -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import json diff --git a/app/tests/functional/controllers/api/private/v1/admin/test_user.py b/app/tests/functional/controllers/api/private/v1/admin/test_user.py index c79e09ef..c31e72b9 100644 --- a/app/tests/functional/controllers/api/private/v1/admin/test_user.py +++ b/app/tests/functional/controllers/api/private/v1/admin/test_user.py @@ -1,6 +1,16 @@ -""" -Test Profile Controller -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import json diff --git a/app/tests/functional/controllers/api/private/v1/test_install.py b/app/tests/functional/controllers/api/private/v1/test_install.py index 773a26e1..c5ff183e 100644 --- a/app/tests/functional/controllers/api/private/v1/test_install.py +++ b/app/tests/functional/controllers/api/private/v1/test_install.py @@ -1,6 +1,16 @@ -""" -Test Install Controller -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import json diff --git a/app/tests/functional/controllers/api/private/v1/test_status.py b/app/tests/functional/controllers/api/private/v1/test_status.py index ab38e311..f3df1a69 100644 --- a/app/tests/functional/controllers/api/private/v1/test_status.py +++ b/app/tests/functional/controllers/api/private/v1/test_status.py @@ -1,6 +1,16 @@ -""" -Test Status Subscribe Controller -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Standard Library import json diff --git a/app/tests/functional/controllers/web/test_home.py b/app/tests/functional/controllers/web/test_home.py index 664602b2..6f666f8e 100644 --- a/app/tests/functional/controllers/web/test_home.py +++ b/app/tests/functional/controllers/web/test_home.py @@ -1,6 +1,16 @@ -""" -Test Home Controller -""" +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Third Party Library from django.test import TestCase diff --git a/app/tests/testing_base.py b/app/tests/testing_base.py index 4cb27774..be44d935 100644 --- a/app/tests/testing_base.py +++ b/app/tests/testing_base.py @@ -1,4 +1,16 @@ - +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. from app.modules.core.install import Install as Install_Module From b6b476c4941048dcd0da1cc72ac5a42c822637df Mon Sep 17 00:00:00 2001 From: Clivern Date: Thu, 19 Sep 2019 19:04:41 +0200 Subject: [PATCH 11/15] Remove class attr --- .../api/private/v1/admin/activity.py | 11 +-- .../api/private/v1/admin/builder.py | 36 ++-------- .../api/private/v1/admin/component.py | 22 ++---- .../api/private/v1/admin/component_group.py | 22 ++---- .../api/private/v1/admin/incident.py | 22 ++---- .../api/private/v1/admin/incident_update.py | 67 +++---------------- .../api/private/v1/admin/metric.py | 33 ++------- .../api/private/v1/admin/notifications.py | 23 ++----- .../api/private/v1/admin/profile.py | 11 +-- .../api/private/v1/admin/settings.py | 11 +-- .../api/private/v1/admin/subscriber.py | 22 ++---- app/controllers/api/private/v1/admin/user.py | 22 ++---- .../api/private/v1/forgot_password.py | 9 +-- app/controllers/api/private/v1/install.py | 10 +-- app/controllers/api/private/v1/login.py | 9 +-- app/controllers/api/private/v1/register.py | 9 +-- .../api/private/v1/reset_password.py | 9 +-- app/controllers/api/private/v1/status.py | 9 +-- app/controllers/web/admin/activity.py | 7 +- app/controllers/web/admin/builder.py | 9 ++- app/controllers/web/admin/component.py | 15 ++--- app/controllers/web/admin/component_group.py | 15 ++--- app/controllers/web/admin/dashboard.py | 6 +- app/controllers/web/admin/incident.py | 44 ++++++------ app/controllers/web/admin/incident_update.py | 38 +++++------ app/controllers/web/admin/logout.py | 2 - app/controllers/web/admin/metric.py | 16 ++--- app/controllers/web/admin/notification.py | 5 +- app/controllers/web/admin/profile.py | 8 +-- app/controllers/web/admin/settings.py | 7 +- app/controllers/web/admin/subscriber.py | 15 ++--- app/controllers/web/admin/user.py | 15 ++--- app/controllers/web/forgot_password.py | 3 - app/controllers/web/health_check.py | 6 -- app/controllers/web/history.py | 10 --- app/controllers/web/install.py | 4 -- app/controllers/web/login.py | 3 - app/controllers/web/register.py | 4 -- app/controllers/web/reset_password.py | 4 -- app/controllers/web/statistics.py | 4 -- app/controllers/web/status_page.py | 12 ---- app/middleware/api_funnel.py | 6 +- app/middleware/correlation.py | 2 - app/middleware/errors.py | 3 - app/middleware/logging.py | 3 - app/middleware/web_funnel.py | 8 +-- app/modules/core/activity.py | 2 - app/modules/core/component.py | 3 - app/modules/core/component_group.py | 3 - app/modules/core/context.py | 5 +- app/modules/core/dashboard.py | 10 --- app/modules/core/forgot_password.py | 4 -- app/modules/core/incident.py | 6 -- app/modules/core/incident_update.py | 3 - app/modules/core/incident_update_component.py | 2 - .../core/incident_update_notification.py | 2 - app/modules/core/install.py | 3 - app/modules/core/login.py | 3 - app/modules/core/metric.py | 5 +- app/modules/core/notification.py | 5 -- app/modules/core/profile.py | 5 -- app/modules/core/request.py | 4 -- app/modules/core/reset_password.py | 3 - app/modules/core/response.py | 3 - app/modules/core/settings.py | 2 - app/modules/core/statistics.py | 6 -- app/modules/core/status_page.py | 8 --- app/modules/core/subscriber.py | 2 - app/modules/core/task.py | 2 - app/modules/core/user.py | 6 -- app/modules/service/prometheus.py | 2 - app/modules/util/crypto.py | 2 - app/modules/util/helpers.py | 3 +- 73 files changed, 147 insertions(+), 588 deletions(-) diff --git a/app/controllers/api/private/v1/admin/activity.py b/app/controllers/api/private/v1/admin/activity.py index 09c29351..7db433a7 100644 --- a/app/controllers/api/private/v1/admin/activity.py +++ b/app/controllers/api/private/v1/admin/activity.py @@ -29,15 +29,6 @@ class Activities(View): """List Activities Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __activity = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -45,6 +36,8 @@ def __init__(self): self.__form = Form() self.__activity = ActivityModule() self.__logger = self.__helpers.get_logger(__name__) + self.__user_id = None + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated diff --git a/app/controllers/api/private/v1/admin/builder.py b/app/controllers/api/private/v1/admin/builder.py index ed032dcd..e7637857 100644 --- a/app/controllers/api/private/v1/admin/builder.py +++ b/app/controllers/api/private/v1/admin/builder.py @@ -36,16 +36,6 @@ class BuilderSystemMetrics(View): """Add and Remove Builder System Metrics Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __settings = None - __metric = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -54,6 +44,8 @@ def __init__(self): self.__metric = MetricModule() self.__form = Form() self.__logger = self.__helpers.get_logger(__name__) + self.__user_id = None + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated_and_has_permission("manage_settings") @@ -141,17 +133,6 @@ def delete(self, request, metric_id): class BuilderComponents(View): """Add and Remove Builder Components Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __settings = None - __component = None - __component_group = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -161,6 +142,8 @@ def __init__(self): self.__component_group = ComponentGroupModule() self.__form = Form() self.__logger = self.__helpers.get_logger(__name__) + self.__user_id = None + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated_and_has_permission("manage_settings") @@ -254,15 +237,6 @@ def delete(self, request, component_id): class BuilderSettings(View): """Update Builder Settings Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __settings = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -270,6 +244,8 @@ def __init__(self): self.__settings = Settings() self.__form = Form() self.__logger = self.__helpers.get_logger(__name__) + self.__user_id = None + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated_and_has_permission("manage_settings") diff --git a/app/controllers/api/private/v1/admin/component.py b/app/controllers/api/private/v1/admin/component.py index 96c65c8e..ee806df5 100644 --- a/app/controllers/api/private/v1/admin/component.py +++ b/app/controllers/api/private/v1/admin/component.py @@ -31,15 +31,6 @@ class Components(View): """Create and List Components Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __component = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -48,6 +39,8 @@ def __init__(self): self.__component = ComponentModule() self.__logger = self.__helpers.get_logger(__name__) self.__form.add_validator(ExtraRules()) + self.__user_id = None + self.__correlation_id = "" @allow_if_authenticated def post(self, request): @@ -186,15 +179,6 @@ def __format_components(self, components): class Component(View): """Update and Delete Component Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __component = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -203,6 +187,8 @@ def __init__(self): self.__component = ComponentModule() self.__logger = self.__helpers.get_logger(__name__) self.__form.add_validator(ExtraRules()) + self.__user_id = None + self.__correlation_id = "" @allow_if_authenticated def post(self, request, component_id): diff --git a/app/controllers/api/private/v1/admin/component_group.py b/app/controllers/api/private/v1/admin/component_group.py index 5bb8840b..a622331e 100644 --- a/app/controllers/api/private/v1/admin/component_group.py +++ b/app/controllers/api/private/v1/admin/component_group.py @@ -31,15 +31,6 @@ class ComponentGroups(View): """Create and List Component Groups Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __component_group = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -47,6 +38,8 @@ def __init__(self): self.__form = Form() self.__component_group = ComponentGroupModule() self.__logger = self.__helpers.get_logger(__name__) + self.__user_id = None + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated @@ -169,15 +162,6 @@ def __format_groups(self, groups): class ComponentGroup(View): """Update and Delete Component Group Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __component_group = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -185,6 +169,8 @@ def __init__(self): self.__form = Form() self.__component_group = ComponentGroupModule() self.__logger = self.__helpers.get_logger(__name__) + self.__user_id = None + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated diff --git a/app/controllers/api/private/v1/admin/incident.py b/app/controllers/api/private/v1/admin/incident.py index 779da219..3a3db907 100644 --- a/app/controllers/api/private/v1/admin/incident.py +++ b/app/controllers/api/private/v1/admin/incident.py @@ -32,15 +32,6 @@ class Incidents(View): """Create and List Incidents Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __incident = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -48,6 +39,8 @@ def __init__(self): self.__form = Form() self.__incident = IncidentModule() self.__logger = self.__helpers.get_logger(__name__) + self.__user_id = None + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated @@ -169,15 +162,6 @@ def __format_incidents(self, incidents): class Incident(View): """Update Incident Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __incident = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -185,6 +169,8 @@ def __init__(self): self.__form = Form() self.__incident = IncidentModule() self.__logger = self.__helpers.get_logger(__name__) + self.__user_id = None + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated diff --git a/app/controllers/api/private/v1/admin/incident_update.py b/app/controllers/api/private/v1/admin/incident_update.py index c15d0130..197ac2d5 100644 --- a/app/controllers/api/private/v1/admin/incident_update.py +++ b/app/controllers/api/private/v1/admin/incident_update.py @@ -38,20 +38,6 @@ class IncidentUpdates(View): """Create and List Incident Updates Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __incident = None - __incident_update = None - __task = None - __notification = None - __subscriber = None - __incident_update_notification = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -64,6 +50,8 @@ def __init__(self): self.__subscriber = SubscriberModule() self.__incident_update_notification = IncidentUpdateNotificationModule() self.__logger = self.__helpers.get_logger(__name__) + self.__user_id = None + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated @@ -214,15 +202,6 @@ def __format_incident_updates(self, updates, incident_id): class IncidentUpdate(View): """Update and Delete Incident Update Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __incident_update = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -230,6 +209,8 @@ def __init__(self): self.__form = Form() self.__incident_update = IncidentUpdateModule() self.__logger = self.__helpers.get_logger(__name__) + self.__user_id = None + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated @@ -334,18 +315,6 @@ def delete(self, request, incident_id, update_id): class IncidentUpdatesNotify(View): """Notify Subscribers about Incident Update Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __incident_update = None - __task = None - __notification = None - __subscriber = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -356,6 +325,8 @@ def __init__(self): self.__notification = NotificationModule() self.__subscriber = SubscriberModule() self.__logger = self.__helpers.get_logger(__name__) + self.__user_id = None + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated @@ -397,19 +368,6 @@ def post(self, request, incident_id, update_id): class IncidentUpdatesComponents(View): """Link Component to Incident Update Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __incident_update = None - __task = None - __notification = None - __subscriber = None - __incident_update_component = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -421,6 +379,8 @@ def __init__(self): self.__subscriber = SubscriberModule() self.__logger = self.__helpers.get_logger(__name__) self.__incident_update_component = IncidentUpdateComponentModule() + self.__user_id = None + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated @@ -481,15 +441,6 @@ def post(self, request, incident_id, update_id): class IncidentUpdatesComponent(View): """Remove Component from Incident Update Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __incident_update_component = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -497,6 +448,8 @@ def __init__(self): self.__form = Form() self.__incident_update_component = IncidentUpdateComponentModule() self.__logger = self.__helpers.get_logger(__name__) + self.__user_id = None + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated diff --git a/app/controllers/api/private/v1/admin/metric.py b/app/controllers/api/private/v1/admin/metric.py index 0393bcf1..042b456b 100644 --- a/app/controllers/api/private/v1/admin/metric.py +++ b/app/controllers/api/private/v1/admin/metric.py @@ -31,15 +31,6 @@ class Metrics(View): """Create and List Metrics Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __metric = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -47,6 +38,8 @@ def __init__(self): self.__form = Form() self.__metric = MetricModule() self.__logger = self.__helpers.get_logger(__name__) + self.__user_id = None + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated @@ -199,15 +192,6 @@ def __format_metrics(self, metrics): class Metric(View): """Update and Delete Metric Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __metric = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -215,6 +199,8 @@ def __init__(self): self.__form = Form() self.__metric = MetricModule() self.__logger = self.__helpers.get_logger(__name__) + self.__user_id = None + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated @@ -343,15 +329,6 @@ def delete(self, request, metric_id): class NewRelicApps(View): """List NewRelic Apps Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __metric = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -359,6 +336,8 @@ def __init__(self): self.__form = Form() self.__metric = MetricModule() self.__logger = self.__helpers.get_logger(__name__) + self.__user_id = None + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated diff --git a/app/controllers/api/private/v1/admin/notifications.py b/app/controllers/api/private/v1/admin/notifications.py index 20bc6f25..01f31986 100644 --- a/app/controllers/api/private/v1/admin/notifications.py +++ b/app/controllers/api/private/v1/admin/notifications.py @@ -30,15 +30,6 @@ class LatestNotifications(View): """List and Update Latest Notifications Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __notification = None - __correlation_id = None - def __init__(self): self.__helpers = Helpers() self.__form = Form() @@ -46,6 +37,8 @@ def __init__(self): self.__response = Response() self.__request = Request() self.__notification = NotificationModule() + self.__user_id = None + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated @@ -84,16 +77,6 @@ def post(self, request): class Notifications(View): """List Notifications Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __notification = None - __humanize = None - __correlation_id = None - def __init__(self): self.__helpers = Helpers() self.__form = Form() @@ -102,6 +85,8 @@ def __init__(self): self.__request = Request() self.__notification = NotificationModule() self.__humanize = Humanize() + self.__user_id = None + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated diff --git a/app/controllers/api/private/v1/admin/profile.py b/app/controllers/api/private/v1/admin/profile.py index 089f355f..d9a762dd 100644 --- a/app/controllers/api/private/v1/admin/profile.py +++ b/app/controllers/api/private/v1/admin/profile.py @@ -30,15 +30,6 @@ class Profile(View): """Update Profile Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __profile_module = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -46,6 +37,8 @@ def __init__(self): self.__form = Form() self.__profile_module = ProfileModule() self.__logger = self.__helpers.get_logger(__name__) + self.__user_id = None + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated diff --git a/app/controllers/api/private/v1/admin/settings.py b/app/controllers/api/private/v1/admin/settings.py index 7d3ec621..12d21a0e 100644 --- a/app/controllers/api/private/v1/admin/settings.py +++ b/app/controllers/api/private/v1/admin/settings.py @@ -32,16 +32,6 @@ class Settings(View): """Update Settings Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __settings_module = None - __logger = None - __acl = None - __activity_module = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -51,6 +41,7 @@ def __init__(self): self.__acl = ACL() self.__activity_module = ActivityModule() self.__logger = self.__helpers.get_logger(__name__) + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated_and_has_permission("manage_settings") diff --git a/app/controllers/api/private/v1/admin/subscriber.py b/app/controllers/api/private/v1/admin/subscriber.py index 331b93e0..db5188f4 100644 --- a/app/controllers/api/private/v1/admin/subscriber.py +++ b/app/controllers/api/private/v1/admin/subscriber.py @@ -31,15 +31,6 @@ class Subscribers(View): """Create and List Subscribers Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __subscriber = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -47,6 +38,8 @@ def __init__(self): self.__form = Form() self.__subscriber = SubscriberModule() self.__logger = self.__helpers.get_logger(__name__) + self.__user_id = None + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated @@ -315,15 +308,6 @@ def __format_subscribers(self, subscribers): class Subscriber(View): """Update and Delete Subscriber Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __subscriber = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -331,6 +315,8 @@ def __init__(self): self.__form = Form() self.__subscriber = SubscriberModule() self.__logger = self.__helpers.get_logger(__name__) + self.__user_id = None + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated diff --git a/app/controllers/api/private/v1/admin/user.py b/app/controllers/api/private/v1/admin/user.py index 85d7e71a..ce83b087 100644 --- a/app/controllers/api/private/v1/admin/user.py +++ b/app/controllers/api/private/v1/admin/user.py @@ -31,15 +31,6 @@ class Users(View): """Create and List Users Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __user = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -47,6 +38,8 @@ def __init__(self): self.__form = Form() self.__user = UserModule() self.__logger = self.__helpers.get_logger(__name__) + self.__user_id = None + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated_and_has_permission("manage_settings") @@ -289,15 +282,6 @@ def __format_users(self, users): class User(View): """Update and Delete User Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __user_id = None - __user = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -305,6 +289,8 @@ def __init__(self): self.__form = Form() self.__user = UserModule() self.__logger = self.__helpers.get_logger(__name__) + self.__user_id = None + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @allow_if_authenticated_and_has_permission("manage_settings") diff --git a/app/controllers/api/private/v1/forgot_password.py b/app/controllers/api/private/v1/forgot_password.py index a6b77c86..d9b1c42a 100644 --- a/app/controllers/api/private/v1/forgot_password.py +++ b/app/controllers/api/private/v1/forgot_password.py @@ -30,14 +30,6 @@ class ForgotPassword(View): """Forgot Password Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __forgot_password = None - __logger = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -45,6 +37,7 @@ def __init__(self): self.__form = Form() self.__forgot_password = ForgotPasswordModule() self.__logger = self.__helpers.get_logger(__name__) + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @stop_request_if_authenticated diff --git a/app/controllers/api/private/v1/install.py b/app/controllers/api/private/v1/install.py index 85120414..5510bf9a 100644 --- a/app/controllers/api/private/v1/install.py +++ b/app/controllers/api/private/v1/install.py @@ -31,15 +31,6 @@ class Install(View): """Install Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __install = None - __logger = None - __notification = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -48,6 +39,7 @@ def __init__(self): self.__install = InstallModule() self.__notification = NotificationModule() self.__logger = self.__helpers.get_logger(__name__) + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @stop_request_if_installed diff --git a/app/controllers/api/private/v1/login.py b/app/controllers/api/private/v1/login.py index d3afeba2..fe10afd6 100644 --- a/app/controllers/api/private/v1/login.py +++ b/app/controllers/api/private/v1/login.py @@ -30,14 +30,6 @@ class Login(View): """Login Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __login = None - __logger = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -45,6 +37,7 @@ def __init__(self): self.__form = Form() self.__login = LoginModule() self.__logger = self.__helpers.get_logger(__name__) + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @stop_request_if_authenticated diff --git a/app/controllers/api/private/v1/register.py b/app/controllers/api/private/v1/register.py index 87508357..fbe3b472 100644 --- a/app/controllers/api/private/v1/register.py +++ b/app/controllers/api/private/v1/register.py @@ -33,14 +33,6 @@ class Register(View): """Register Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __user = None - __logger = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -48,6 +40,7 @@ def __init__(self): self.__form = Form() self.__user = UserModule() self.__logger = self.__helpers.get_logger(__name__) + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @stop_request_if_authenticated diff --git a/app/controllers/api/private/v1/reset_password.py b/app/controllers/api/private/v1/reset_password.py index 21adc512..7dcccc73 100644 --- a/app/controllers/api/private/v1/reset_password.py +++ b/app/controllers/api/private/v1/reset_password.py @@ -30,14 +30,6 @@ class ResetPassword(View): """Reset Password Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __reset_password = None - __logger = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -45,6 +37,7 @@ def __init__(self): self.__form = Form() self.__reset_password = ResetPasswordModule() self.__logger = self.__helpers.get_logger(__name__) + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) @stop_request_if_authenticated diff --git a/app/controllers/api/private/v1/status.py b/app/controllers/api/private/v1/status.py index be886bee..0dbe7ba3 100644 --- a/app/controllers/api/private/v1/status.py +++ b/app/controllers/api/private/v1/status.py @@ -29,14 +29,6 @@ class StatusSubscribe(View): """Subscribe Private Endpoint Controller""" - __request = None - __response = None - __helpers = None - __form = None - __logger = None - __subscriber = None - __correlation_id = None - def __init__(self): self.__request = Request() self.__response = Response() @@ -44,6 +36,7 @@ def __init__(self): self.__form = Form() self.__subscriber = SubscriberModule() self.__logger = self.__helpers.get_logger(__name__) + self.__correlation_id = "" self.__form.add_validator(ExtraRules()) def post(self, request): diff --git a/app/controllers/web/admin/activity.py b/app/controllers/web/admin/activity.py index 3c438da2..0fa8e4d3 100644 --- a/app/controllers/web/admin/activity.py +++ b/app/controllers/web/admin/activity.py @@ -30,14 +30,13 @@ class Activity(View): template_name = 'templates/admin/activity.html' - __context = Context() - __upgrade = Upgrade() - __acl = ACL() - __correlation_id = None @login_if_not_authenticated def get(self, request): + self.__context = Context() + self.__upgrade = Upgrade() + self.__acl = ACL() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" self.__context.autoload_options() self.__context.autoload_user(request.user.id if request.user.is_authenticated else None) diff --git a/app/controllers/web/admin/builder.py b/app/controllers/web/admin/builder.py index c5e209c0..5ce89f65 100644 --- a/app/controllers/web/admin/builder.py +++ b/app/controllers/web/admin/builder.py @@ -32,15 +32,14 @@ class Builder(View): template_name = 'templates/admin/builder.html' - __context = Context() - __metric = MetricModule() - __component = ComponentModule() - __component_group = ComponentGroupModule() - __correlation_id = None @login_if_not_authenticated_or_no_permission("manage_settings") def get(self, request): + self.__context = Context() + self.__metric = MetricModule() + self.__component = ComponentModule() + self.__component_group = ComponentGroupModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" self.__context.autoload_options() self.__context.autoload_user(request.user.id if request.user.is_authenticated else None) diff --git a/app/controllers/web/admin/component.py b/app/controllers/web/admin/component.py index cddee6f7..85fb353d 100644 --- a/app/controllers/web/admin/component.py +++ b/app/controllers/web/admin/component.py @@ -30,13 +30,12 @@ class ComponentList(View): template_name = 'templates/admin/component/list.html' - __context = Context() - __component = ComponentModule() - __correlation_id = None @login_if_not_authenticated def get(self, request): + self.__context = Context() + self.__component = ComponentModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" self.__context.autoload_options() self.__context.autoload_user(request.user.id if request.user.is_authenticated else None) @@ -50,13 +49,12 @@ def get(self, request): class ComponentAdd(View): template_name = 'templates/admin/component/add.html' - __context = Context() - __component = ComponentModule() - __correlation_id = None @login_if_not_authenticated def get(self, request): + self.__context = Context() + self.__component = ComponentModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" self.__context.autoload_options() self.__context.autoload_user(request.user.id if request.user.is_authenticated else None) @@ -71,13 +69,12 @@ def get(self, request): class ComponentEdit(View): template_name = 'templates/admin/component/edit.html' - __context = Context() - __component = ComponentModule() - __correlation_id = None @login_if_not_authenticated def get(self, request, component_id): + self.__context = Context() + self.__component = ComponentModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" component = self.__component.get_one_by_id(component_id) diff --git a/app/controllers/web/admin/component_group.py b/app/controllers/web/admin/component_group.py index 92d4debe..b818cadf 100644 --- a/app/controllers/web/admin/component_group.py +++ b/app/controllers/web/admin/component_group.py @@ -30,13 +30,12 @@ class ComponentGroupList(View): template_name = 'templates/admin/component_group/list.html' - __context = Context() - __component_group = ComponentGroupModule() - __correlation_id = None @login_if_not_authenticated def get(self, request): + self.__context = Context() + self.__component_group = ComponentGroupModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" self.__context.autoload_options() self.__context.autoload_user(request.user.id if request.user.is_authenticated else None) @@ -50,13 +49,12 @@ def get(self, request): class ComponentGroupAdd(View): template_name = 'templates/admin/component_group/add.html' - __context = Context() - __component_group = ComponentGroupModule() - __correlation_id = None @login_if_not_authenticated def get(self, request): + self.__context = Context() + self.__component_group = ComponentGroupModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" self.__context.autoload_options() self.__context.autoload_user(request.user.id if request.user.is_authenticated else None) @@ -70,13 +68,12 @@ def get(self, request): class ComponentGroupEdit(View): template_name = 'templates/admin/component_group/edit.html' - __context = Context() - __component_group = ComponentGroupModule() - __correlation_id = None @login_if_not_authenticated def get(self, request, group_id): + self.__context = Context() + self.__component_group = ComponentGroupModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" group = self.__component_group.get_one_by_id(group_id) diff --git a/app/controllers/web/admin/dashboard.py b/app/controllers/web/admin/dashboard.py index 7bb49833..e57dac0b 100644 --- a/app/controllers/web/admin/dashboard.py +++ b/app/controllers/web/admin/dashboard.py @@ -29,13 +29,11 @@ class Dashboard(View): template_name = 'templates/admin/dashboard.html' - __context = Context() - __dashboard = DashboardModule() - __correlation_id = None @login_if_not_authenticated def get(self, request): - + self.__context = Context() + self.__dashboard = DashboardModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" self.__context.autoload_options() self.__context.autoload_user(request.user.id if request.user.is_authenticated else None) diff --git a/app/controllers/web/admin/incident.py b/app/controllers/web/admin/incident.py index 8d91e5e6..666f9982 100644 --- a/app/controllers/web/admin/incident.py +++ b/app/controllers/web/admin/incident.py @@ -33,16 +33,15 @@ class IncidentList(View): template_name = 'templates/admin/incident/list.html' - __context = Context() - __incident = IncidentModule() - __incident_update = IncidentUpdateModule() - __component = ComponentModule() - __component_group = ComponentGroupModule() - __correlation_id = None @login_if_not_authenticated def get(self, request): + self.__context = Context() + self.__incident = IncidentModule() + self.__incident_update = IncidentUpdateModule() + self.__component = ComponentModule() + self.__component_group = ComponentGroupModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" self.__context.autoload_options() self.__context.autoload_user(request.user.id if request.user.is_authenticated else None) @@ -56,16 +55,15 @@ def get(self, request): class IncidentAdd(View): template_name = 'templates/admin/incident/add.html' - __context = Context() - __incident = IncidentModule() - __incident_update = IncidentUpdateModule() - __component = ComponentModule() - __component_group = ComponentGroupModule() - __correlation_id = None @login_if_not_authenticated def get(self, request): + self.__context = Context() + self.__incident = IncidentModule() + self.__incident_update = IncidentUpdateModule() + self.__component = ComponentModule() + self.__component_group = ComponentGroupModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" self.__context.autoload_options() self.__context.autoload_user(request.user.id if request.user.is_authenticated else None) @@ -79,16 +77,15 @@ def get(self, request): class IncidentEdit(View): template_name = 'templates/admin/incident/edit.html' - __context = Context() - __incident = IncidentModule() - __incident_update = IncidentUpdateModule() - __component = ComponentModule() - __component_group = ComponentGroupModule() - __correlation_id = None @login_if_not_authenticated def get(self, request, incident_id): + self.__context = Context() + self.__incident = IncidentModule() + self.__incident_update = IncidentUpdateModule() + self.__component = ComponentModule() + self.__component_group = ComponentGroupModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" incident = self.__incident.get_one_by_id(incident_id) @@ -108,16 +105,15 @@ def get(self, request, incident_id): class IncidentView(View): template_name = 'templates/admin/incident/view.html' - __context = Context() - __incident = IncidentModule() - __incident_update = IncidentUpdateModule() - __component = ComponentModule() - __component_group = ComponentGroupModule() - __correlation_id = None @login_if_not_authenticated def get(self, request, incident_id): + self.__context = Context() + self.__incident = IncidentModule() + self.__incident_update = IncidentUpdateModule() + self.__component = ComponentModule() + self.__component_group = ComponentGroupModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" incident = self.__incident.get_one_by_id(incident_id) diff --git a/app/controllers/web/admin/incident_update.py b/app/controllers/web/admin/incident_update.py index 465b7cd3..ef19d103 100644 --- a/app/controllers/web/admin/incident_update.py +++ b/app/controllers/web/admin/incident_update.py @@ -36,16 +36,14 @@ class IncidentUpdateAdd(View): template_name = 'templates/admin/incident/update/add.html' - __context = Context() - __incident = IncidentModule() - __incident_update = IncidentUpdateModule() - __component = ComponentModule() - __component_group = ComponentGroupModule() - __correlation_id = None @login_if_not_authenticated def get(self, request, incident_id): - + self.__context = Context() + self.__incident = IncidentModule() + self.__incident_update = IncidentUpdateModule() + self.__component = ComponentModule() + self.__component_group = ComponentGroupModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" incident = self.__incident.get_one_by_id(incident_id) @@ -65,18 +63,17 @@ def get(self, request, incident_id): class IncidentUpdateView(View): template_name = 'templates/admin/incident/update/view.html' - __context = Context() - __incident = IncidentModule() - __incident_update = IncidentUpdateModule() - __incident_update_component = IncidentUpdateComponentModule() - __component = ComponentModule() - __component_group = ComponentGroupModule() - __incident_update_notification = IncidentUpdateNotificationModule() - __correlation_id = None @login_if_not_authenticated def get(self, request, incident_id, update_id): + self.__context = Context() + self.__incident = IncidentModule() + self.__incident_update = IncidentUpdateModule() + self.__incident_update_component = IncidentUpdateComponentModule() + self.__component = ComponentModule() + self.__component_group = ComponentGroupModule() + self.__incident_update_notification = IncidentUpdateNotificationModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" incident = self.__incident.get_one_by_id(incident_id) @@ -142,16 +139,15 @@ def __format_affected_components(self, affected_components): class IncidentUpdateEdit(View): template_name = 'templates/admin/incident/update/edit.html' - __context = Context() - __incident = IncidentModule() - __incident_update = IncidentUpdateModule() - __component = ComponentModule() - __component_group = ComponentGroupModule() - __correlation_id = None @login_if_not_authenticated def get(self, request, incident_id, update_id): + self.__context = Context() + self.__incident = IncidentModule() + self.__incident_update = IncidentUpdateModule() + self.__component = ComponentModule() + self.__component_group = ComponentGroupModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" incident = self.__incident.get_one_by_id(incident_id) diff --git a/app/controllers/web/admin/logout.py b/app/controllers/web/admin/logout.py index 43092e5a..3efcb0f3 100644 --- a/app/controllers/web/admin/logout.py +++ b/app/controllers/web/admin/logout.py @@ -25,8 +25,6 @@ class Logout(View): - __correlation_id = None - @login_if_not_authenticated def get(self, request): diff --git a/app/controllers/web/admin/metric.py b/app/controllers/web/admin/metric.py index b46135d0..fdc995c3 100644 --- a/app/controllers/web/admin/metric.py +++ b/app/controllers/web/admin/metric.py @@ -31,13 +31,12 @@ class MetricList(View): template_name = 'templates/admin/metric/list.html' - __context = Context() - __metric = MetricModule() - __correlation_id = None @login_if_not_authenticated def get(self, request): + self.__context = Context() + self.__metric = MetricModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" self.__context.autoload_options() self.__context.autoload_user(request.user.id if request.user.is_authenticated else None) @@ -51,13 +50,11 @@ def get(self, request): class MetricAdd(View): template_name = 'templates/admin/metric/add.html' - __context = Context() - __metric = MetricModule() - __correlation_id = None @login_if_not_authenticated def get(self, request): - + self.__context = Context() + self.__metric = MetricModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" self.__context.autoload_options() self.__context.autoload_user(request.user.id if request.user.is_authenticated else None) @@ -71,13 +68,12 @@ def get(self, request): class MetricEdit(View): template_name = 'templates/admin/metric/edit.html' - __context = Context() - __metric = MetricModule() - __correlation_id = None @login_if_not_authenticated def get(self, request, metric_id): + self.__context = Context() + self.__metric = MetricModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" metric = self.__metric.get_one_by_id(metric_id) diff --git a/app/controllers/web/admin/notification.py b/app/controllers/web/admin/notification.py index 99126825..53a6e985 100644 --- a/app/controllers/web/admin/notification.py +++ b/app/controllers/web/admin/notification.py @@ -29,13 +29,12 @@ class Notification(View): template_name = 'templates/admin/notification.html' - __context = Context() - __acl = ACL() - __correlation_id = None @login_if_not_authenticated def get(self, request): + self.__context = Context() + self.__acl = ACL() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" self.__context.autoload_options() self.__context.autoload_user(request.user.id if request.user.is_authenticated else None) diff --git a/app/controllers/web/admin/profile.py b/app/controllers/web/admin/profile.py index 35c3c0fd..15532417 100644 --- a/app/controllers/web/admin/profile.py +++ b/app/controllers/web/admin/profile.py @@ -22,21 +22,19 @@ # Local Library from app.modules.core.context import Context -from app.modules.core.profile import Profile +from app.modules.core.profile import Profile as ProfileModule from app.modules.core.decorators import login_if_not_authenticated class Profile(View): template_name = 'templates/admin/profile.html' - __context = Context() - __profile = Profile() - __user_id = None - __correlation_id = None @login_if_not_authenticated def get(self, request): + self.__context = Context() + self.__profile = ProfileModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" self.__user_id = request.user.id self.__context.autoload_options() diff --git a/app/controllers/web/admin/settings.py b/app/controllers/web/admin/settings.py index cff86620..b5c0d67a 100644 --- a/app/controllers/web/admin/settings.py +++ b/app/controllers/web/admin/settings.py @@ -30,14 +30,13 @@ class Settings(View): template_name = 'templates/admin/settings.html' - __context = Context() - __upgrade = Upgrade() - __acl = ACL() - __correlation_id = None @login_if_not_authenticated_or_no_permission("manage_settings") def get(self, request): + self.__context = Context() + self.__upgrade = Upgrade() + self.__acl = ACL() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" self.__context.autoload_options() self.__context.autoload_user(request.user.id if request.user.is_authenticated else None) diff --git a/app/controllers/web/admin/subscriber.py b/app/controllers/web/admin/subscriber.py index b993353b..b6d180e0 100644 --- a/app/controllers/web/admin/subscriber.py +++ b/app/controllers/web/admin/subscriber.py @@ -30,13 +30,12 @@ class SubscriberList(View): template_name = 'templates/admin/subscriber/list.html' - __context = Context() - __subscriber = SubscriberModule() - __correlation_id = None @login_if_not_authenticated def get(self, request): + self.__context = Context() + self.__subscriber = SubscriberModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" self.__context.autoload_options() self.__context.autoload_user(request.user.id if request.user.is_authenticated else None) @@ -50,13 +49,12 @@ def get(self, request): class SubscriberAdd(View): template_name = 'templates/admin/subscriber/add.html' - __context = Context() - __subscriber = SubscriberModule() - __correlation_id = None @login_if_not_authenticated def get(self, request): + self.__context = Context() + self.__subscriber = SubscriberModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" self.__context.autoload_options() self.__context.autoload_user(request.user.id if request.user.is_authenticated else None) @@ -70,13 +68,12 @@ def get(self, request): class SubscriberEdit(View): template_name = 'templates/admin/subscriber/edit.html' - __context = Context() - __subscriber = SubscriberModule() - __correlation_id = None @login_if_not_authenticated def get(self, request, subscriber_id): + self.__context = Context() + self.__subscriber = SubscriberModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" subscriber = self.__subscriber.get_one_by_id(subscriber_id) diff --git a/app/controllers/web/admin/user.py b/app/controllers/web/admin/user.py index 7b093278..8b7ec943 100644 --- a/app/controllers/web/admin/user.py +++ b/app/controllers/web/admin/user.py @@ -30,13 +30,12 @@ class UserList(View): template_name = 'templates/admin/user/list.html' - __context = Context() - __user = UserModule() - __correlation_id = None @login_if_not_authenticated_or_no_permission("manage_settings") def get(self, request): + self.__context = Context() + self.__user = UserModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" self.__context.autoload_options() self.__context.autoload_user(request.user.id if request.user.is_authenticated else None) @@ -50,13 +49,12 @@ def get(self, request): class UserAdd(View): template_name = 'templates/admin/user/add.html' - __context = Context() - __user = UserModule() - __correlation_id = None @login_if_not_authenticated_or_no_permission("manage_settings") def get(self, request): + self.__context = Context() + self.__user = UserModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" self.__context.autoload_options() self.__context.autoload_user(request.user.id if request.user.is_authenticated else None) @@ -70,13 +68,12 @@ def get(self, request): class UserEdit(View): template_name = 'templates/admin/user/edit.html' - __context = Context() - __user = UserModule() - __correlation_id = None @login_if_not_authenticated_or_no_permission("manage_settings") def get(self, request, user_id): + self.__context = Context() + self.__user = UserModule() self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" user = self.__user.get_one_by_id(user_id) diff --git a/app/controllers/web/forgot_password.py b/app/controllers/web/forgot_password.py index 8967bd60..b3d90909 100644 --- a/app/controllers/web/forgot_password.py +++ b/app/controllers/web/forgot_password.py @@ -30,9 +30,6 @@ class ForgotPassword(View): template_name = 'templates/forgot_password.html' - __context = None - __option_entity = None - __correlation_id = None @redirect_if_not_installed @redirect_if_authenticated diff --git a/app/controllers/web/health_check.py b/app/controllers/web/health_check.py index a3beff99..d9e17fa0 100644 --- a/app/controllers/web/health_check.py +++ b/app/controllers/web/health_check.py @@ -25,12 +25,6 @@ class HealthCheck(View): - __response = None - __correlation_id = None - __health = None - __helpers = None - __logger = None - def get(self, request): self.__correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" diff --git a/app/controllers/web/history.py b/app/controllers/web/history.py index af233d93..2d32441e 100644 --- a/app/controllers/web/history.py +++ b/app/controllers/web/history.py @@ -28,11 +28,6 @@ class AtomHistory(View): - __context = None - __option_entity = None - __fg = None - __correlation_id = None - @redirect_if_not_installed def get(self, request): @@ -61,11 +56,6 @@ def get(self, request): class RssHistory(View): - __context = None - __option_entity = None - __fg = None - __correlation_id = None - @redirect_if_not_installed def get(self, request): diff --git a/app/controllers/web/install.py b/app/controllers/web/install.py index 91089571..45cff02f 100644 --- a/app/controllers/web/install.py +++ b/app/controllers/web/install.py @@ -30,10 +30,6 @@ class Install(View): template_name = 'templates/install.html' - __context = None - __install = None - __option_entity = None - __correlation_id = None def get(self, request): diff --git a/app/controllers/web/login.py b/app/controllers/web/login.py index c061e8dd..000b8f0b 100644 --- a/app/controllers/web/login.py +++ b/app/controllers/web/login.py @@ -31,9 +31,6 @@ class Login(View): template_name = 'templates/login.html' - __context = None - __option_entity = None - __correlation_id = None @redirect_if_not_installed @redirect_if_authenticated diff --git a/app/controllers/web/register.py b/app/controllers/web/register.py index 1269efa8..04e9ba9d 100644 --- a/app/controllers/web/register.py +++ b/app/controllers/web/register.py @@ -33,10 +33,6 @@ class Register(View): template_name = 'templates/register.html' - __user = None - __context = None - __option_entity = None - __correlation_id = None @redirect_if_not_installed @redirect_if_authenticated diff --git a/app/controllers/web/reset_password.py b/app/controllers/web/reset_password.py index 5ca53df3..30dbee5e 100644 --- a/app/controllers/web/reset_password.py +++ b/app/controllers/web/reset_password.py @@ -33,10 +33,6 @@ class ResetPassword(View): template_name = 'templates/reset_password.html' - __reset_password_core = None - __context = None - __option_entity = None - __correlation_id = None @redirect_if_not_installed @redirect_if_authenticated diff --git a/app/controllers/web/statistics.py b/app/controllers/web/statistics.py index 28d6844c..7e1a6b71 100644 --- a/app/controllers/web/statistics.py +++ b/app/controllers/web/statistics.py @@ -26,10 +26,6 @@ class Statistics(View): - __prometheus = None - __statistics = None - __correlation_id = None - @redirect_if_not_installed @protect_metric_with_auth_key def get(self, request, type): diff --git a/app/controllers/web/status_page.py b/app/controllers/web/status_page.py index 4e3a3399..f68aa223 100644 --- a/app/controllers/web/status_page.py +++ b/app/controllers/web/status_page.py @@ -30,10 +30,6 @@ class StatusPageIndex(View): template_name = 'templates/status_page_index.html' - __context = None - __option_entity = None - __status_page_module = None - __correlation_id = None @redirect_if_not_installed def get(self, request): @@ -62,10 +58,6 @@ def get(self, request): class StatusPageHistory(View): template_name = 'templates/status_page_history.html' - __context = None - __option_entity = None - __status_page_module = None - __correlation_id = None @redirect_if_not_installed def get(self, request, period): @@ -103,10 +95,6 @@ def get(self, request, period): class StatusPageSingle(View): template_name = 'templates/status_page_single.html' - __context = None - __option_entity = None - __status_page_module = None - __correlation_id = None @redirect_if_not_installed def get(self, request, uri): diff --git a/app/middleware/api_funnel.py b/app/middleware/api_funnel.py index 337c1c74..54d2f404 100644 --- a/app/middleware/api_funnel.py +++ b/app/middleware/api_funnel.py @@ -19,15 +19,11 @@ class APIFunnel(): - __helpers = None - __logger = None - __funnel = None - __roles = {} - def __init__(self, get_response): self.__helpers = Helpers() self.__funnel = Funnel() self.get_response = get_response + self.__roles = {} self.__logger = self.__helpers.get_logger(__name__) def __call__(self, request): diff --git a/app/middleware/correlation.py b/app/middleware/correlation.py index c92222b4..f37fb40a 100644 --- a/app/middleware/correlation.py +++ b/app/middleware/correlation.py @@ -18,8 +18,6 @@ class Correlation(): - __helpers = None - def __init__(self, get_response): self.__helpers = Helpers() self.get_response = get_response diff --git a/app/middleware/errors.py b/app/middleware/errors.py index a4d845d8..efff8db1 100644 --- a/app/middleware/errors.py +++ b/app/middleware/errors.py @@ -23,9 +23,6 @@ class Errors(): - __helpers = None - __logger = None - def __init__(self, get_response): self.__helpers = Helpers() self.get_response = get_response diff --git a/app/middleware/logging.py b/app/middleware/logging.py index fc5b73b7..ae749e3a 100644 --- a/app/middleware/logging.py +++ b/app/middleware/logging.py @@ -21,9 +21,6 @@ class Logging(): - __helpers = None - __logger = None - def __init__(self, get_response): self.__helpers = Helpers() self.get_response = get_response diff --git a/app/middleware/web_funnel.py b/app/middleware/web_funnel.py index a2ef930a..cd56d8c5 100644 --- a/app/middleware/web_funnel.py +++ b/app/middleware/web_funnel.py @@ -19,17 +19,11 @@ class WebFunnel(): - __helpers = None - __logger = None - __funnel = None - __roles = { - - } - def __init__(self, get_response): self.__helpers = Helpers() self.__funnel = Funnel() self.get_response = get_response + self.__roles = {} self.__logger = self.__helpers.get_logger(__name__) def __call__(self, request): diff --git a/app/modules/core/activity.py b/app/modules/core/activity.py index 6e70602b..2c92bf05 100644 --- a/app/modules/core/activity.py +++ b/app/modules/core/activity.py @@ -18,8 +18,6 @@ class Activity(): - __activity_entity = None - def __init__(self): self.__activity_entity = ActivityEntity() diff --git a/app/modules/core/component.py b/app/modules/core/component.py index 36a78328..7e0aae35 100644 --- a/app/modules/core/component.py +++ b/app/modules/core/component.py @@ -19,9 +19,6 @@ class Component(): - __component_group_entity = None - __component_entity = None - def __init__(self): self.__component_group_entity = ComponentGroupEntity() self.__component_entity = ComponentEntity() diff --git a/app/modules/core/component_group.py b/app/modules/core/component_group.py index c7ec283c..c0ffb248 100644 --- a/app/modules/core/component_group.py +++ b/app/modules/core/component_group.py @@ -19,9 +19,6 @@ class ComponentGroup(): - __component_group_entity = None - __component_entity = None - def __init__(self): self.__component_group_entity = ComponentGroupEntity() self.__component_entity = ComponentEntity() diff --git a/app/modules/core/context.py b/app/modules/core/context.py index f609b1da..2b5da4be 100644 --- a/app/modules/core/context.py +++ b/app/modules/core/context.py @@ -31,14 +31,11 @@ class Context(): - __data = {} - __option_entity = None - __user_entity = None - def __init__(self): self.__option_entity = OptionEntity() self.__user_entity = UserEntity() + self.__data = {} self.__data["AUTHOR"] = AUTHOR self.__data["COPYRIGHT"] = COPYRIGHT self.__data["LICENSE"] = LICENSE diff --git a/app/modules/core/dashboard.py b/app/modules/core/dashboard.py index 12102c81..7760115a 100644 --- a/app/modules/core/dashboard.py +++ b/app/modules/core/dashboard.py @@ -32,16 +32,6 @@ class Dashboard(): - __incident = None - __incident_update = None - __incident_update_component = None - __incident_update_notification = None - __subscriber = None - __user = None - __component = None - __component_group = None - __metric = None - def __init__(self): self.__incident = IncidentEntity() self.__incident_update = IncidentUpdateEntity() diff --git a/app/modules/core/forgot_password.py b/app/modules/core/forgot_password.py index 9d44afc4..411bcdcf 100644 --- a/app/modules/core/forgot_password.py +++ b/app/modules/core/forgot_password.py @@ -25,10 +25,6 @@ class ForgotPassword(): - __reset_request_entity = None - __option_entity = None - __user_entity = None - __task_core = None __reset_expire_option = 24 __messages_count_option = 5 diff --git a/app/modules/core/incident.py b/app/modules/core/incident.py index 4dc93501..7784673f 100644 --- a/app/modules/core/incident.py +++ b/app/modules/core/incident.py @@ -22,12 +22,6 @@ class Incident(): - __incident_update_entity = None - __incident_entity = None - __incident_update_component_entity = None - __incident_update_notification_entity = None - __helpers = None - def __init__(self): self.__incident_update_entity = IncidentUpdateEntity() self.__incident_entity = IncidentEntity() diff --git a/app/modules/core/incident_update.py b/app/modules/core/incident_update.py index b78ac71d..b7918322 100644 --- a/app/modules/core/incident_update.py +++ b/app/modules/core/incident_update.py @@ -19,9 +19,6 @@ class IncidentUpdate(): - __incident_update_entity = None - __incident_entity = None - def __init__(self): self.__incident_update_entity = IncidentUpdateEntity() self.__incident_entity = IncidentEntity() diff --git a/app/modules/core/incident_update_component.py b/app/modules/core/incident_update_component.py index d4cf7fca..8f0747c2 100644 --- a/app/modules/core/incident_update_component.py +++ b/app/modules/core/incident_update_component.py @@ -18,8 +18,6 @@ class IncidentUpdateComponent(): - __incident_update_component_entity = None - def __init__(self): self.__incident_update_component_entity = IncidentUpdateComponentEntity() diff --git a/app/modules/core/incident_update_notification.py b/app/modules/core/incident_update_notification.py index f07e16a9..d3597962 100644 --- a/app/modules/core/incident_update_notification.py +++ b/app/modules/core/incident_update_notification.py @@ -22,8 +22,6 @@ class IncidentUpdateNotification(): FAILED = "failed" SUCCESS = "success" - __incident_update_notification_entity = None - def __init__(self): self.__incident_update_notification_entity = IncidentUpdateNotificationEntity() diff --git a/app/modules/core/install.py b/app/modules/core/install.py index f2c42dc0..3255699e 100644 --- a/app/modules/core/install.py +++ b/app/modules/core/install.py @@ -41,9 +41,6 @@ class Install(): "is_active": True, "is_staff": False } - __option_entity = None - __user_entity = None - __acl = None def __init__(self): self.__option_entity = OptionEntity() diff --git a/app/modules/core/login.py b/app/modules/core/login.py index 5bd5930b..9d1603aa 100644 --- a/app/modules/core/login.py +++ b/app/modules/core/login.py @@ -23,9 +23,6 @@ class Login(): - __option_entity = None - __user_entity = None - def __init__(self): self.__option_entity = OptionEntity() self.__user_entity = UserEntity() diff --git a/app/modules/core/metric.py b/app/modules/core/metric.py index b4ffc0ca..a0946f0a 100644 --- a/app/modules/core/metric.py +++ b/app/modules/core/metric.py @@ -25,14 +25,11 @@ class Metric(): - __metric_entity = None - __option_entity = None - __newrelic = None - def __init__(self): self.__option_entity = OptionEntity() self.__metric_entity = MetricEntity() new_relic_api = self.__option_entity.get_one_by_key("newrelic_api_key") + self.__newrelic = None if new_relic_api: self.__newrelic = NewRelic_Provider(new_relic_api.value) diff --git a/app/modules/core/notification.py b/app/modules/core/notification.py index bfcf9249..80a1f4eb 100644 --- a/app/modules/core/notification.py +++ b/app/modules/core/notification.py @@ -26,11 +26,6 @@ class Notification(): ERROR = "error" MESSAGE = "message" - __notification_entity = None - __option_entity = None - __humanize = None - __app_name = None - def __init__(self): self.__notification_entity = NotificationEntity() self.__option_entity = OptionEntity() diff --git a/app/modules/core/profile.py b/app/modules/core/profile.py index c76f5738..8d9b3a2d 100644 --- a/app/modules/core/profile.py +++ b/app/modules/core/profile.py @@ -25,11 +25,6 @@ class Profile(): - __option_entity = None - __user_entity = None - __token = None - __profile_entity = None - def __init__(self): self.__option_entity = OptionEntity() self.__user_entity = UserEntity() diff --git a/app/modules/core/request.py b/app/modules/core/request.py index 22318868..c3d7052b 100644 --- a/app/modules/core/request.py +++ b/app/modules/core/request.py @@ -21,10 +21,6 @@ class Request(): - __request = None - __helpers = None - __logger = None - def __init__(self, request=None): self.__request = request self.__helpers = Helpers() diff --git a/app/modules/core/reset_password.py b/app/modules/core/reset_password.py index 5308aa88..60e62cb6 100644 --- a/app/modules/core/reset_password.py +++ b/app/modules/core/reset_password.py @@ -22,9 +22,6 @@ class ResetPassword(): - __reset_request_entity = None - __user_entity = None - def __init__(self): self.__user_entity = UserEntity() self.__reset_request_entity = ResetRequestEntity() diff --git a/app/modules/core/response.py b/app/modules/core/response.py index e71a8b11..7854b7ae 100644 --- a/app/modules/core/response.py +++ b/app/modules/core/response.py @@ -24,9 +24,6 @@ class Response(): - __helpers = None - __logger = None - def __init__(self): self.__helpers = Helpers() self.__logger = self.__helpers.get_logger(__name__) diff --git a/app/modules/core/settings.py b/app/modules/core/settings.py index ae720474..348e50e0 100644 --- a/app/modules/core/settings.py +++ b/app/modules/core/settings.py @@ -18,8 +18,6 @@ class Settings(): - __option_entity = None - def __init__(self): self.__option_entity = OptionEntity() diff --git a/app/modules/core/statistics.py b/app/modules/core/statistics.py index c2c8237c..3333e191 100644 --- a/app/modules/core/statistics.py +++ b/app/modules/core/statistics.py @@ -21,12 +21,6 @@ class Statistics(): - __option_entity = None - __user_entity = None - __task_entity = None - __profile_entity = None - __app_name = "" - def __init__(self): self.__option_entity = OptionEntity() self.__user_entity = UserEntity() diff --git a/app/modules/core/status_page.py b/app/modules/core/status_page.py index 853dd405..78a0255f 100644 --- a/app/modules/core/status_page.py +++ b/app/modules/core/status_page.py @@ -39,14 +39,6 @@ class StatusPage(): - __option_entity = None - __incident_entity = None - __incident_update_entity = None - __incident_update_component_entity = None - __component_group_entity = None - __component_entity = None - __metric_entity = None - def __init__(self): self.__option_entity = OptionEntity() self.__incident_entity = IncidentEntity() diff --git a/app/modules/core/subscriber.py b/app/modules/core/subscriber.py index ce84d07c..c6b1a009 100644 --- a/app/modules/core/subscriber.py +++ b/app/modules/core/subscriber.py @@ -25,8 +25,6 @@ class Subscriber(): PHONE = "phone" ENDPOINT = "endpoint" - __subscriber_entity = None - def __init__(self): self.__subscriber_entity = SubscriberEntity() diff --git a/app/modules/core/task.py b/app/modules/core/task.py index 8e16481c..ac2750f8 100644 --- a/app/modules/core/task.py +++ b/app/modules/core/task.py @@ -22,8 +22,6 @@ class Task(): - __task_entity = None - def __init__(self): self.__task_entity = TaskEntity() diff --git a/app/modules/core/user.py b/app/modules/core/user.py index 4b299aab..1e0d6fca 100644 --- a/app/modules/core/user.py +++ b/app/modules/core/user.py @@ -30,12 +30,6 @@ class User(): - __notification_entity = None - __option_entity = None - __user_entity = None - __acl = None - __register_request_entity = None - __task_core = None __register_expire_option = 24 def __init__(self): diff --git a/app/modules/service/prometheus.py b/app/modules/service/prometheus.py index 3a028a9f..e37eac48 100644 --- a/app/modules/service/prometheus.py +++ b/app/modules/service/prometheus.py @@ -15,8 +15,6 @@ class Prometheus(): - __metrics = [] - def __init__(self, metrics=[]): self.__metrics = metrics diff --git a/app/modules/util/crypto.py b/app/modules/util/crypto.py index 75bb931a..8e3967cb 100644 --- a/app/modules/util/crypto.py +++ b/app/modules/util/crypto.py @@ -25,8 +25,6 @@ class Crypto(): - __app_crypto_key = None - def __init__(self): load_dotenv(dotenv_path=os.path.join(APP_ROOT, ".env")) self.__app_crypto_key = os.getenv("APP_CRYPTO_KEY") diff --git a/app/modules/util/helpers.py b/app/modules/util/helpers.py index 31282461..c016375b 100644 --- a/app/modules/util/helpers.py +++ b/app/modules/util/helpers.py @@ -32,7 +32,8 @@ class Helpers(): - __loggers = {} + def __init__(self): + self.__loggers = {} def slugify(self, text, allow_unicode=False): return slugify(text, allow_unicode=allow_unicode) From 4234e0889fb0e2dd5a2eceaf4a4f6851f16de48d Mon Sep 17 00:00:00 2001 From: Clivern Date: Thu, 19 Sep 2019 19:23:58 +0200 Subject: [PATCH 12/15] Public controllers docstring --- app/controllers/web/admin/activity.py | 1 + app/controllers/web/admin/builder.py | 1 + app/controllers/web/admin/component.py | 3 +++ app/controllers/web/admin/component_group.py | 3 +++ app/controllers/web/admin/dashboard.py | 1 + app/controllers/web/admin/incident.py | 4 ++++ app/controllers/web/admin/incident_update.py | 3 +++ app/controllers/web/admin/logout.py | 1 + app/controllers/web/admin/metric.py | 3 +++ app/controllers/web/admin/notification.py | 1 + app/controllers/web/admin/profile.py | 1 + app/controllers/web/admin/settings.py | 1 + app/controllers/web/admin/subscriber.py | 3 +++ app/controllers/web/admin/user.py | 3 +++ app/controllers/web/error.py | 2 ++ app/controllers/web/forgot_password.py | 1 + app/controllers/web/health_check.py | 1 + app/controllers/web/history.py | 2 ++ app/controllers/web/install.py | 1 + app/controllers/web/login.py | 1 + app/controllers/web/not_found.py | 2 ++ app/controllers/web/register.py | 1 + app/controllers/web/reset_password.py | 1 + app/controllers/web/statistics.py | 1 + app/controllers/web/status_page.py | 3 +++ 25 files changed, 45 insertions(+) diff --git a/app/controllers/web/admin/activity.py b/app/controllers/web/admin/activity.py index 0fa8e4d3..897b9e8f 100644 --- a/app/controllers/web/admin/activity.py +++ b/app/controllers/web/admin/activity.py @@ -28,6 +28,7 @@ class Activity(View): + """Activity List Page Controller""" template_name = 'templates/admin/activity.html' diff --git a/app/controllers/web/admin/builder.py b/app/controllers/web/admin/builder.py index 5ce89f65..2feab2bb 100644 --- a/app/controllers/web/admin/builder.py +++ b/app/controllers/web/admin/builder.py @@ -30,6 +30,7 @@ class Builder(View): + """Builder Page Controller""" template_name = 'templates/admin/builder.html' diff --git a/app/controllers/web/admin/component.py b/app/controllers/web/admin/component.py index 85fb353d..18cdaace 100644 --- a/app/controllers/web/admin/component.py +++ b/app/controllers/web/admin/component.py @@ -28,6 +28,7 @@ class ComponentList(View): + """Component List Page Controller""" template_name = 'templates/admin/component/list.html' @@ -47,6 +48,7 @@ def get(self, request): class ComponentAdd(View): + """Component Add Page Controller""" template_name = 'templates/admin/component/add.html' @@ -67,6 +69,7 @@ def get(self, request): class ComponentEdit(View): + """Component Edit Page Controller""" template_name = 'templates/admin/component/edit.html' diff --git a/app/controllers/web/admin/component_group.py b/app/controllers/web/admin/component_group.py index b818cadf..3c765560 100644 --- a/app/controllers/web/admin/component_group.py +++ b/app/controllers/web/admin/component_group.py @@ -28,6 +28,7 @@ class ComponentGroupList(View): + """Component Group List Page Controller""" template_name = 'templates/admin/component_group/list.html' @@ -47,6 +48,7 @@ def get(self, request): class ComponentGroupAdd(View): + """Component Group Add Page Controller""" template_name = 'templates/admin/component_group/add.html' @@ -66,6 +68,7 @@ def get(self, request): class ComponentGroupEdit(View): + """Component Group Edit Page Controller""" template_name = 'templates/admin/component_group/edit.html' diff --git a/app/controllers/web/admin/dashboard.py b/app/controllers/web/admin/dashboard.py index e57dac0b..fe6aa3c0 100644 --- a/app/controllers/web/admin/dashboard.py +++ b/app/controllers/web/admin/dashboard.py @@ -27,6 +27,7 @@ class Dashboard(View): + """Dashboard Page Controller""" template_name = 'templates/admin/dashboard.html' diff --git a/app/controllers/web/admin/incident.py b/app/controllers/web/admin/incident.py index 666f9982..c345913c 100644 --- a/app/controllers/web/admin/incident.py +++ b/app/controllers/web/admin/incident.py @@ -31,6 +31,7 @@ class IncidentList(View): + """Incident List Page Controller""" template_name = 'templates/admin/incident/list.html' @@ -53,6 +54,7 @@ def get(self, request): class IncidentAdd(View): + """Incident Add Page Controller""" template_name = 'templates/admin/incident/add.html' @@ -75,6 +77,7 @@ def get(self, request): class IncidentEdit(View): + """Incident Edit Page Controller""" template_name = 'templates/admin/incident/edit.html' @@ -103,6 +106,7 @@ def get(self, request, incident_id): class IncidentView(View): + """Incident View Page Controller""" template_name = 'templates/admin/incident/view.html' diff --git a/app/controllers/web/admin/incident_update.py b/app/controllers/web/admin/incident_update.py index ef19d103..be6cd3e4 100644 --- a/app/controllers/web/admin/incident_update.py +++ b/app/controllers/web/admin/incident_update.py @@ -34,6 +34,7 @@ class IncidentUpdateAdd(View): + """Incident Update Add Page Controller""" template_name = 'templates/admin/incident/update/add.html' @@ -61,6 +62,7 @@ def get(self, request, incident_id): class IncidentUpdateView(View): + """Incident Update View Page Controller""" template_name = 'templates/admin/incident/update/view.html' @@ -137,6 +139,7 @@ def __format_affected_components(self, affected_components): class IncidentUpdateEdit(View): + """Incident Update Edit Page Controller""" template_name = 'templates/admin/incident/update/edit.html' diff --git a/app/controllers/web/admin/logout.py b/app/controllers/web/admin/logout.py index 3efcb0f3..617e1d52 100644 --- a/app/controllers/web/admin/logout.py +++ b/app/controllers/web/admin/logout.py @@ -24,6 +24,7 @@ class Logout(View): + """Logout Controller""" @login_if_not_authenticated def get(self, request): diff --git a/app/controllers/web/admin/metric.py b/app/controllers/web/admin/metric.py index fdc995c3..7cb6ebfd 100644 --- a/app/controllers/web/admin/metric.py +++ b/app/controllers/web/admin/metric.py @@ -29,6 +29,7 @@ class MetricList(View): + """Metric List Page Controller""" template_name = 'templates/admin/metric/list.html' @@ -48,6 +49,7 @@ def get(self, request): class MetricAdd(View): + """Metric Add Page Controller""" template_name = 'templates/admin/metric/add.html' @@ -66,6 +68,7 @@ def get(self, request): class MetricEdit(View): + """Metric Edit Page Controller""" template_name = 'templates/admin/metric/edit.html' diff --git a/app/controllers/web/admin/notification.py b/app/controllers/web/admin/notification.py index 53a6e985..2ce1c429 100644 --- a/app/controllers/web/admin/notification.py +++ b/app/controllers/web/admin/notification.py @@ -27,6 +27,7 @@ class Notification(View): + """Notification List Page Controller""" template_name = 'templates/admin/notification.html' diff --git a/app/controllers/web/admin/profile.py b/app/controllers/web/admin/profile.py index 15532417..de928fa8 100644 --- a/app/controllers/web/admin/profile.py +++ b/app/controllers/web/admin/profile.py @@ -27,6 +27,7 @@ class Profile(View): + """Profile Page Controller""" template_name = 'templates/admin/profile.html' diff --git a/app/controllers/web/admin/settings.py b/app/controllers/web/admin/settings.py index b5c0d67a..6b94c58d 100644 --- a/app/controllers/web/admin/settings.py +++ b/app/controllers/web/admin/settings.py @@ -28,6 +28,7 @@ class Settings(View): + """Settings Page Controller""" template_name = 'templates/admin/settings.html' diff --git a/app/controllers/web/admin/subscriber.py b/app/controllers/web/admin/subscriber.py index b6d180e0..6a246b4f 100644 --- a/app/controllers/web/admin/subscriber.py +++ b/app/controllers/web/admin/subscriber.py @@ -28,6 +28,7 @@ class SubscriberList(View): + """Subscriber List Page Controller""" template_name = 'templates/admin/subscriber/list.html' @@ -47,6 +48,7 @@ def get(self, request): class SubscriberAdd(View): + """Subscriber Add Page Controller""" template_name = 'templates/admin/subscriber/add.html' @@ -66,6 +68,7 @@ def get(self, request): class SubscriberEdit(View): + """Subscriber Edit Page Controller""" template_name = 'templates/admin/subscriber/edit.html' diff --git a/app/controllers/web/admin/user.py b/app/controllers/web/admin/user.py index 8b7ec943..b4341696 100644 --- a/app/controllers/web/admin/user.py +++ b/app/controllers/web/admin/user.py @@ -28,6 +28,7 @@ class UserList(View): + """User List Page Controller""" template_name = 'templates/admin/user/list.html' @@ -47,6 +48,7 @@ def get(self, request): class UserAdd(View): + """User Add Page Controller""" template_name = 'templates/admin/user/add.html' @@ -66,6 +68,7 @@ def get(self, request): class UserEdit(View): + """User Edit Page Controller""" template_name = 'templates/admin/user/edit.html' diff --git a/app/controllers/web/error.py b/app/controllers/web/error.py index 07ffd241..5ccc2d68 100644 --- a/app/controllers/web/error.py +++ b/app/controllers/web/error.py @@ -25,6 +25,8 @@ def handler500(request, exception=None, template_name='templates/500.html'): + """500 Error Page Controller""" + correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" helpers = Helpers() logger = helpers.get_logger(__name__) diff --git a/app/controllers/web/forgot_password.py b/app/controllers/web/forgot_password.py index b3d90909..67396de0 100644 --- a/app/controllers/web/forgot_password.py +++ b/app/controllers/web/forgot_password.py @@ -28,6 +28,7 @@ class ForgotPassword(View): + """Forgot Password Page Controller""" template_name = 'templates/forgot_password.html' diff --git a/app/controllers/web/health_check.py b/app/controllers/web/health_check.py index d9e17fa0..809d1319 100644 --- a/app/controllers/web/health_check.py +++ b/app/controllers/web/health_check.py @@ -24,6 +24,7 @@ class HealthCheck(View): + """Health Check Page Controller""" def get(self, request): diff --git a/app/controllers/web/history.py b/app/controllers/web/history.py index 2d32441e..0173cdeb 100644 --- a/app/controllers/web/history.py +++ b/app/controllers/web/history.py @@ -27,6 +27,7 @@ class AtomHistory(View): + """Atom History Page Controller""" @redirect_if_not_installed def get(self, request): @@ -55,6 +56,7 @@ def get(self, request): class RssHistory(View): + """RSS History Page Controller""" @redirect_if_not_installed def get(self, request): diff --git a/app/controllers/web/install.py b/app/controllers/web/install.py index 45cff02f..5ce1702c 100644 --- a/app/controllers/web/install.py +++ b/app/controllers/web/install.py @@ -28,6 +28,7 @@ class Install(View): + """Install Page Controller""" template_name = 'templates/install.html' diff --git a/app/controllers/web/login.py b/app/controllers/web/login.py index 000b8f0b..16480c15 100644 --- a/app/controllers/web/login.py +++ b/app/controllers/web/login.py @@ -29,6 +29,7 @@ class Login(View): + """Login Page Controller""" template_name = 'templates/login.html' diff --git a/app/controllers/web/not_found.py b/app/controllers/web/not_found.py index 4071bf64..95517bed 100644 --- a/app/controllers/web/not_found.py +++ b/app/controllers/web/not_found.py @@ -25,6 +25,8 @@ def handler404(request, exception=None, template_name='templates/404.html'): + """404 Error Page Controller""" + correlation_id = request.META["X-Correlation-ID"] if "X-Correlation-ID" in request.META else "" helpers = Helpers() logger = helpers.get_logger(__name__) diff --git a/app/controllers/web/register.py b/app/controllers/web/register.py index 04e9ba9d..014a3241 100644 --- a/app/controllers/web/register.py +++ b/app/controllers/web/register.py @@ -31,6 +31,7 @@ class Register(View): + """Register Page Controller""" template_name = 'templates/register.html' diff --git a/app/controllers/web/reset_password.py b/app/controllers/web/reset_password.py index 30dbee5e..94a3abc0 100644 --- a/app/controllers/web/reset_password.py +++ b/app/controllers/web/reset_password.py @@ -31,6 +31,7 @@ class ResetPassword(View): + """Reset Password Page Controller""" template_name = 'templates/reset_password.html' diff --git a/app/controllers/web/statistics.py b/app/controllers/web/statistics.py index 7e1a6b71..b0a48f65 100644 --- a/app/controllers/web/statistics.py +++ b/app/controllers/web/statistics.py @@ -25,6 +25,7 @@ class Statistics(View): + """Statistics Page Controller""" @redirect_if_not_installed @protect_metric_with_auth_key diff --git a/app/controllers/web/status_page.py b/app/controllers/web/status_page.py index f68aa223..8a8fd075 100644 --- a/app/controllers/web/status_page.py +++ b/app/controllers/web/status_page.py @@ -28,6 +28,7 @@ class StatusPageIndex(View): + """Status Page Index Page Controller""" template_name = 'templates/status_page_index.html' @@ -56,6 +57,7 @@ def get(self, request): class StatusPageHistory(View): + """Status Page History Page Controller""" template_name = 'templates/status_page_history.html' @@ -93,6 +95,7 @@ def get(self, request, period): class StatusPageSingle(View): + """Status Page Single Page Controller""" template_name = 'templates/status_page_single.html' From c1232bc0f892f6904bd8ef1c85abd4fb6b84771d Mon Sep 17 00:00:00 2001 From: Clivern Date: Thu, 19 Sep 2019 20:44:04 +0200 Subject: [PATCH 13/15] add component & group name validation --- .../api/private/v1/admin/component.py | 35 ++++++++++++++++--- .../api/private/v1/admin/component_group.py | 16 +++++++-- app/modules/core/component.py | 15 ++++++++ app/modules/core/component_group.py | 13 +++++++ app/modules/entity/component_entity.py | 7 ++++ app/modules/entity/component_group_entity.py | 7 ++++ 6 files changed, 87 insertions(+), 6 deletions(-) diff --git a/app/controllers/api/private/v1/admin/component.py b/app/controllers/api/private/v1/admin/component.py index ee806df5..7578ca1b 100644 --- a/app/controllers/api/private/v1/admin/component.py +++ b/app/controllers/api/private/v1/admin/component.py @@ -26,6 +26,7 @@ from app.modules.validation.extension import ExtraRules from app.modules.core.decorators import allow_if_authenticated from app.modules.core.component import Component as ComponentModule +from app.modules.core.component_group import ComponentGroup as ComponentGroupModule class Components(View): @@ -37,6 +38,7 @@ def __init__(self): self.__helpers = Helpers() self.__form = Form() self.__component = ComponentModule() + self.__component_group = ComponentGroupModule() self.__logger = self.__helpers.get_logger(__name__) self.__form.add_validator(ExtraRules()) self.__user_id = None @@ -110,8 +112,19 @@ def post(self, request): if not self.__form.is_passed(): return JsonResponse(self.__response.send_errors_failure(self.__form.get_errors(), {}, self.__correlation_id)) - # @TODO Validate if name not used before - # @TODO Validate group id is valid + # Check if component name not used + if self.__component.get_one_by_name(self.__form.get_sinput("name")): + return JsonResponse(self.__response.send_private_failure([{ + "type": "error", + "message": _("Error! Component name is used before.") + }], {}, self.__correlation_id)) + + # Check if group id is valid + if self.__form.get_sinput("group") and not self.__component_group.get_one_by_id(self.__form.get_sinput("group")): + return JsonResponse(self.__response.send_private_failure([{ + "type": "error", + "message": _("Error! Component group is invalid.") + }], {}, self.__correlation_id)) result = self.__component.insert_one({ "name": self.__form.get_sinput("name"), @@ -185,6 +198,7 @@ def __init__(self): self.__helpers = Helpers() self.__form = Form() self.__component = ComponentModule() + self.__component_group = ComponentGroupModule() self.__logger = self.__helpers.get_logger(__name__) self.__form.add_validator(ExtraRules()) self.__user_id = None @@ -258,8 +272,21 @@ def post(self, request, component_id): if not self.__form.is_passed(): return JsonResponse(self.__response.send_errors_failure(self.__form.get_errors(), {}, self.__correlation_id)) - # @TODO Validate if name not used before - # @TODO Validate group id is valid + # Check if component name not used elsewhere + current_component = self.__component.get_one_by_name(self.__form.get_sinput("name")) + + if current_component and not current_component["id"] == component_id: + return JsonResponse(self.__response.send_private_failure([{ + "type": "error", + "message": _("Error! Component name is used before.") + }], {}, self.__correlation_id)) + + # Check if group id is valid + if self.__form.get_sinput("group") and not self.__component_group.get_one_by_id(self.__form.get_sinput("group")): + return JsonResponse(self.__response.send_private_failure([{ + "type": "error", + "message": _("Error! Component group is invalid.") + }], {}, self.__correlation_id)) result = self.__component.update_one_by_id(component_id, { "name": self.__form.get_sinput("name"), diff --git a/app/controllers/api/private/v1/admin/component_group.py b/app/controllers/api/private/v1/admin/component_group.py index a622331e..6537451c 100644 --- a/app/controllers/api/private/v1/admin/component_group.py +++ b/app/controllers/api/private/v1/admin/component_group.py @@ -96,7 +96,12 @@ def post(self, request): if not self.__form.is_passed(): return JsonResponse(self.__response.send_errors_failure(self.__form.get_errors(), {}, self.__correlation_id)) - # @TODO Validate if name not used before + # Check if group name not used + if self.__component_group.get_one_by_name(self.__form.get_sinput("name")): + return JsonResponse(self.__response.send_private_failure([{ + "type": "error", + "message": _("Error! Component group name is used before.") + }], {}, self.__correlation_id)) result = self.__component_group.insert_one({ "name": self.__form.get_sinput("name"), @@ -227,7 +232,14 @@ def post(self, request, group_id): if not self.__form.is_passed(): return JsonResponse(self.__response.send_errors_failure(self.__form.get_errors(), {}, self.__correlation_id)) - # @TODO Validate if name not used before + # Check if group name not used elsewhere + current_group = self.__component_group.get_one_by_name(self.__form.get_sinput("name")) + + if current_group and not current_group["id"] == group_id: + return JsonResponse(self.__response.send_private_failure([{ + "type": "error", + "message": _("Error! Component group name is used before.") + }], {}, self.__correlation_id)) result = self.__component_group.update_one_by_id(group_id, { "name": self.__form.get_sinput("name"), diff --git a/app/modules/core/component.py b/app/modules/core/component.py index 7e0aae35..df66e5ee 100644 --- a/app/modules/core/component.py +++ b/app/modules/core/component.py @@ -38,6 +38,21 @@ def get_one_by_id(self, id): "group_name": "" if component.group is None else component.group.name } + def get_one_by_name(self, name): + component = self.__component_entity.get_one_by_name(name) + + if not component: + return False + + return { + "id": component.id, + "name": component.name, + "description": component.description, + "uptime": component.uptime, + "group_id": "" if component.group is None else component.group.id, + "group_name": "" if component.group is None else component.group.name + } + def insert_one(self, component): return self.__component_entity.insert_one(component) diff --git a/app/modules/core/component_group.py b/app/modules/core/component_group.py index c0ffb248..cffce77f 100644 --- a/app/modules/core/component_group.py +++ b/app/modules/core/component_group.py @@ -36,6 +36,19 @@ def get_one_by_id(self, id): "description": group.description, } + def get_one_by_name(self, name): + group = self.__component_group_entity.get_one_by_name(name) + + if not group: + return False + + return { + "id": group.id, + "name": group.name, + "uptime": group.uptime, + "description": group.description, + } + def insert_one(self, group): return self.__component_group_entity.insert_one(group) diff --git a/app/modules/entity/component_entity.py b/app/modules/entity/component_entity.py index 63735c91..94bc6fe3 100644 --- a/app/modules/entity/component_entity.py +++ b/app/modules/entity/component_entity.py @@ -65,6 +65,13 @@ def get_one_by_id(self, component_id): except Exception: return False + def get_one_by_name(self, name): + try: + component = Component.objects.get(name=name) + return False if component.pk is None else component + except Exception: + return False + def delete_one_by_id(self, id): component = self.get_one_by_id(id) if component is not False: diff --git a/app/modules/entity/component_group_entity.py b/app/modules/entity/component_group_entity.py index 3f45da89..69ccacc8 100644 --- a/app/modules/entity/component_group_entity.py +++ b/app/modules/entity/component_group_entity.py @@ -58,6 +58,13 @@ def get_one_by_id(self, group_id): except Exception: return False + def get_one_by_name(self, name): + try: + group = ComponentGroup.objects.get(name=name) + return False if group.pk is None else group + except Exception: + return False + def delete_one_by_id(self, id): group = self.get_one_by_id(id) if group is not False: From 996ec066b3a94bc8d9643bf5769414a2859da8d9 Mon Sep 17 00:00:00 2001 From: Clivern Date: Fri, 20 Sep 2019 20:01:23 +0200 Subject: [PATCH 14/15] Fix metric validation --- .../api/private/v1/admin/metric.py | 118 ++++++++++++++---- app/modules/core/metric.py | 16 +++ app/modules/entity/metric_entity.py | 7 ++ 3 files changed, 117 insertions(+), 24 deletions(-) diff --git a/app/controllers/api/private/v1/admin/metric.py b/app/controllers/api/private/v1/admin/metric.py index 042b456b..0b3655d3 100644 --- a/app/controllers/api/private/v1/admin/metric.py +++ b/app/controllers/api/private/v1/admin/metric.py @@ -59,24 +59,36 @@ def post(self, request): }) self.__form.add_inputs({ - # @TODO add validate filter 'title': { 'value': request_data["title"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'length_between': { + 'param': [1, 60], + 'error': _('Error! Metric title must be 1 to 60 characters long.') + } + } }, - # @TODO add validate filter 'description': { 'value': request_data["description"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'length_between': { + 'param': [0, 150], + 'error': _('Error! Metric description must be less than 150 characters long.') + }, + 'optional': {} + } }, 'source': { 'value': request_data["source"], + 'sanitize': { + 'strip': {} + }, 'validate': { 'any_of': { 'param': [["newrelic"]], @@ -84,37 +96,53 @@ def post(self, request): } } }, - # @TODO add validate filter 'application': { 'value': request_data["application"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'length_between': { + 'param': [1, 60], + 'error': _('Error! Application must be 1 to 60 characters long.') + } + } }, - # @TODO add validate filter 'metric': { 'value': request_data["metric"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'length_between': { + 'param': [1, 60], + 'error': _('Error! Metric must be 1 to 60 characters long.') + } + } }, - # @TODO add validate filter 'x_axis': { 'value': request_data["x_axis"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'length_between': { + 'param': [1, 40], + 'error': _('Error! X-Axis label must be 1 to 40 characters long.') + } + } }, - # @TODO add validate filter 'y_axis': { 'value': request_data["y_axis"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'length_between': { + 'param': [1, 40], + 'error': _('Error! Y-Axis label must be 1 to 40 characters long.') + } + } } }) @@ -123,6 +151,12 @@ def post(self, request): if not self.__form.is_passed(): return JsonResponse(self.__response.send_errors_failure(self.__form.get_errors(), {}, self.__correlation_id)) + if self.__metric.get_one_by_title(self.__form.get_sinput("title")): + return JsonResponse(self.__response.send_private_failure([{ + "type": "error", + "message": _("Error! Metric title is used before.") + }], {}, self.__correlation_id)) + result = self.__metric.insert_one({ "title": self.__form.get_sinput("title"), "description": self.__form.get_sinput("description"), @@ -220,24 +254,36 @@ def post(self, request, metric_id): }) self.__form.add_inputs({ - # @TODO add validate filter 'title': { 'value': request_data["title"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'length_between': { + 'param': [1, 60], + 'error': _('Error! Metric title must be 1 to 60 characters long.') + } + } }, - # @TODO add validate filter 'description': { 'value': request_data["description"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'length_between': { + 'param': [0, 150], + 'error': _('Error! Metric description must be less than 150 characters long.') + }, + 'optional': {} + } }, 'source': { 'value': request_data["source"], + 'sanitize': { + 'strip': {} + }, 'validate': { 'any_of': { 'param': [["newrelic"]], @@ -245,37 +291,53 @@ def post(self, request, metric_id): } } }, - # @TODO add validate filter 'application': { 'value': request_data["application"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'length_between': { + 'param': [1, 60], + 'error': _('Error! Application must be 1 to 60 characters long.') + } + } }, - # @TODO add validate filter 'metric': { 'value': request_data["metric"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'length_between': { + 'param': [1, 60], + 'error': _('Error! Metric must be 1 to 60 characters long.') + } + } }, - # @TODO add validate filter 'x_axis': { 'value': request_data["x_axis"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'length_between': { + 'param': [1, 40], + 'error': _('Error! X-Axis label must be 1 to 40 characters long.') + } + } }, - # @TODO add validate filter 'y_axis': { 'value': request_data["y_axis"], 'sanitize': { 'strip': {} }, - 'validate': {} + 'validate': { + 'length_between': { + 'param': [1, 40], + 'error': _('Error! Y-Axis label must be 1 to 40 characters long.') + } + } } }) @@ -284,6 +346,14 @@ def post(self, request, metric_id): if not self.__form.is_passed(): return JsonResponse(self.__response.send_errors_failure(self.__form.get_errors(), {}, self.__correlation_id)) + current_metric = self.__metric.get_one_by_title(self.__form.get_sinput("title")) + + if current_metric and not current_metric["id"] == metric_id: + return JsonResponse(self.__response.send_private_failure([{ + "type": "error", + "message": _("Error! Metric title is used before.") + }], {}, self.__correlation_id)) + result = self.__metric.update_one_by_id(metric_id, { "title": self.__form.get_sinput("title"), "description": self.__form.get_sinput("description"), diff --git a/app/modules/core/metric.py b/app/modules/core/metric.py index a0946f0a..9a010a48 100644 --- a/app/modules/core/metric.py +++ b/app/modules/core/metric.py @@ -49,6 +49,22 @@ def get_one_by_id(self, id): "y_axis": metric.y_axis } + def get_one_by_title(self, title): + metric = self.__metric_entity.get_one_by_title(title) + + if not metric: + return False + + return { + "id": metric.id, + "title": metric.title, + "description": metric.description, + "source": metric.source, + "data": metric.data, + "x_axis": metric.x_axis, + "y_axis": metric.y_axis + } + def insert_one(self, metric): return self.__metric_entity.insert_one(metric) diff --git a/app/modules/entity/metric_entity.py b/app/modules/entity/metric_entity.py index 604b4aad..238da094 100644 --- a/app/modules/entity/metric_entity.py +++ b/app/modules/entity/metric_entity.py @@ -85,6 +85,13 @@ def get_one_by_id(self, metric_id): except Exception: return False + def get_one_by_title(self, title): + try: + metric = Metric.objects.get(title=title) + return False if metric.pk is None else metric + except Exception: + return False + def delete_one_by_id(self, id): metric = self.get_one_by_id(id) if metric is not False: From bac8da9eef1f0583d2c8f18ef2ee31741e43d091 Mon Sep 17 00:00:00 2001 From: Clivern Date: Fri, 20 Sep 2019 20:50:44 +0200 Subject: [PATCH 15/15] test login page --- .../functional/controllers/web/test_login.py | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 app/tests/functional/controllers/web/test_login.py diff --git a/app/tests/functional/controllers/web/test_login.py b/app/tests/functional/controllers/web/test_login.py new file mode 100644 index 00000000..b7095560 --- /dev/null +++ b/app/tests/functional/controllers/web/test_login.py @@ -0,0 +1,43 @@ +# Copyright 2019 Silverbackhq +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Third Party Library +from django.test import TestCase +from django.shortcuts import reverse + +# Local Library +from app.tests.testing_base import TestingBase + + +class TestLogin(TestCase): + + def setUp(self): + tb = TestingBase() + tb.uninstall() + tb.install({ + "app_name": "Silverback", + "app_email": "hello@silverback.com", + "app_url": "http://silverback.com", + "admin_username": "admin", + "admin_email": "admin@silverback.com", + "admin_password": "$h12345678H$" + }) + + def tearDown(self): + tb = TestingBase() + tb.uninstall() + + def test_get(self): + response = self.client.get(reverse("app.web.login")) + self.assertEqual(response.status_code, 200)