[PR #17244] [MERGED] Fixes: #16292 - Properly restrict GraphQL queries for querys with pk set #15035

Closed
opened 2025-12-30 00:19:34 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/17244
Author: @DanSheps
Created: 8/22/2024
Status: Merged
Merged: 8/28/2024
Merged by: @jeremystretch

Base: developHead: 16292-restrict-graphql-queries


📝 Commits (4)

  • 1e6d8df Fixes: #16292 - Properly restrict GraphQL queries for querys with pk set
  • e21d515 Update netbox/netbox/settings.py
  • 89c4127 Apply schema adaptations across all apps
  • 20ebc5e Extend GraphQL API tests

📊 Changes

14 files changed (+171 additions, -352 deletions)

View changed files

📝 netbox/circuits/graphql/schema.py (+7 -20)
📝 netbox/core/graphql/schema.py (+3 -8)
📝 netbox/dcim/graphql/schema.py (+41 -122)
📝 netbox/extras/graphql/schema.py (+13 -38)
📝 netbox/ipam/graphql/schema.py (+17 -50)
📝 netbox/netbox/settings.py (+1 -0)
📝 netbox/netbox/tests/dummy_plugin/graphql.py (+2 -4)
📝 netbox/tenancy/graphql/schema.py (+7 -20)
📝 netbox/users/graphql/schema.py (+4 -10)
📝 netbox/utilities/testing/api.py (+44 -17)
📝 netbox/utilities/testing/utils.py (+10 -0)
📝 netbox/virtualization/graphql/schema.py (+7 -20)
📝 netbox/vpn/graphql/schema.py (+11 -32)
📝 netbox/wireless/graphql/schema.py (+4 -11)

📄 Description

Fixes: #16292 - Properly restrict GraphQL queries for querys with pk set

  • Set name on Schema type to "Query" (required as part of the default resolver generation)
  • Change resolver to regular Field with appropriate type
  • Set DEFAULT_PK_FIELD_NAME in settings.py to id

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/17244 **Author:** [@DanSheps](https://github.com/DanSheps) **Created:** 8/22/2024 **Status:** ✅ Merged **Merged:** 8/28/2024 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `16292-restrict-graphql-queries` --- ### 📝 Commits (4) - [`1e6d8df`](https://github.com/netbox-community/netbox/commit/1e6d8dfb18f3ae15ff9f21a238ab40dc971b7739) Fixes: #16292 - Properly restrict GraphQL queries for querys with pk set - [`e21d515`](https://github.com/netbox-community/netbox/commit/e21d515f34d82f4433238e94a3ab1f8c9b6e1d42) Update netbox/netbox/settings.py - [`89c4127`](https://github.com/netbox-community/netbox/commit/89c41272c6a5048cd1c5a129a926787501ed6973) Apply schema adaptations across all apps - [`20ebc5e`](https://github.com/netbox-community/netbox/commit/20ebc5e8de6815b905fa31f176587998be98ee6d) Extend GraphQL API tests ### 📊 Changes **14 files changed** (+171 additions, -352 deletions) <details> <summary>View changed files</summary> 📝 `netbox/circuits/graphql/schema.py` (+7 -20) 📝 `netbox/core/graphql/schema.py` (+3 -8) 📝 `netbox/dcim/graphql/schema.py` (+41 -122) 📝 `netbox/extras/graphql/schema.py` (+13 -38) 📝 `netbox/ipam/graphql/schema.py` (+17 -50) 📝 `netbox/netbox/settings.py` (+1 -0) 📝 `netbox/netbox/tests/dummy_plugin/graphql.py` (+2 -4) 📝 `netbox/tenancy/graphql/schema.py` (+7 -20) 📝 `netbox/users/graphql/schema.py` (+4 -10) 📝 `netbox/utilities/testing/api.py` (+44 -17) 📝 `netbox/utilities/testing/utils.py` (+10 -0) 📝 `netbox/virtualization/graphql/schema.py` (+7 -20) 📝 `netbox/vpn/graphql/schema.py` (+11 -32) 📝 `netbox/wireless/graphql/schema.py` (+4 -11) </details> ### 📄 Description ### Fixes: #16292 - Properly restrict GraphQL queries for querys with pk set * Set name on Schema type to "Query" (required as part of the default resolver generation) * Change resolver to regular Field with appropriate type * Set DEFAULT_PK_FIELD_NAME in settings.py to `id` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:19:34 +01:00
adam closed this issue 2025-12-30 00:19:34 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15035