fix: GraphQL error on sync views for roles without credentials access - #977
Merged
Conversation
…top overfetching it in sync queries — permission-withheld credentials nulled the whole syncs payload for custom-role users
rohan-chaturvedi
force-pushed
the
fix/provider-credentials-nullable
branch
from
August 17, 2026 16:42
acc036c to
e31e0f4
Compare
…y — the syncs page poll and dashboard card decrypted every stored credential without using them
nimish-ks
approved these changes
Aug 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔍 Overview
Users without the
Integration Credentials: readpermissions recieved the error:ProviderCredentialsType.resolve_credentialsdeliberately withholds credential values (returnsNone) from users whose role lacksIntegrationCredentials: read. However, thecredentialsfield's schema type was auto-derived from the non-null model column asJSONString!— so the withholding became a hard GraphQL error that nulled the entiresyncspayload, breaking sync views for any user who can see syncs but not credentials.This has been latent since the permission check was introduced (1ad43c3): all five default roles hold
IntegrationCredentials: read, so only custom roles with sync visibility but no credentials access can trigger it. The Log Streams release surfaced it rather than caused it.An aggravating factor: both sync queries (
GetAppSyncStatus,GetOrganisationSyncs) requestedauthentication { credentials }even though no frontend code consumes it — needlessly decrypting third-party credentials and shipping them to the browser on every sync list view, and detonating the error for under-privileged users.💡 Proposed Changes
Three layers, so no single regression can reintroduce the breakage:
credentialsis now explicitly declaredgraphene.JSONString()(nullable) onProviderCredentialsType— permission-withheld values are a legalnullinstead of a payload-killing error. Schema and frontend codegen regenerated.credentialsfield from theauthenticationblock ofgetAppSyncStatus.gqlandGetOrgSyncs.gql. Sync views no longer request (or decrypt) credential values at all.savedCredentialson the credentials page still requests it — the update dialog needs it, and that resolver already returns[]for unauthorized users.UpdateProviderCredentialstolerates anullcredentials value in bothJSON.parsesites.A new schema-shape test (
backend/tests/test_graphene_schema.py) pins the field's nullability so a future regeneration can't silently restore the!.🖼️ Screenshots or Demo
No visual changes — the fix removes an error toast and restores the syncs list for affected users.
📝 Release Notes
IntegrationCredentials: readno longer get a GraphQL error (and an empty sync view) on the app Syncing tab and the Integrations → Syncs page.credentialsfield ofProviderCredentialsTypeis now nullable in the GraphQL schema; it returnsnullwhen the requesting role lacksIntegrationCredentials: read.❓ Open Questions
resolve_credentialsnever returns decrypted values wholesale (e.g. field-level masking or a dedicated reveal mutation)? Deferred — tracked as part of the holistic credential-change authz follow-up.🧪 Testing
test_provider_credentials_field_is_nullable(schema-shape guard).tests/utils/test_secret.py).tsc --noEmitclean (pre-existing baseline errors only), eslint clean on changed files, codegen regenerated.🎯 Reviewer Focus
backend/backend/graphene/types.py— the explicit nullable field declaration onProviderCredentialsType.frontend/graphql/queries/syncing/getAppSyncStatus.gql/GetOrgSyncs.gql— confirm nothing consumedauthentication.credentials(repo-wide grep found zero usages).frontend/components/syncing/UpdateProviderCredentials.tsx— null-guards.➕ Additional Context
feat: add permission check for accessing provider credentials); feat: Log Streams — stream audit logs and secret events to Datadog #961 only touchedresolve_sync_counton this type.savedCredentialswas never affected: its resolver returns an empty list for unauthorized users, so the non-null field was never reached on that path.✨ How to Test the Changes Locally
Integrationsread, but withoutIntegrationCredentials: read.Cannot return null for non-nullable field ProviderCredentialsType.credentials) and a broken/empty sync list. After: the sync list renders; credential values are simply absent.💚 Did You...