From 35a7ff0eb73ea57ae5cc08c5a8bcc1291a839e47 Mon Sep 17 00:00:00 2001 From: Valentijn Scholten Date: Mon, 26 May 2025 20:49:35 +0200 Subject: [PATCH] remove google sheets leftovers --- .../archived_docs/google-sheets-sync.md | 2 +- .../commands/initialize_permissions.py | 12 +- dojo/user/utils.py | 8 - tests/base_test_class.py | 6 - ...nfigTestApi.test_config_google_sheets.yaml | 254 ------------------ 5 files changed, 2 insertions(+), 280 deletions(-) delete mode 100644 unittests/vcr/google_sheets/GoogleSheetsConfigTestApi.test_config_google_sheets.yaml diff --git a/docs/content/en/open_source/archived_docs/google-sheets-sync.md b/docs/content/en/open_source/archived_docs/google-sheets-sync.md index 7ce89ab5b9f..8af6772e17d 100644 --- a/docs/content/en/open_source/archived_docs/google-sheets-sync.md +++ b/docs/content/en/open_source/archived_docs/google-sheets-sync.md @@ -6,7 +6,7 @@ weight: 8 exclude_search: true --- -**Please note - the Google Sheets feature has been deprecated as of DefectDojo version 2.21.0 - these documents are for reference only.** +**Please note - the Google Sheets feature has been removed in DefectDojo version 2.21.0 - these documents are for reference only.** With the Google Sheets sync feature, DefectDojo allow the users to export all the finding details of each test into a separate Google diff --git a/dojo/management/commands/initialize_permissions.py b/dojo/management/commands/initialize_permissions.py index 33f067e31fa..6fa022c0873 100644 --- a/dojo/management/commands/initialize_permissions.py +++ b/dojo/management/commands/initialize_permissions.py @@ -1,6 +1,5 @@ import logging -from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType from django.core.management.base import BaseCommand @@ -15,16 +14,7 @@ class Command(BaseCommand): def handle(self, *args, **options): try: - content_type_system_settings = ContentType.objects.get(app_label="dojo", model="system_settings") - google_permission = Permission.objects.filter(content_type=content_type_system_settings, - codename="change_google_sheet").count() - if google_permission == 0: - Permission.objects.create( - name="Can change Google Sheet", - content_type=content_type_system_settings, - codename="change_google_sheet", - ) - + # nothing left here after google sheets removal logger.info("Non-standard permissions have been created") except ContentType.DoesNotExist: logger.warning("No content type found for dojo.system_settings") diff --git a/dojo/user/utils.py b/dojo/user/utils.py index 2ba2cbc1d0f..e80a314c48b 100644 --- a/dojo/user/utils.py +++ b/dojo/user/utils.py @@ -67,13 +67,6 @@ def get_configuration_permissions_fields(): else: github_permissions = [] - if get_system_setting("enable_google_sheets"): - google_sheet_permissions = [ - Permission_Helper(name="google sheet", app="dojo", change=True), - ] - else: - google_sheet_permissions = [] - if get_system_setting("enable_jira"): jira_permissions = [ Permission_Helper(name="jira instance", app="dojo", view=True, add=True, change=True, delete=True), @@ -95,7 +88,6 @@ def get_configuration_permissions_fields(): Permission_Helper(name="development environment", app="dojo", add=True, change=True, delete=True), Permission_Helper(name="finding template", app="dojo", view=True, add=True, change=True, delete=True), *github_permissions, - *google_sheet_permissions, Permission_Helper(name="group", app="auth", view=True, add=True), *jira_permissions, Permission_Helper(name="language type", app="dojo", view=True, add=True, change=True, delete=True), diff --git a/tests/base_test_class.py b/tests/base_test_class.py index 2024f4c2323..56134cb84c9 100644 --- a/tests/base_test_class.py +++ b/tests/base_test_class.py @@ -210,12 +210,6 @@ def goto_component_overview(self, driver): driver.get(self.base_url + "components") return driver - def goto_google_sheets_configuration_form(self, driver): - # if something is terribly wrong, it may still fail, even if system_settings is disabled. - # See https://github.com/DefectDojo/django-DefectDojo/issues/3742 for reference. - driver.get(self.base_url + "configure_google_sheets") - return driver - def goto_active_engagements_overview(self, driver): driver.get(self.base_url + "engagement/active") return driver diff --git a/unittests/vcr/google_sheets/GoogleSheetsConfigTestApi.test_config_google_sheets.yaml b/unittests/vcr/google_sheets/GoogleSheetsConfigTestApi.test_config_google_sheets.yaml deleted file mode 100644 index 75253ac96d4..00000000000 --- a/unittests/vcr/google_sheets/GoogleSheetsConfigTestApi.test_config_google_sheets.yaml +++ /dev/null @@ -1,254 +0,0 @@ -interactions: -- request: - body: assertion=eyJ0eXAiOiAiSldUIiwgImFsZyI6ICJSUzI1NiIsICJraWQiOiAiYWIyZmUxMWMzMmI1NzJjNWNlNzJmMGNhNDMyZDgwODlmYTg1YTUwNyJ9.eyJpYXQiOiAxNjEyNzMyOTA2LCAiZXhwIjogMTYxMjczNjUwNiwgImlzcyI6ICJ0ZXN0LWRvam8tc2hlZXRzQHRlc3QtZG9qby1zaGVldHMuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCAiYXVkIjogImh0dHBzOi8vb2F1dGgyLmdvb2dsZWFwaXMuY29tL3Rva2VuIiwgInNjb3BlIjogImh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL2F1dGgvZHJpdmUgaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vYXV0aC9zcHJlYWRzaGVldHMifQ.PRgJJujIf5UIjaJg7JuiJ1K70Q95MMfC3kklfaezmEjGLhEHCB6yjrqO3Y54ZZm3afHi80KtEsgTlKFi1rHWDeNRI8saih7KrmdbuJA89xJdLv2NW6F7VitW3Suv3ACOr8SujBjhj_oU_lsbTnIYbc59QGXIV1O3pjYKdZ2sLrw3MAmn9HfstrSkYOvyQYbTnG0yBZQft5jZrPqubo07IU6AWt6Tm9e2lgAJq2YNDCG0TdK_nEgsoK6tbr02ThpaBFIsv0AV_vNc-DBpYMis5399FGsSwnw0R0ZNdkpQRXEdwelv8V-_P88bdaYykt9yA1y62IoxoiNZxDq2EYCTIg&grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer - headers: - accept-encoding: - - gzip, deflate - content-type: - - application/x-www-form-urlencoded - user-agent: - - Python-httplib2/0.19.0 (gzip) - method: POST - uri: https://oauth2.googleapis.com/token - response: - body: - string: !!binary | - H4sIAAAAAAAC/x3P226CMAAA0H/ps5qsXKR74xIUMAwQEPZCCinjtlJLEWTZv8/s/MH5AbiqyDQV - YuwJBe/giSE6VAePyYYWknIInatXMnErnVFBkMj6FvcyVMxqKDR28sx5RndX0Di3dBxnt1RdcdY0 - KVncRSkCVAdUMulxjk/pLIWV3q37vX9p/ToK3U+qwk2kY27lsjr4UhWxh/CU4v5QjMC0Rs7sUfve - 1OU54LfGT1BnukeuSZlN6mu7nCUB/QRj51JHXd/5UQIbr75/cDPTk7me0KX8is44sm3Z5SGlORQj - 2AGyspaTqWhfW0lBaAf+64V4MvL6GwRzwsHvHxw4OXcZAQAA - headers: - Alt-Svc: - - h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; - ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43" - Cache-Control: - - private - Content-Encoding: - - gzip - Content-Type: - - application/json; charset=UTF-8 - Date: - - Sun, 07 Feb 2021 21:21:46 GMT - Server: - - scaffolding on HTTPServer2 - Transfer-Encoding: - - chunked - Vary: - - Origin - - X-Origin - - Referer - X-Content-Type-Options: - - nosniff - X-Frame-Options: - - SAMEORIGIN - X-XSS-Protection: - - '0' - status: - code: 200 - message: OK -- request: - body: '{"properties": {"title": "Test spreadsheet"}}' - headers: - accept: - - application/json - accept-encoding: - - gzip, deflate - authorization: - - Bearer ya29.c.Kp4B8QeblQISKbptWbIo592e4AzTk425Ccl_8pGKCuu9qJtnTYDAaTXWV6xaXhhVewJw5_P9fPn3Cn7uTGVu3QcAjx--NLiNfRQJZn62ztVoYDY46lN3cRpvtK5_qv5BPCDorpFo8mz6wyla1hNU9jCJ7r83XFefSiwH3t2NUaaILfRjkjNRU2hKfqOrCXAUufs9LbgRHaRFF4JrQnnY2to - content-length: - - '45' - content-type: - - application/json - user-agent: - - (gzip) - x-goog-api-client: - - gdcl/1.12.8 gl-python/3.6.12 - method: POST - uri: https://sheets.googleapis.com/v4/spreadsheets?fields=spreadsheetId&alt=json - response: - body: - string: !!binary | - H4sIAAAAAAAC/6vmUlBQKi4oSk1MKc5ITS3xTFGyUlAyjPLyNLPwL4qsCvGszDZPzIww9YoMKE8L - NfHI0Q0qyA7KCjX3DE2PKolPTVfiquUCAABktQVGAAAA - headers: - Alt-Svc: - - h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; - ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43" - Cache-Control: - - private - Content-Encoding: - - gzip - Content-Type: - - application/json; charset=UTF-8 - Date: - - Sun, 07 Feb 2021 21:21:47 GMT - Server: - - ESF - Transfer-Encoding: - - chunked - Vary: - - Origin - - X-Origin - - Referer - X-Frame-Options: - - SAMEORIGIN - X-XSS-Protection: - - '0' - status: - code: 200 - message: OK -- request: - body: null - headers: - accept: - - application/json - accept-encoding: - - gzip, deflate - authorization: - - Bearer ya29.c.Kp4B8QeblQISKbptWbIo592e4AzTk425Ccl_8pGKCuu9qJtnTYDAaTXWV6xaXhhVewJw5_P9fPn3Cn7uTGVu3QcAjx--NLiNfRQJZn62ztVoYDY46lN3cRpvtK5_qv5BPCDorpFo8mz6wyla1hNU9jCJ7r83XFefSiwH3t2NUaaILfRjkjNRU2hKfqOrCXAUufs9LbgRHaRFF4JrQnnY2to - content-length: - - '0' - user-agent: - - (gzip) - x-goog-api-client: - - gdcl/1.12.8 gl-python/3.6.12 - method: GET - uri: https://www.googleapis.com/drive/v3/files/1ZJI68OrYzTIyk7aiX5JYPwfU4Hl-RpkRjU7IUgZt_eg?fields=parents&alt=json - response: - body: - string: !!binary | - H4sIAAAAAAAAAKvmUlAqSCxKzSspVrJSiOZSUFAycPQoN8mpLAzMyjArDM22DAhzVOJSiOWq5QIA - hsITdi0AAAA= - headers: - Alt-Svc: - - h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; - ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43" - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Content-Encoding: - - gzip - Content-Security-Policy: - - frame-ancestors 'self' - Content-Type: - - application/json; charset=UTF-8 - Date: - - Sun, 07 Feb 2021 21:21:48 GMT - Expires: - - Mon, 01 Jan 1990 00:00:00 GMT - Pragma: - - no-cache - Server: - - GSE - Transfer-Encoding: - - chunked - Vary: - - Origin - - X-Origin - X-Content-Type-Options: - - nosniff - X-Frame-Options: - - SAMEORIGIN - X-XSS-Protection: - - 1; mode=block - status: - code: 200 - message: OK -- request: - body: null - headers: - accept: - - application/json - accept-encoding: - - gzip, deflate - authorization: - - Bearer ya29.c.Kp4B8QeblQISKbptWbIo592e4AzTk425Ccl_8pGKCuu9qJtnTYDAaTXWV6xaXhhVewJw5_P9fPn3Cn7uTGVu3QcAjx--NLiNfRQJZn62ztVoYDY46lN3cRpvtK5_qv5BPCDorpFo8mz6wyla1hNU9jCJ7r83XFefSiwH3t2NUaaILfRjkjNRU2hKfqOrCXAUufs9LbgRHaRFF4JrQnnY2to - content-length: - - '0' - user-agent: - - (gzip) - x-goog-api-client: - - gdcl/1.12.8 gl-python/3.6.12 - method: PATCH - uri: https://www.googleapis.com/drive/v3/files/1ZJI68OrYzTIyk7aiX5JYPwfU4Hl-RpkRjU7IUgZt_eg?addParents=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&removeParents=0AHw4lyqQjh6qUk9PVA&fields=id%2C+parents&alt=json - response: - body: - string: !!binary | - H4sIAAAAAAAAAKvmUlDKTFGyUlAyjPLyNLPwL4qsCvGszDZPzIww9YoMKE8LNfHI0Q0qyA7KCjX3 - DE2PKolPTVfSAWorSCxKzSspBuqN5lIA6g+zyKowy0iKCCkM9DZJ9zLN8yw1DwtzCS4zy/DKKwkL - V+JSiOWq5QIASmbU5XIAAAA= - headers: - Alt-Svc: - - h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; - ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43" - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Content-Encoding: - - gzip - Content-Security-Policy: - - frame-ancestors 'self' - Content-Type: - - application/json; charset=UTF-8 - Date: - - Sun, 07 Feb 2021 21:21:49 GMT - Expires: - - Mon, 01 Jan 1990 00:00:00 GMT - Pragma: - - no-cache - Server: - - GSE - Transfer-Encoding: - - chunked - Vary: - - Origin - - X-Origin - X-Content-Type-Options: - - nosniff - X-Frame-Options: - - SAMEORIGIN - X-XSS-Protection: - - 1; mode=block - status: - code: 200 - message: OK -- request: - body: null - headers: - accept: - - '*/*' - accept-encoding: - - gzip, deflate - authorization: - - Bearer ya29.c.Kp4B8QeblQISKbptWbIo592e4AzTk425Ccl_8pGKCuu9qJtnTYDAaTXWV6xaXhhVewJw5_P9fPn3Cn7uTGVu3QcAjx--NLiNfRQJZn62ztVoYDY46lN3cRpvtK5_qv5BPCDorpFo8mz6wyla1hNU9jCJ7r83XFefSiwH3t2NUaaILfRjkjNRU2hKfqOrCXAUufs9LbgRHaRFF4JrQnnY2to - content-length: - - '0' - user-agent: - - (gzip) - x-goog-api-client: - - gdcl/1.12.8 gl-python/3.6.12 - method: DELETE - uri: https://www.googleapis.com/drive/v3/files/1ZJI68OrYzTIyk7aiX5JYPwfU4Hl-RpkRjU7IUgZt_eg - response: - body: - string: '' - headers: - Alt-Svc: - - h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; - ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43" - Cache-Control: - - no-cache, no-store, max-age=0, must-revalidate - Date: - - Sun, 07 Feb 2021 21:21:49 GMT - Expires: - - Mon, 01 Jan 1990 00:00:00 GMT - Pragma: - - no-cache - Server: - - GSE - Vary: - - Origin - - X-Origin - status: - code: 204 - message: No Content -version: 1