diff --git a/src/sentry/backup/comparators.py b/src/sentry/backup/comparators.py index 432df23ab956f1..92bff97f1bd277 100644 --- a/src/sentry/backup/comparators.py +++ b/src/sentry/backup/comparators.py @@ -666,9 +666,7 @@ def get_default_comparators(): default_comparators: ComparatorMap = defaultdict( list, { - "sentry.apitoken": [ - HashObfuscatingComparator("refresh_token", "token", "token_last_characters") - ], + "sentry.apitoken": [HashObfuscatingComparator("refresh_token", "token")], "sentry.apiapplication": [HashObfuscatingComparator("client_id", "client_secret")], "sentry.authidentity": [HashObfuscatingComparator("ident", "token")], "sentry.alertrule": [DateUpdatedComparator("date_modified")], diff --git a/src/sentry/models/apitoken.py b/src/sentry/models/apitoken.py index 2c323dd771bef4..9dd343d4874e5b 100644 --- a/src/sentry/models/apitoken.py +++ b/src/sentry/models/apitoken.py @@ -2,12 +2,13 @@ import secrets from datetime import timedelta -from typing import ClassVar, Collection, Optional, Tuple +from typing import Any, ClassVar, Collection, Optional, Tuple from django.db import models, router, transaction from django.utils import timezone from django.utils.encoding import force_str +from sentry import options from sentry.backup.dependencies import ImportKind from sentry.backup.helpers import ImportFlags from sentry.backup.scopes import ImportScope, RelocationScope @@ -57,15 +58,12 @@ class Meta: def __str__(self): return force_str(self.token) - # TODO(mdtro): uncomment this function after 0583_apitoken_add_name_and_last_chars migration has been applied - # def save(self, *args: Any, **kwargs: Any) -> None: - # # when a new ApiToken is created we take the last four characters of the token - # # and save them in the `token_last_characters` field so users can identify - # # tokens in the UI where they're mostly obfuscated - # token_last_characters = self.token[-4:] - # self.token_last_characters = token_last_characters + def save(self, *args: Any, **kwargs: Any) -> None: + if options.get("apitoken.auto-add-last-chars"): + token_last_characters = self.token[-4:] + self.token_last_characters = token_last_characters - # return super().save(**kwargs) + return super().save(**kwargs) def outbox_region_names(self) -> Collection[str]: return list(find_all_region_names()) diff --git a/src/sentry/options/defaults.py b/src/sentry/options/defaults.py index 9a5587dbdc0a79..9580d8ba5737e6 100644 --- a/src/sentry/options/defaults.py +++ b/src/sentry/options/defaults.py @@ -263,6 +263,13 @@ flags=FLAG_ALLOW_EMPTY | FLAG_PRIORITIZE_DISK | FLAG_REQUIRED, ) +# API Tokens +register( + "apitoken.auto-add-last-chars", + default=True, + type=Bool, + flags=FLAG_ALLOW_EMPTY | FLAG_PRIORITIZE_DISK | FLAG_AUTOMATOR_MODIFIABLE, +) register( "api.rate-limit.org-create", diff --git a/tests/sentry/backup/snapshots/ReleaseTests/test_at_head.pysnap b/tests/sentry/backup/snapshots/ReleaseTests/test_at_head.pysnap index 910da0fa5f2db1..af9b14513da7bb 100644 --- a/tests/sentry/backup/snapshots/ReleaseTests/test_at_head.pysnap +++ b/tests/sentry/backup/snapshots/ReleaseTests/test_at_head.pysnap @@ -1,18 +1,18 @@ --- -created: '2023-11-10T11:44:08.687106Z' +created: '2023-11-15T22:32:21.442670Z' creator: sentry source: tests/sentry/backup/test_releases.py --- - fields: key: bar - last_updated: '2023-11-10T11:44:08.265Z' + last_updated: '2023-11-15T22:32:21.141Z' last_updated_by: unknown value: '"b"' model: sentry.controloption pk: 6 - fields: - date_added: '2023-11-10T11:44:07.833Z' - date_updated: '2023-11-10T11:44:07.833Z' + date_added: '2023-11-15T22:32:20.645Z' + date_updated: '2023-11-15T22:32:20.646Z' external_id: slack:test-org metadata: {} name: Slack for test-org @@ -22,13 +22,13 @@ source: tests/sentry/backup/test_releases.py pk: 6 - fields: key: foo - last_updated: '2023-11-10T11:44:08.264Z' + last_updated: '2023-11-15T22:32:21.140Z' last_updated_by: unknown value: '"a"' model: sentry.option pk: 6 - fields: - date_added: '2023-11-10T11:44:07.611Z' + date_added: '2023-11-15T22:32:20.347Z' default_role: member flags: '1' is_test: false @@ -36,92 +36,92 @@ source: tests/sentry/backup/test_releases.py slug: test-org status: 0 model: sentry.organization - pk: 4552949431205904 + pk: 4552980291649552 - fields: - date_added: '2023-11-10T11:44:07.976Z' + date_added: '2023-11-15T22:32:20.836Z' default_role: member flags: '1' is_test: false - name: Unbiased Woodcock - slug: unbiased-woodcock + name: Aware Dolphin + slug: aware-dolphin status: 0 model: sentry.organization - pk: 4552949431205908 + pk: 4552980291649556 - fields: config: hello: hello - date_added: '2023-11-10T11:44:07.834Z' - date_updated: '2023-11-10T11:44:07.834Z' + date_added: '2023-11-15T22:32:20.647Z' + date_updated: '2023-11-15T22:32:20.647Z' default_auth_id: null grace_period_end: null integration: 6 - organization_id: 4552949431205904 + organization_id: 4552980291649552 status: 0 model: sentry.organizationintegration pk: 6 - fields: key: sentry:account-rate-limit - organization: 4552949431205904 + organization: 4552980291649552 value: 0 model: sentry.organizationoption pk: 6 - fields: - date_added: '2023-11-10T11:44:07.738Z' + date_added: '2023-11-15T22:32:20.488Z' first_event: null flags: '10' forced_color: null name: project-test-org - organization: 4552949431205904 + organization: 4552980291649552 platform: null public: false slug: project-test-org status: 0 model: sentry.project - pk: 4552949431205906 + pk: 4552980291649554 - fields: - date_added: '2023-11-10T11:44:07.861Z' + date_added: '2023-11-15T22:32:20.673Z' first_event: null flags: '10' forced_color: null name: other-project-test-org - organization: 4552949431205904 + organization: 4552980291649552 platform: null public: false slug: other-project-test-org status: 0 model: sentry.project - pk: 4552949431205907 + pk: 4552980291649555 - fields: - date_added: '2023-11-10T11:44:08.032Z' + date_added: '2023-11-15T22:32:20.897Z' first_event: null flags: '10' forced_color: null - name: Engaging Woodcock - organization: 4552949431205904 + name: Chief Trout + organization: 4552980291649552 platform: null public: false - slug: engaging-woodcock + slug: chief-trout status: 0 model: sentry.project - pk: 4552949431271440 + pk: 4552980291649557 - fields: - date_added: '2023-11-10T11:44:08.221Z' + date_added: '2023-11-15T22:32:21.094Z' first_event: null flags: '10' forced_color: null - name: Amazed Albacore - organization: 4552949431205904 + name: Saved Leopard + organization: 4552980291649552 platform: null public: false - slug: amazed-albacore + slug: saved-leopard status: 0 model: sentry.project - pk: 4552949431271441 + pk: 4552980291715088 - fields: config: hello: hello integration_id: 6 - project: 4552949431205906 + project: 4552980291649554 model: sentry.projectintegration pk: 6 - fields: @@ -129,14 +129,14 @@ source: tests/sentry/backup/test_releases.py dynamicSdkLoaderOptions: hasPerformance: true hasReplay: true - date_added: '2023-11-10T11:44:07.752Z' + date_added: '2023-11-15T22:32:20.504Z' label: Default - project: 4552949431205906 - public_key: acb24d1975908c2b417b30b9a428403a + project: 4552980291649554 + public_key: 6f7a092fcb34db896df7282204af0799 rate_limit_count: null rate_limit_window: null roles: '1' - secret_key: b735e5ef3499cd83a586bd8811cd0859 + secret_key: 8757b145c120990475bbbdb21be3e66a status: 0 model: sentry.projectkey pk: 21 @@ -145,14 +145,14 @@ source: tests/sentry/backup/test_releases.py dynamicSdkLoaderOptions: hasPerformance: true hasReplay: true - date_added: '2023-11-10T11:44:07.875Z' + date_added: '2023-11-15T22:32:20.693Z' label: Default - project: 4552949431205907 - public_key: 517998b7a9ad683e164cc726418e6235 + project: 4552980291649555 + public_key: 8313a71c77b700b7534095abe6f2014a rate_limit_count: null rate_limit_window: null roles: '1' - secret_key: 47f596cea4b5bbb20aa850be4934f8c2 + secret_key: 8a4604b90c32e56a53fa39f58a34c0bc status: 0 model: sentry.projectkey pk: 22 @@ -161,14 +161,14 @@ source: tests/sentry/backup/test_releases.py dynamicSdkLoaderOptions: hasPerformance: true hasReplay: true - date_added: '2023-11-10T11:44:08.049Z' + date_added: '2023-11-15T22:32:20.914Z' label: Default - project: 4552949431271440 - public_key: a8ee9d0b5a2a5bafd2ea355d67de058d + project: 4552980291649557 + public_key: fd15b01a3b96e5ed058756382b38f8c3 rate_limit_count: null rate_limit_window: null roles: '1' - secret_key: 141a9127178f8c823846d44400ea751a + secret_key: 78ce5129eb94d127c6b0cd5996486738 status: 0 model: sentry.projectkey pk: 23 @@ -177,97 +177,97 @@ source: tests/sentry/backup/test_releases.py dynamicSdkLoaderOptions: hasPerformance: true hasReplay: true - date_added: '2023-11-10T11:44:08.238Z' + date_added: '2023-11-15T22:32:21.110Z' label: Default - project: 4552949431271441 - public_key: 54148b7ae26a14feb044a31a2a92b393 + project: 4552980291715088 + public_key: d609cb8f90d04eca2c7ea5b525bf0413 rate_limit_count: null rate_limit_window: null roles: '1' - secret_key: 2ef1935d978fecb672adb95406a8b16e + secret_key: c9a44b60560a82e128e0e903b601447d status: 0 model: sentry.projectkey pk: 24 - fields: key: sentry:relay-rev - project: 4552949431205906 - value: '"ecf8023b446e46b58266c9a233dae5a0"' + project: 4552980291649554 + value: '"ee3d4558e5db4f88aac4bb744b8f8310"' model: sentry.projectoption pk: 61 - fields: key: sentry:relay-rev-lastchange - project: 4552949431205906 - value: '"2023-11-10T11:44:07.756470Z"' + project: 4552980291649554 + value: '"2023-11-15T22:32:20.509019Z"' model: sentry.projectoption pk: 62 - fields: key: sentry:option-epoch - project: 4552949431205906 + project: 4552980291649554 value: 11 model: sentry.projectoption pk: 63 - fields: key: sentry:relay-rev - project: 4552949431205907 - value: '"b2645092e7984424a36853308b9c6013"' + project: 4552980291649555 + value: '"84ae06a2c7fa4499bf512f2634b5fd6d"' model: sentry.projectoption pk: 64 - fields: key: sentry:relay-rev-lastchange - project: 4552949431205907 - value: '"2023-11-10T11:44:07.879597Z"' + project: 4552980291649555 + value: '"2023-11-15T22:32:20.698969Z"' model: sentry.projectoption pk: 65 - fields: key: sentry:option-epoch - project: 4552949431205907 + project: 4552980291649555 value: 11 model: sentry.projectoption pk: 66 - fields: key: sentry:relay-rev - project: 4552949431271440 - value: '"d60e27c9a5be421182ea638d569ff730"' + project: 4552980291649557 + value: '"8a75642dddec4710af6bfe6dbb044a3c"' model: sentry.projectoption pk: 67 - fields: key: sentry:relay-rev-lastchange - project: 4552949431271440 - value: '"2023-11-10T11:44:08.053688Z"' + project: 4552980291649557 + value: '"2023-11-15T22:32:20.917761Z"' model: sentry.projectoption pk: 68 - fields: key: sentry:option-epoch - project: 4552949431271440 + project: 4552980291649557 value: 11 model: sentry.projectoption pk: 69 - fields: key: sentry:relay-rev - project: 4552949431271441 - value: '"62dbe4dd34ef492cbebcfd8427054fcb"' + project: 4552980291715088 + value: '"638a3ccb9d7042969b12e68a94bf1b37"' model: sentry.projectoption pk: 70 - fields: key: sentry:relay-rev-lastchange - project: 4552949431271441 - value: '"2023-11-10T11:44:08.242163Z"' + project: 4552980291715088 + value: '"2023-11-15T22:32:21.113867Z"' model: sentry.projectoption pk: 71 - fields: key: sentry:option-epoch - project: 4552949431271441 + project: 4552980291715088 value: 11 model: sentry.projectoption pk: 72 - fields: auto_assignment: true codeowners_auto_sync: true - date_created: '2023-11-10T11:44:07.769Z' + date_created: '2023-11-15T22:32:20.526Z' fallthrough: true is_active: true - last_updated: '2023-11-10T11:44:07.769Z' - project: 4552949431205906 + last_updated: '2023-11-15T22:32:20.526Z' + project: 4552980291649554 raw: '{"hello":"hello"}' schema: hello: hello @@ -275,9 +275,9 @@ source: tests/sentry/backup/test_releases.py model: sentry.projectownership pk: 6 - fields: - date_added: '2023-11-10T11:44:07.772Z' - organization: 4552949431205904 - project: 4552949431205906 + date_added: '2023-11-15T22:32:20.531Z' + organization: 4552980291649552 + project: 4552980291649554 redirect_slug: project_slug_in_test-org model: sentry.projectredirect pk: 6 @@ -285,26 +285,26 @@ source: tests/sentry/backup/test_releases.py first_seen: null is_internal: true last_seen: null - public_key: 8WuGtLFvXJ9qNQ5bdxyE_sbKvFzfT9oyNVmERb_Fqp0 - relay_id: fcffed14-3da2-4627-be7b-8c4e166b5fbb + public_key: B8-ccOfOEqsN_kfksdHESdoiBcLK_MtEk-eNZwNFSmE + relay_id: 8efe8117-ae1e-4a9e-a7cf-fc62676bf94e model: sentry.relay pk: 6 - fields: - first_seen: '2023-11-10T11:44:08.263Z' - last_seen: '2023-11-10T11:44:08.263Z' - public_key: 8WuGtLFvXJ9qNQ5bdxyE_sbKvFzfT9oyNVmERb_Fqp0 - relay_id: fcffed14-3da2-4627-be7b-8c4e166b5fbb + first_seen: '2023-11-15T22:32:21.139Z' + last_seen: '2023-11-15T22:32:21.139Z' + public_key: B8-ccOfOEqsN_kfksdHESdoiBcLK_MtEk-eNZwNFSmE + relay_id: 8efe8117-ae1e-4a9e-a7cf-fc62676bf94e version: 0.0.1 model: sentry.relayusage pk: 6 - fields: config: {} - date_added: '2023-11-10T11:44:07.952Z' + date_added: '2023-11-15T22:32:20.810Z' external_id: null integration_id: 6 languages: '[]' name: getsentry/getsentry - organization_id: 4552949431205904 + organization_id: 4552980291649552 provider: integrations:github status: 0 url: https://github.com/getsentry/getsentry @@ -312,19 +312,19 @@ source: tests/sentry/backup/test_releases.py pk: 6 - fields: actor: 6 - date_added: '2023-11-10T11:44:07.695Z' + date_added: '2023-11-15T22:32:20.443Z' idp_provisioned: false name: test_team_in_test-org org_role: null - organization: 4552949431205904 + organization: 4552980291649552 slug: test_team_in_test-org status: 0 model: sentry.team - pk: 4552949431205905 + pk: 4552980291649553 - fields: avatar_type: 0 avatar_url: null - date_joined: '2023-11-10T11:44:07.466Z' + date_joined: '2023-11-15T22:32:20.211Z' email: owner flags: '0' is_active: true @@ -334,11 +334,11 @@ source: tests/sentry/backup/test_releases.py is_staff: true is_superuser: true is_unclaimed: false - last_active: '2023-11-10T11:44:07.466Z' + last_active: '2023-11-15T22:32:20.211Z' last_login: null - last_password_change: '2023-11-10T11:44:07.466Z' + last_password_change: '2023-11-15T22:32:20.211Z' name: '' - password: md5$8mWTITJG0pa6wN65VjaqUg$5ea04bc0b6c41389b285bf9d22894beb + password: md5$A530NO0y6sCd8Ic0L0o8ez$9ef501dfa8ddbad1ef9f7087af4176fb session_nonce: null username: owner model: sentry.user @@ -346,7 +346,7 @@ source: tests/sentry/backup/test_releases.py - fields: avatar_type: 0 avatar_url: null - date_joined: '2023-11-10T11:44:07.565Z' + date_joined: '2023-11-15T22:32:20.311Z' email: invitee flags: '0' is_active: true @@ -356,11 +356,11 @@ source: tests/sentry/backup/test_releases.py is_staff: false is_superuser: false is_unclaimed: false - last_active: '2023-11-10T11:44:07.565Z' + last_active: '2023-11-15T22:32:20.311Z' last_login: null - last_password_change: '2023-11-10T11:44:07.565Z' + last_password_change: '2023-11-15T22:32:20.311Z' name: '' - password: md5$MotNV3tiw9BGoA6nDCINQz$bc64da97c260e497279ba7f42ff8eb6b + password: md5$phEsdsBm2OZr1PxLrNfZdP$98a934101ef2acc8bc46bfd0f8b03393 session_nonce: null username: invitee model: sentry.user @@ -368,7 +368,7 @@ source: tests/sentry/backup/test_releases.py - fields: avatar_type: 0 avatar_url: null - date_joined: '2023-11-10T11:44:07.903Z' + date_joined: '2023-11-15T22:32:20.733Z' email: admin@localhost flags: '0' is_active: true @@ -378,11 +378,11 @@ source: tests/sentry/backup/test_releases.py is_staff: true is_superuser: true is_unclaimed: false - last_active: '2023-11-10T11:44:07.903Z' + last_active: '2023-11-15T22:32:20.733Z' last_login: null - last_password_change: '2023-11-10T11:44:07.903Z' + last_password_change: '2023-11-15T22:32:20.734Z' name: '' - password: md5$O1qA3EdR3WNvNa6K7I98Gr$1b865e6159aad2e9e80d42d58d6e12a5 + password: md5$xK5SXH6Qvt1Zx6depY04Hd$46d3713f1b1e30073e25bf040ace79d0 session_nonce: null username: admin@localhost model: sentry.user @@ -390,8 +390,8 @@ source: tests/sentry/backup/test_releases.py - fields: avatar_type: 0 avatar_url: null - date_joined: '2023-11-10T11:44:07.953Z' - email: 0c797f56590f4ff99a86b920b4baaea3@example.com + date_joined: '2023-11-15T22:32:20.812Z' + email: 78010d98140841648f1a2d1b4a709699@example.com flags: '0' is_active: true is_managed: false @@ -400,19 +400,19 @@ source: tests/sentry/backup/test_releases.py is_staff: true is_superuser: false is_unclaimed: false - last_active: '2023-11-10T11:44:07.953Z' + last_active: '2023-11-15T22:32:20.812Z' last_login: null - last_password_change: '2023-11-10T11:44:07.954Z' + last_password_change: '2023-11-15T22:32:20.812Z' name: '' - password: md5$Cm6pDIq5Xsm0oNe2vRW1bt$cef5f141109330d1d56a05e5e60494ce + password: md5$gBygL9dbt2rtEa0nkmwcIz$249fbf75b4281f2add1316aaae5b30be session_nonce: null - username: 0c797f56590f4ff99a86b920b4baaea3@example.com + username: 78010d98140841648f1a2d1b4a709699@example.com model: sentry.user pk: 34 - fields: avatar_type: 0 avatar_url: null - date_joined: '2023-11-10T11:44:08.008Z' + date_joined: '2023-11-15T22:32:20.871Z' email: '' flags: '0' is_active: true @@ -422,20 +422,20 @@ source: tests/sentry/backup/test_releases.py is_staff: false is_superuser: false is_unclaimed: false - last_active: '2023-11-10T11:44:08.008Z' + last_active: '2023-11-15T22:32:20.871Z' last_login: null last_password_change: null name: '' password: '' session_nonce: null - username: test-app-cd4f2013-3ea0-4b9c-96d7-5421a864e617 + username: test-app-74b44ab2-6d62-4c68-a26f-f858c4e8fad5 model: sentry.user pk: 35 - fields: avatar_type: 0 avatar_url: null - date_joined: '2023-11-10T11:44:08.200Z' - email: c2799776b72a48a19b1c6abfa33d9994@example.com + date_joined: '2023-11-15T22:32:21.071Z' + email: 1e3b38e01d14459cbbd85012c62d7b53@example.com flags: '0' is_active: true is_managed: false @@ -444,13 +444,13 @@ source: tests/sentry/backup/test_releases.py is_staff: true is_superuser: false is_unclaimed: false - last_active: '2023-11-10T11:44:08.200Z' + last_active: '2023-11-15T22:32:21.071Z' last_login: null - last_password_change: '2023-11-10T11:44:08.201Z' + last_password_change: '2023-11-15T22:32:21.071Z' name: '' - password: md5$2SlADsXm48yF42Fy5R44xH$3ca589adf87b681743a2bc6c52a179bf + password: md5$NyJci9RVeL5bNDeN3QW8xe$3d85bc33e64c023e934039cab33b54b9 session_nonce: null - username: c2799776b72a48a19b1c6abfa33d9994@example.com + username: 1e3b38e01d14459cbbd85012c62d7b53@example.com model: sentry.user pk: 36 - fields: @@ -493,24 +493,24 @@ source: tests/sentry/backup/test_releases.py model: sentry.userpermission pk: 6 - fields: - date_added: '2023-11-10T11:44:07.520Z' - date_updated: '2023-11-10T11:44:07.520Z' + date_added: '2023-11-15T22:32:20.273Z' + date_updated: '2023-11-15T22:32:20.273Z' name: test-admin-role permissions: '[]' model: sentry.userrole pk: 6 - fields: - date_added: '2023-11-10T11:44:07.524Z' - date_updated: '2023-11-10T11:44:07.524Z' + date_added: '2023-11-15T22:32:20.277Z' + date_updated: '2023-11-15T22:32:20.277Z' role: 6 user: 31 model: sentry.userroleuser pk: 6 - fields: - date_added: '2023-11-10T11:44:07.947Z' + date_added: '2023-11-15T22:32:20.805Z' is_global: false name: Saved query for test-org - organization: 4552949431205904 + organization: 4552980291649552 owner_id: null query: saved query for test-org sort: date @@ -519,9 +519,9 @@ source: tests/sentry/backup/test_releases.py model: sentry.savedsearch pk: 6 - fields: - date_added: '2023-11-10T11:44:07.946Z' - last_seen: '2023-11-10T11:44:07.946Z' - organization: 4552949431205904 + date_added: '2023-11-15T22:32:20.804Z' + last_seen: '2023-11-15T22:32:20.804Z' + organization: 4552980291649552 query: some query for test-org query_hash: 7c69362cd42207b83f80087bc15ebccb type: 0 @@ -529,42 +529,42 @@ source: tests/sentry/backup/test_releases.py model: sentry.recentsearch pk: 6 - fields: - project: 4552949431205906 - team: 4552949431205905 + project: 4552980291649554 + team: 4552980291649553 model: sentry.projectteam pk: 11 - fields: - project: 4552949431205907 - team: 4552949431205905 + project: 4552980291649555 + team: 4552980291649553 model: sentry.projectteam pk: 12 - fields: - date_added: '2023-11-10T11:44:07.768Z' - project: 4552949431205906 + date_added: '2023-11-15T22:32:20.524Z' + project: 4552980291649554 user_id: 31 model: sentry.projectbookmark pk: 6 - fields: created_by: null - date_added: '2023-11-10T11:44:07.821Z' + date_added: '2023-11-15T22:32:20.626Z' date_deactivated: null date_last_used: null name: token 1 for test-org - organization_id: 4552949431205904 - project_last_used_id: 4552949431205906 + organization_id: 4552980291649552 + project_last_used_id: 4552980291649554 scope_list: '[''org:ci'']' token_hashed: ABCDEFtest-org token_last_characters: xyz1 model: sentry.orgauthtoken pk: 6 - fields: - date_added: '2023-11-10T11:44:07.643Z' + date_added: '2023-11-15T22:32:20.381Z' email: null flags: '0' has_global_access: true invite_status: 0 inviter_id: null - organization: 4552949431205904 + organization: 4552980291649552 role: owner token: null token_expires_at: null @@ -575,13 +575,13 @@ source: tests/sentry/backup/test_releases.py model: sentry.organizationmember pk: 11 - fields: - date_added: '2023-11-10T11:44:07.668Z' + date_added: '2023-11-15T22:32:20.407Z' email: null flags: '0' has_global_access: true invite_status: 0 inviter_id: null - organization: 4552949431205904 + organization: 4552980291649552 role: member token: null token_expires_at: null @@ -594,105 +594,104 @@ source: tests/sentry/backup/test_releases.py - fields: member: 12 requester_id: null - team: 4552949431205905 + team: 4552980291649553 model: sentry.organizationaccessrequest pk: 6 - fields: config: schedule: '* * * * *' schedule_type: 1 - date_added: '2023-11-10T11:44:07.858Z' - guid: 12c8c2a0-d28c-413b-9475-c1a2021c4234 + date_added: '2023-11-15T22:32:20.668Z' + guid: 5ca5880c-8f2e-40ab-a19d-be18f37d9f9e name: '' - organization_id: 4552949431205904 - project_id: 4552949431205906 - slug: 985a8be628f8 + organization_id: 4552980291649552 + project_id: 4552980291649554 + slug: 08fd9d95a228 status: 0 type: 3 model: sentry.monitor pk: 6 - fields: - date_added: '2023-11-10T11:44:07.856Z' - name: apparently possible walrus - organization_id: 4552949431205904 + date_added: '2023-11-15T22:32:20.664Z' + name: painfully crucial lacewing + organization_id: 4552980291649552 model: sentry.environment pk: 6 - fields: - date_added: '2023-11-10T11:44:07.471Z' + date_added: '2023-11-15T22:32:20.216Z' email: owner model: sentry.email pk: 43 - fields: - date_added: '2023-11-10T11:44:07.569Z' + date_added: '2023-11-15T22:32:20.314Z' email: invitee model: sentry.email pk: 44 - fields: - date_added: '2023-11-10T11:44:07.906Z' + date_added: '2023-11-15T22:32:20.738Z' email: admin@localhost model: sentry.email pk: 45 - fields: - date_added: '2023-11-10T11:44:07.957Z' - email: 0c797f56590f4ff99a86b920b4baaea3@example.com + date_added: '2023-11-15T22:32:20.816Z' + email: 78010d98140841648f1a2d1b4a709699@example.com model: sentry.email pk: 46 - fields: - date_added: '2023-11-10T11:44:08.011Z' + date_added: '2023-11-15T22:32:20.875Z' email: '' model: sentry.email pk: 47 - fields: - date_added: '2023-11-10T11:44:08.204Z' - email: c2799776b72a48a19b1c6abfa33d9994@example.com + date_added: '2023-11-15T22:32:21.074Z' + email: 1e3b38e01d14459cbbd85012c62d7b53@example.com model: sentry.email pk: 48 - fields: - date_added: '2023-11-10T11:44:07.945Z' - organization: 4552949431205904 + date_added: '2023-11-15T22:32:20.803Z' + organization: 4552980291649552 slug: test-tombstone-in-test-org model: sentry.dashboardtombstone pk: 6 - fields: created_by_id: 31 - date_added: '2023-11-10T11:44:07.942Z' + date_added: '2023-11-15T22:32:20.799Z' filters: null - last_visited: '2023-11-10T11:44:07.942Z' - organization: 4552949431205904 + last_visited: '2023-11-15T22:32:20.799Z' + organization: 4552980291649552 title: Dashboard 1 for test-org visits: 1 model: sentry.dashboard pk: 6 - fields: condition: '{"op":"equals","name":"environment","value":"prod"}' - condition_hash: 446f9403d95bd9f51d18be47287659d9c3669663 + condition_hash: 90dcce273a6f3e0a9568531c92d7f4193e8934a9 created_by_id: null - date_added: '2023-11-10T11:44:07.850Z' - end_date: '2023-11-10T12:44:07.849Z' + date_added: '2023-11-15T22:32:20.658Z' + end_date: '2023-11-15T23:32:20.656Z' is_active: true is_org_level: false - notification_sent: false num_samples: 100 - organization: 4552949431205904 + organization: 4552980291649552 query: environment:prod event.type:transaction rule_id: 1 sample_rate: 0.5 - start_date: '2023-11-10T11:44:07.849Z' + start_date: '2023-11-15T22:32:20.656Z' model: sentry.customdynamicsamplingrule pk: 4 - fields: - project: 4552949431205906 + project: 4552980291649554 value: 1 model: sentry.counter pk: 6 - fields: config: {} - date_added: '2023-11-10T11:44:07.792Z' + date_added: '2023-11-15T22:32:20.560Z' default_global_access: true default_role: 50 flags: '0' last_sync: null - organization_id: 4552949431205904 + organization_id: 4552980291649552 provider: sentry sync_time: null model: sentry.authprovider @@ -708,16 +707,16 @@ source: tests/sentry/backup/test_releases.py - 3 key4: nested_key: nested_value - date_added: '2023-11-10T11:44:07.806Z' + date_added: '2023-11-15T22:32:20.582Z' ident: 123456789test-org - last_synced: '2023-11-10T11:44:07.806Z' - last_verified: '2023-11-10T11:44:07.806Z' + last_synced: '2023-11-15T22:32:20.582Z' + last_verified: '2023-11-15T22:32:20.582Z' user: 31 model: sentry.authidentity pk: 6 - fields: config: '""' - created_at: '2023-11-10T11:44:07.494Z' + created_at: '2023-11-15T22:32:20.240Z' last_used_at: null type: 1 user: 31 @@ -725,7 +724,7 @@ source: tests/sentry/backup/test_releases.py pk: 11 - fields: config: '""' - created_at: '2023-11-10T11:44:07.595Z' + created_at: '2023-11-15T22:32:20.334Z' last_used_at: null type: 1 user: 32 @@ -733,10 +732,10 @@ source: tests/sentry/backup/test_releases.py pk: 12 - fields: allowed_origins: null - date_added: '2023-11-10T11:44:07.779Z' - key: 80636ae77ec24ff7bf147338eac18ee8 + date_added: '2023-11-15T22:32:20.541Z' + key: 47c3ebd814ed4405a785d0a988ecdfee label: Default - organization_id: 4552949431205904 + organization_id: 4552980291649552 scope_list: '[]' scopes: '0' status: 0 @@ -744,11 +743,11 @@ source: tests/sentry/backup/test_releases.py pk: 6 - fields: allowed_origins: '' - client_id: a964af0c98a568f91b3caaaae6dc62eb5aee47b754f344dbd9613a09006a9211 - client_secret: 33bdf3c6314c7862ff8bec84ff62e4a6d4d7858728f6dcb7be3d13255ab90540 - date_added: '2023-11-10T11:44:08.015Z' + client_id: 4610d43d85641cf0f6b41e275ec68ac8147d3098e1baa5e235bb3af6a9e9789b + client_secret: 1e5830d2725f553db83467065f2cd98972731f50156d39719c94de2ee5bd6b83 + date_added: '2023-11-15T22:32:20.880Z' homepage_url: null - name: Ethical Lacewing + name: Equal Oarfish owner: 35 privacy_url: null redirect_uris: '' @@ -757,63 +756,63 @@ source: tests/sentry/backup/test_releases.py model: sentry.apiapplication pk: 6 - fields: - team: 4552949431205905 + team: 4552980291649553 type: 0 user_id: null model: sentry.actor pk: 6 - fields: - date_hash_added: '2023-11-10T11:44:07.469Z' + date_hash_added: '2023-11-15T22:32:20.214Z' email: owner is_verified: true user: 31 - validation_hash: nAE72N1J3fRP5HvC1jwK5fRyS1jcsYY1 + validation_hash: R7OI98OW7TqSHLFSHijbJMKB5am0fK6c model: sentry.useremail pk: 31 - fields: - date_hash_added: '2023-11-10T11:44:07.567Z' + date_hash_added: '2023-11-15T22:32:20.312Z' email: invitee is_verified: true user: 32 - validation_hash: Garu3gIeMiJF2GTfWOHLPbCln86w4aAw + validation_hash: R7LnZl0Dll9I6GB2XnzOuwqkDMFgBwH2 model: sentry.useremail pk: 32 - fields: - date_hash_added: '2023-11-10T11:44:07.905Z' + date_hash_added: '2023-11-15T22:32:20.736Z' email: admin@localhost is_verified: true user: 33 - validation_hash: ONZgeG6jv5CbpwvKCaivZaLLywcD6deU + validation_hash: uBdSyXhZhLjTYIIpK5ZI5nugdLhSO0wU model: sentry.useremail pk: 33 - fields: - date_hash_added: '2023-11-10T11:44:07.955Z' - email: 0c797f56590f4ff99a86b920b4baaea3@example.com + date_hash_added: '2023-11-15T22:32:20.814Z' + email: 78010d98140841648f1a2d1b4a709699@example.com is_verified: true user: 34 - validation_hash: 0KTkaIBU1vw1gabxMWAAh61MQnXPpMyL + validation_hash: 8RJWxOULDqmW3ZQ4d1DlA91bQ662U0cq model: sentry.useremail pk: 34 - fields: - date_hash_added: '2023-11-10T11:44:08.009Z' + date_hash_added: '2023-11-15T22:32:20.873Z' email: '' is_verified: false user: 35 - validation_hash: Vi8bcalx9Kl40p3Vwi27EZM1ta0T5bS6 + validation_hash: 93CWQ2Ode5v2CqrHy9ItVu811fGehWCO model: sentry.useremail pk: 35 - fields: - date_hash_added: '2023-11-10T11:44:08.202Z' - email: c2799776b72a48a19b1c6abfa33d9994@example.com + date_hash_added: '2023-11-15T22:32:21.072Z' + email: 1e3b38e01d14459cbbd85012c62d7b53@example.com is_verified: true user: 36 - validation_hash: v6XSGnHW09NdNIEZkXfdWlaA9cmEjLms + validation_hash: G896RmyqoGNuMCyu0iinuirtd0H8iy5L model: sentry.useremail pk: 36 - fields: aggregate: count() dataset: events - date_added: '2023-11-10T11:44:07.890Z' + date_added: '2023-11-15T22:32:20.715Z' environment: null query: level:error resolution: 60 @@ -824,7 +823,7 @@ source: tests/sentry/backup/test_releases.py - fields: aggregate: count() dataset: events - date_added: '2023-11-10T11:44:07.926Z' + date_added: '2023-11-15T22:32:20.775Z' environment: null query: test query resolution: 60 @@ -835,18 +834,17 @@ source: tests/sentry/backup/test_releases.py - fields: application: 6 author: A Company - creator_label: 0c797f56590f4ff99a86b920b4baaea3@example.com + creator_label: 78010d98140841648f1a2d1b4a709699@example.com creator_user: 34 - date_added: '2023-11-10T11:44:08.016Z' + date_added: '2023-11-15T22:32:20.881Z' date_deleted: null date_published: null - date_updated: '2023-11-10T11:44:08.157Z' + date_updated: '2023-11-15T22:32:21.025Z' events: '[]' is_alertable: false - metadata: {} name: test app overview: null - owner_id: 4552949431205904 + owner_id: 4552980291649552 popularity: 1 proxy_user: 35 redirect_url: null @@ -887,26 +885,26 @@ source: tests/sentry/backup/test_releases.py scopes: '0' slug: test-app status: 0 - uuid: 44a7bc23-5a4a-4570-8d74-02533cc19ac8 + uuid: 2c76b31a-c04b-4108-8295-b36168c9785c verify_install: true webhook_url: https://example.com/webhook model: sentry.sentryapp pk: 6 - fields: data: '{"conditions":[{"id":"sentry.rules.conditions.first_seen_event.FirstSeenEventCondition"},{"id":"sentry.rules.conditions.every_event.EveryEventCondition"}],"action_match":"all","filter_match":"all","actions":[{"id":"sentry.rules.actions.notify_event.NotifyEventAction"},{"id":"sentry.rules.actions.notify_event_service.NotifyEventServiceAction","service":"mail"}]}' - date_added: '2023-11-10T11:44:07.839Z' + date_added: '2023-11-15T22:32:20.652Z' environment_id: null label: '' owner: null - project: 4552949431205906 + project: 4552980291649554 source: 0 status: 0 model: sentry.rule pk: 6 - fields: - date_added: '2023-11-10T11:44:07.896Z' - date_updated: '2023-11-10T11:44:07.896Z' - project: 4552949431205906 + date_added: '2023-11-15T22:32:20.722Z' + date_updated: '2023-11-15T22:32:20.722Z' + project: 4552980291649554 snuba_query: 11 status: 1 subscription_id: null @@ -914,9 +912,9 @@ source: tests/sentry/backup/test_releases.py model: sentry.querysubscription pk: 21 - fields: - date_added: '2023-11-10T11:44:07.928Z' - date_updated: '2023-11-10T11:44:07.928Z' - project: 4552949431205906 + date_added: '2023-11-15T22:32:20.779Z' + date_updated: '2023-11-15T22:32:20.779Z' + project: 4552980291649554 snuba_query: 12 status: 1 subscription_id: null @@ -924,9 +922,9 @@ source: tests/sentry/backup/test_releases.py model: sentry.querysubscription pk: 22 - fields: - date_added: '2023-11-10T11:44:08.036Z' - date_updated: '2023-11-10T11:44:08.036Z' - project: 4552949431271440 + date_added: '2023-11-15T22:32:20.900Z' + date_updated: '2023-11-15T22:32:20.900Z' + project: 4552980291649557 snuba_query: 11 status: 1 subscription_id: null @@ -934,9 +932,9 @@ source: tests/sentry/backup/test_releases.py model: sentry.querysubscription pk: 23 - fields: - date_added: '2023-11-10T11:44:08.225Z' - date_updated: '2023-11-10T11:44:08.225Z' - project: 4552949431271441 + date_added: '2023-11-15T22:32:21.098Z' + date_updated: '2023-11-15T22:32:21.098Z' + project: 4552980291715088 snuba_query: 11 status: 1 subscription_id: null @@ -947,12 +945,12 @@ source: tests/sentry/backup/test_releases.py is_active: true organizationmember: 11 role: null - team: 4552949431205905 + team: 4552980291649553 model: sentry.organizationmemberteam pk: 6 - fields: integration_id: null - organization: 4552949431205904 + organization: 4552980291649552 sentry_app_id: null target_display: Sentry User target_identifier: '1' @@ -963,7 +961,7 @@ source: tests/sentry/backup/test_releases.py pk: 9 - fields: integration_id: null - organization: 4552949431205904 + organization: 4552980291649552 sentry_app_id: 6 target_display: Sentry User target_identifier: '1' @@ -973,23 +971,23 @@ source: tests/sentry/backup/test_releases.py model: sentry.notificationaction pk: 10 - fields: - disable_date: '2023-11-10T11:44:07.842Z' + disable_date: '2023-11-15T22:32:20.655Z' opted_out: false - organization: 4552949431205904 + organization: 4552980291649552 rule: 6 - sent_final_email_date: '2023-11-10T11:44:07.842Z' - sent_initial_email_date: '2023-11-10T11:44:07.842Z' + sent_final_email_date: '2023-11-15T22:32:20.655Z' + sent_initial_email_date: '2023-11-15T22:32:20.655Z' model: sentry.neglectedrule pk: 6 - fields: environment: 6 is_hidden: null - project: 4552949431205906 + project: 4552980291649554 model: sentry.environmentproject pk: 6 - fields: dashboard: 6 - date_added: '2023-11-10T11:44:07.943Z' + date_added: '2023-11-15T22:32:20.800Z' description: null detail: null display_type: 0 @@ -1003,51 +1001,51 @@ source: tests/sentry/backup/test_releases.py pk: 6 - fields: custom_dynamic_sampling_rule: 4 - project: 4552949431205906 + project: 4552980291649554 model: sentry.customdynamicsamplingruleproject pk: 4 - fields: application: 6 - date_added: '2023-11-10T11:44:08.100Z' - expires_at: '2023-11-10T19:44:08.100Z' + date_added: '2023-11-15T22:32:20.966Z' + expires_at: '2023-11-16T06:32:20.966Z' name: null - refresh_token: 7087a0a077daa675532d1bc963dddd085310bb06867aaa01e49bec8ee7e6eda6 + refresh_token: 820af875ad962142320a7e51020df3debc03f1ff30876014988c07664c8e3505 scope_list: '[]' scopes: '0' - token: f230f77255063b46385793dfc9fe0fcd7cc36bec0253f5a829ac7ac43a32f711 - token_last_characters: null + token: 7e016d6b0efb8072aa0a827e30286670b7831cccb51ba5545dce8a59df2f535a + token_last_characters: 535a user: 35 model: sentry.apitoken pk: 14 - fields: application: 6 - date_added: '2023-11-10T11:44:08.162Z' + date_added: '2023-11-15T22:32:21.031Z' expires_at: null name: create_exhaustive_sentry_app - refresh_token: 2926997de7c6886cd1b65d8de68aaf407210ef3b91a8873aad64d0386c783cd9 + refresh_token: dc45310ff00da876b87339d3f166f58fb3765eded41b22e1e49ae1f0f89e758a scope_list: '[]' scopes: '0' - token: 5211cafeffba3520ca041f24060a9306486995dc3f8a255eebbdcd490ababc6e - token_last_characters: null + token: 0635932b6fea781327eed01c842b3f49025735d62c459c2031c3d076e9e7e4ae + token_last_characters: e4ae user: 31 model: sentry.apitoken pk: 15 - fields: application: null - date_added: '2023-11-10T11:44:08.267Z' + date_added: '2023-11-15T22:32:21.143Z' expires_at: null name: create_exhaustive_global_configs - refresh_token: 66b6e075b1ca90bcc10cb6d00db28ff43569c30fe1eced1a8dfca60711462652 + refresh_token: a1de5eb026a5c02e33ab43725ee5fba984758765142ba14680b6bd7437550036 scope_list: '[]' scopes: '0' - token: 32d2b32b413478d713317bfcb91b9d221f1ec93336b511afdd170645842c9cf8 - token_last_characters: null + token: 6fff7f274ee0da637ff52397ec0aa4256f0ec650c2be6f0b5c7b5387f5a51458 + token_last_characters: '1458' user: 31 model: sentry.apitoken pk: 16 - fields: application: 6 - code: 6d5e6bafc7213544aa5640774ed9410fbb8251a7e01f3af2f7a48420c472e695 + code: fff771ddf49365e3fc057f1bd1fa965fb6e3325f2ba87c8cd7057aec09347689 expires_at: '2022-01-01T11:11:00.000Z' redirect_uri: https://example.com scope_list: '[''openid'', ''profile'', ''email'']' @@ -1057,7 +1055,7 @@ source: tests/sentry/backup/test_releases.py pk: 8 - fields: application: 6 - date_added: '2023-11-10T11:44:08.161Z' + date_added: '2023-11-15T22:32:21.030Z' scope_list: '[]' scopes: '0' user: 31 @@ -1065,7 +1063,7 @@ source: tests/sentry/backup/test_releases.py pk: 9 - fields: application: null - date_added: '2023-11-10T11:44:08.266Z' + date_added: '2023-11-15T22:32:21.142Z' scope_list: '[]' scopes: '0' user: 31 @@ -1073,11 +1071,11 @@ source: tests/sentry/backup/test_releases.py pk: 10 - fields: comparison_delta: null - date_added: '2023-11-10T11:44:07.892Z' - date_modified: '2023-11-10T11:44:07.892Z' + date_added: '2023-11-15T22:32:20.717Z' + date_modified: '2023-11-15T22:32:20.717Z' include_all_projects: true - name: Fine Crawdad - organization: 4552949431205904 + name: Fancy Eel + organization: 4552980291649552 owner: null resolve_threshold: null snuba_query: 11 @@ -1090,11 +1088,11 @@ source: tests/sentry/backup/test_releases.py pk: 11 - fields: comparison_delta: null - date_added: '2023-11-10T11:44:07.927Z' - date_modified: '2023-11-10T11:44:07.927Z' + date_added: '2023-11-15T22:32:20.777Z' + date_modified: '2023-11-15T22:32:20.777Z' include_all_projects: false - name: Glowing Stallion - organization: 4552949431205904 + name: Above Stag + organization: 4552980291649552 owner: null resolve_threshold: null snuba_query: 12 @@ -1118,13 +1116,13 @@ source: tests/sentry/backup/test_releases.py - fields: api_grant: null api_token: 14 - date_added: '2023-11-10T11:44:08.068Z' + date_added: '2023-11-15T22:32:20.932Z' date_deleted: null - date_updated: '2023-11-10T11:44:08.083Z' - organization_id: 4552949431205904 + date_updated: '2023-11-15T22:32:20.947Z' + organization_id: 4552980291649552 sentry_app: 6 status: 1 - uuid: 9287dbd1-7dd8-4551-8eb7-9b56a781473c + uuid: d522758d-adef-464d-ba0f-6843d27b36e4 model: sentry.sentryappinstallation pk: 6 - fields: @@ -1162,12 +1160,12 @@ source: tests/sentry/backup/test_releases.py type: alert-rule-action sentry_app: 6 type: alert-rule-action - uuid: 88ea1e17-a674-4b14-9216-001e8d4e1d79 + uuid: 67e80ea0-23c6-407f-84e4-7c6abe7430d0 model: sentry.sentryappcomponent pk: 6 - fields: alert_rule: null - date_added: '2023-11-10T11:44:07.841Z' + date_added: '2023-11-15T22:32:20.654Z' owner_id: 31 rule: 6 until: null @@ -1175,7 +1173,7 @@ source: tests/sentry/backup/test_releases.py model: sentry.rulesnooze pk: 6 - fields: - date_added: '2023-11-10T11:44:07.840Z' + date_added: '2023-11-15T22:32:20.653Z' rule: 6 type: 1 user_id: null @@ -1183,26 +1181,26 @@ source: tests/sentry/backup/test_releases.py pk: 6 - fields: action: 9 - project: 4552949431205906 + project: 4552980291649554 model: sentry.notificationactionproject pk: 9 - fields: action: 10 - project: 4552949431205906 + project: 4552980291649554 model: sentry.notificationactionproject pk: 10 - fields: alert_rule: 12 - date_added: '2023-11-10T11:44:07.932Z' + date_added: '2023-11-15T22:32:20.784Z' date_closed: null - date_detected: '2023-11-10T11:44:07.931Z' - date_started: '2023-11-10T11:44:07.931Z' + date_detected: '2023-11-15T22:32:20.782Z' + date_started: '2023-11-15T22:32:20.782Z' detection_uuid: null identifier: 1 - organization: 4552949431205904 + organization: 4552980291649552 status: 1 status_method: 3 - title: Skilled Cricket + title: Clever Cattle type: 2 model: sentry.incident pk: 6 @@ -1210,7 +1208,7 @@ source: tests/sentry/backup/test_releases.py aggregates: null columns: null conditions: '' - date_added: '2023-11-10T11:44:07.944Z' + date_added: '2023-11-15T22:32:20.802Z' field_aliases: null fields: '[]' name: Test Query for test-org @@ -1222,21 +1220,21 @@ source: tests/sentry/backup/test_releases.py - fields: alert_rule: 11 alert_threshold: 100.0 - date_added: '2023-11-10T11:44:07.900Z' - label: Vocal Gnu + date_added: '2023-11-15T22:32:20.729Z' + label: United Wasp resolve_threshold: null threshold_type: null model: sentry.alertruletrigger pk: 6 - fields: alert_rule: 11 - date_added: '2023-11-10T11:44:07.894Z' - project: 4552949431205907 + date_added: '2023-11-15T22:32:20.720Z' + project: 4552980291649555 model: sentry.alertruleexcludedprojects pk: 6 - fields: alert_rule: 11 - date_added: '2023-11-10T11:44:07.897Z' + date_added: '2023-11-15T22:32:20.724Z' previous_alert_rule: null type: 1 user_id: null @@ -1244,30 +1242,30 @@ source: tests/sentry/backup/test_releases.py pk: 11 - fields: alert_rule: 12 - date_added: '2023-11-10T11:44:07.929Z' + date_added: '2023-11-15T22:32:20.780Z' previous_alert_rule: null type: 1 user_id: null model: sentry.alertruleactivity pk: 12 - fields: - date_added: '2023-11-10T11:44:07.936Z' - end: '2023-11-10T11:44:07.936Z' + date_added: '2023-11-15T22:32:20.789Z' + end: '2023-11-15T22:32:20.789Z' period: 1 - start: '2023-11-09T11:44:07.936Z' + start: '2023-11-14T22:32:20.789Z' values: '[[1.0, 2.0, 3.0], [1.5, 2.5, 3.5]]' model: sentry.timeseriessnapshot pk: 6 - fields: actor_id: 6 application_id: 6 - date_added: '2023-11-10T11:44:08.081Z' + date_added: '2023-11-15T22:32:20.945Z' events: '[]' - guid: 794ef968b06d4247b55ead4789ae7779 + guid: 54bc7f111f034e46a4f04d111d132c28 installation_id: 6 - organization_id: 4552949431205904 + organization_id: 4552980291649552 project_id: null - secret: 7cec3304dcb09acb3bc6af3a272ec0e9df7118c6470ef1d8c3953d6123a3f53e + secret: ca7ae41877433ddf63516d03ad373343689699214fc71693b432ef72971a8962 status: 0 url: https://example.com/webhook version: 0 @@ -1276,40 +1274,40 @@ source: tests/sentry/backup/test_releases.py - fields: actor_id: 36 application_id: 6 - date_added: '2023-11-10T11:44:08.251Z' + date_added: '2023-11-15T22:32:21.128Z' events: '[''event.created'']' - guid: bb72e8a431c94c91abad9df1b19cb487 + guid: 1011ff3a9eeb4ffdaa89f12919775be7 installation_id: 6 - organization_id: 4552949431205904 - project_id: 4552949431271441 - secret: fd221c149ccc3e6c222a03e26cc5a8bf22f610d4cd2d6bd0fc0351a2cdd04f6c + organization_id: 4552980291649552 + project_id: 4552980291715088 + secret: 72a70b509f5fd7237e001071c57143123b28979a62560846d12c53d3eba41180 status: 0 url: https://example.com/sentry/webhook version: 0 model: sentry.servicehook pk: 12 - fields: - date_added: '2023-11-10T11:44:07.941Z' + date_added: '2023-11-15T22:32:20.797Z' incident: 6 - target_run_date: '2023-11-10T15:44:07.940Z' + target_run_date: '2023-11-16T02:32:20.797Z' model: sentry.pendingincidentsnapshot pk: 6 - fields: alert_rule_trigger: 6 - date_added: '2023-11-10T11:44:07.939Z' - date_modified: '2023-11-10T11:44:07.939Z' + date_added: '2023-11-15T22:32:20.794Z' + date_modified: '2023-11-15T22:32:20.794Z' incident: 6 status: 1 model: sentry.incidenttrigger pk: 6 - fields: - date_added: '2023-11-10T11:44:07.938Z' + date_added: '2023-11-15T22:32:20.791Z' incident: 6 user_id: 31 model: sentry.incidentsubscription pk: 6 - fields: - date_added: '2023-11-10T11:44:07.937Z' + date_added: '2023-11-15T22:32:20.790Z' event_stats_snapshot: 6 incident: 6 total_events: 1 @@ -1318,7 +1316,7 @@ source: tests/sentry/backup/test_releases.py pk: 6 - fields: comment: hello test-org - date_added: '2023-11-10T11:44:07.935Z' + date_added: '2023-11-15T22:32:20.788Z' incident: 6 notification_uuid: null previous_value: null @@ -1329,13 +1327,13 @@ source: tests/sentry/backup/test_releases.py pk: 6 - fields: alert_rule_trigger: 6 - date_added: '2023-11-10T11:44:07.901Z' + date_added: '2023-11-15T22:32:20.730Z' query_subscription: 21 model: sentry.alertruletriggerexclusion pk: 6 - fields: alert_rule_trigger: 6 - date_added: '2023-11-10T11:44:07.925Z' + date_added: '2023-11-15T22:32:20.773Z' integration_id: null sentry_app_config: null sentry_app_id: null diff --git a/tests/sentry/models/test_apitoken.py b/tests/sentry/models/test_apitoken.py index f1d7e099f52f4d..7e42291d05daa7 100644 --- a/tests/sentry/models/test_apitoken.py +++ b/tests/sentry/models/test_apitoken.py @@ -9,6 +9,7 @@ from sentry.models.integrations.sentry_app_installation_token import SentryAppInstallationToken from sentry.silo import SiloMode from sentry.testutils.cases import TestCase +from sentry.testutils.helpers import override_options from sentry.testutils.outbox import outbox_runner from sentry.testutils.silo import assume_test_silo_mode, control_silo_test @@ -61,6 +62,18 @@ def test_organization_id_for_non_internal(self): assert ApiTokenReplica.objects.get(apitoken_id=token.id).organization_id is None assert token.organization_id is None + @override_options({"apitoken.auto-add-last-chars": True}) + def test_last_chars_are_set(self): + user = self.create_user() + token = ApiToken.objects.create(user_id=user.id) + assert token.token_last_characters == token.token[-4:] + + @override_options({"apitoken.auto-add-last-chars": False}) + def test_last_chars_are_not_set(self): + user = self.create_user() + token = ApiToken.objects.create(user_id=user.id) + assert token.token_last_characters is None + class ApiTokenInternalIntegrationTest(TestCase): def setUp(self):