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

Conditional apply safelisting with operation limits #5058

Open
smyrick opened this issue Apr 30, 2024 · 0 comments
Open

Conditional apply safelisting with operation limits #5058

smyrick opened this issue Apr 30, 2024 · 0 comments

Comments

@smyrick
Copy link
Member

smyrick commented Apr 30, 2024

Is your feature request related to a problem? Please describe.

I want to enable persisted queries and safelisting for clients that can register their operations, but I also want to keep my graph open for queries from unregistered operations, but with limits on the size of them.

As far as I am aware, I can enabled both of these features today, but then even persisted queries will be checked with my operation limits config.

Describe the solution you'd like

I would like to allow any query of any size if it is pre-registered, but use operation limit if it is not, and not block the registered operations with the limits.

# Any size operation is allowed if it is registered
persisted_queries:
  enabled: true
  safelist:
    enabled: false
apq:
  enabled: false

# Unregistered ops use limits
limits:
  max_depth: 5
  max_height: 25

  # New config needed??
  include_persisted_queries: false

Describe alternatives you've considered

If there was some way I could dynamically decide to run op limits or safelisting checks (Rhai or CP) then we could maybe build this ourselves, but that is not possible today either.

So my options would have to be to build my own coprocessor to check op limits

Additional context

This will be even more helpful once we get to a more full featured cost limiting calculation. Also it could help if Persisted Queries had a review step so we could apply some limits that at registration time that might be different than runtime, but that is a separate issue

@smyrick smyrick changed the title Conditional apply safelisting with other features like operation limits Conditional apply safelisting with operation limits Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant