Skip to content
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

Set execution depth limit for GQL #1430

Closed
oskogstad opened this issue Nov 10, 2024 · 3 comments · Fixed by #1436
Closed

Set execution depth limit for GQL #1430

oskogstad opened this issue Nov 10, 2024 · 3 comments · Fixed by #1436
Assignees

Comments

@oskogstad
Copy link
Collaborator

We have the possibility for "infinite" recursion in our parties query (sub-parties)

  parties {
    subParties {
      subParties {
        subParties {
          subParties {
            ...
          }
        }
      }
    }
  }

Capping the global query depth level at 10.
(Max depth on dialogById seems to be 7)

query q {
  dialogById(dialogId: "c8147d41-936e-4124-8119-ea1add40c4b4") {
    dialog {
      transmissions {
        content {
          title {
            mediaType
            value {
              value
            }
          }
        }
      }
    }
  }
}
@oskogstad oskogstad self-assigned this Nov 10, 2024
@oskogstad oskogstad changed the title Set query depth limit for GQL Set execution depth limit for GQL Nov 10, 2024
oskogstad added a commit that referenced this issue Nov 11, 2024
<!--- Provide a general summary of your changes in the Title above -->

## Description

<!--- Describe your changes in detail -->
We have the possibility for "infinite" recursion in our parties query
(sub-parties)

```
  parties {
    subParties {
      subParties {
        subParties {
          subParties {
            ...
          }
        }
      }
    }
  }
```
Capping the global query depth level at 10. 
(Max depth on dialogById seems to be 7) 

```
query q {
  dialogById(dialogId: "c8147d41-936e-4124-8119-ea1add40c4b4") {
    dialog {
      transmissions {
        content {
          title {
            mediaType
            value {
              value
            }
          }
        }
      }
    }
  }
}
```

## Related Issue(s)

- #1430
oskogstad pushed a commit that referenced this issue Nov 12, 2024
🤖 I have created a release *beep* *boop*
---


##
[1.32.0](v1.31.0...v1.32.0)
(2024-11-12)


### Features

* **graphql:** Set max execution depth to 10
([#1431](#1431))
([8845e49](8845e49)),
closes [#1430](#1430)
* **performance:** create a k6 purge script to run after creating
dialogs ([#1435](#1435))
([9555d78](9555d78))
* **performance:** Expands search for serviceowners, improved tracing
and logging
([#1439](#1439))
([b1d6eaf](b1d6eaf))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
@LeifHelstad
Copy link

Initiell test:
Generer et IDPortenToken med den som ligger i felles postman pid=05085301731
Kjører med denne en GET parties, noe som returnerer en "authorizedParties" med tre party på samme nivå, ingen sub parties. Initell test er kun for å bekrefte at rett kall er utført på riktig måte. Neste steg er å finne en testdata pid som har sub-parties.

@LeifHelstad
Copy link

Tester med en gammel kjenning fra arbeidsflate test Aktor Kjær 26818999827
Her gir GET parties 4 partiens hvorav 2 har hvert sitt subParty. Rekusrivt to nivåer av paryt er testet.
Det er capping på 10 som skal testes, hvor finner man pid-er med +10 sub-party nivåer?

@LeifHelstad
Copy link

Setter test-status til NA på denne. Det er innført en hard capping på 10 nivåer som skal testes. Men etter det jeg forstår går det ikke å lage testdata med mer enn 7 nivåer uten at de tas av andre regler først. Ikke mulig å teste.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

2 participants