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

Pluginize Persisted Operations #1278

Open
janeli1 opened this issue Oct 16, 2024 · 2 comments
Open

Pluginize Persisted Operations #1278

janeli1 opened this issue Oct 16, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@janeli1
Copy link

janeli1 commented Oct 16, 2024

Component(s)

No response

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

Current Persisted Operations implementation requires users to use either CDN or S3 and provide PO configs using the configuration file. This feature request is to pluginize Persisted Operations by exposing Persisted Operations Client interface to give users flexibility to implement their own PO logics. For example, the users have the authorized Persisted Operations Hash stored within their own service/storage. Then the user can implement Persisted Operations Client interface and provide it to the router.

Describe the solution you'd like

  • Expose Persisted Operations Client interface in pkg directory. Right now Persisted Operations Client interface is at internal directory and is not accessible by users.
  • Refactor the existing ClientInfo struct and expose Client Info interface in pkg directory. In order to fetch Persisted Operations, we might need more information in addition to Persisted Operations Hash value. For example, we might also want to check on the device OS and client version of incoming requests. Only when <device OS , client version , PO hash> are valid, we fetch the Persisted Operations query body. To do this, instead of using clientName string as the input param, we use clientInfo as the input param. This change gives flexibility for users to cast clientInfo to their internally defined structs.
type Client interface {
	PersistedOperation(ctx context.Context, clientInfo clientinfo.DetailedClientInfo, sha256Hash string, attributes []attribute.KeyValue) ([]byte, error)
	Close()
}

Describe alternatives you've considered

No response

Additional context

No response

@janeli1 janeli1 added the enhancement New feature or request label Oct 16, 2024
Copy link

WunderGraph commits fully to Open Source and we want to make sure that we can help you as fast as possible.
The roadmap is driven by our customers and we have to prioritize issues that are important to them.
You can influence the priority by becoming a customer. Please contact us here.

@alexus37
Copy link

This would also we very helpful for us 👍

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

No branches or pull requests

2 participants