Skip to content

feat(tempest): Add playstation key to keys endpoint #93232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/sentry/api/serializers/models/project_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class DSN(TypedDict):
unreal: str
crons: str
cdn: str
playstation: str


class BrowserSDK(TypedDict):
Expand Down Expand Up @@ -94,6 +95,7 @@ def serialize(
"unreal": obj.unreal_endpoint,
"crons": obj.crons_endpoint,
"cdn": obj.js_sdk_loader_cdn_url,
"playstation": obj.playstation_endpoint,
},
"browserSdkVersion": get_selected_browser_sdk_version(obj),
"browserSdk": {"choices": get_browser_sdk_version_choices(obj.project)},
Expand Down
1 change: 1 addition & 0 deletions src/sentry/apidocs/examples/project_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"csp": "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/csp-report/?sentry_key=a785682ddda719b7a8a4011110d75598",
"security": "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/security/?sentry_key=a785682ddda719b7a8a4011110d75598",
"minidump": "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/minidump/?sentry_key=a785682ddda719b7a8a4011110d75598",
"playstation": "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/playstation/?sentry_key=a785682ddda719b7a8a4011110d75598",
"nel": "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/nel/?sentry_key=a785682ddda719b7a8a4011110d75598",
"unreal": "https://o4504765715316736.ingest.sentry.io/api/4505281256090153/unreal/a785682ddda719b7a8a4011110d75598/",
"cdn": "https://js.sentry-cdn.com/a785682ddda719b7a8a4011110d75598.min.js",
Expand Down
6 changes: 6 additions & 0 deletions src/sentry/models/projectkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,12 @@ def minidump_endpoint(self):

return f"{endpoint}/api/{self.project_id}/minidump/?sentry_key={self.public_key}"

@property
def playstation_endpoint(self):
endpoint = self.get_endpoint()

return f"{endpoint}/api/{self.project_id}/playstation/?sentry_key={self.public_key}"

@property
def unreal_endpoint(self):
return f"{self.get_endpoint()}/api/{self.project_id}/unreal/{self.public_key}/"
Expand Down
15 changes: 15 additions & 0 deletions tests/sentry/api/endpoints/test_project_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ def test_simple(self):
assert len(response.data) == 1
assert response.data[0]["public"] == key.public_key

def test_playstation_dsn(self):
project = self.create_project()
key = ProjectKey.objects.get_or_create(project=project)[0]
self.login_as(user=self.user)
url = reverse(
"sentry-api-0-project-keys",
kwargs={
"organization_id_or_slug": project.organization.slug,
"project_id_or_slug": project.slug,
},
)
response = self.client.get(url)
assert response.status_code == 200
assert response.data[0]["dsn"]["playstation"] == key.playstation_endpoint

def test_use_case(self):
"""Regular user can access user DSNs but not internal DSNs"""
project = self.create_project()
Expand Down
Loading