cosmo icon indicating copy to clipboard operation
cosmo copied to clipboard

Pluginize Persisted Operations

Open janeli1 opened this issue 1 year ago • 2 comments

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 avatar Oct 16 '24 22:10 janeli1

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.

github-actions[bot] avatar Oct 16 '24 22:10 github-actions[bot]

This would also we very helpful for us 👍

alexus37 avatar Oct 24 '24 08:10 alexus37