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

Async code in ProducesTickets implementation #1808

Open
1 task done
tvsfx opened this issue Feb 26, 2024 · 2 comments
Open
1 task done

Async code in ProducesTickets implementation #1808

tvsfx opened this issue Feb 26, 2024 · 2 comments

Comments

@tvsfx
Copy link

tvsfx commented Feb 26, 2024

Checklist

  • I've searched the issue tracker for similar requests

Is your feature request related to a problem? Please describe.
I am writing a custom implementation of the ProducesTickets trait. As part of encryption and decryption, I occasionally need to make some asynchronous database calls (when I need to rotate my STEK), which is currently not possible because the encrypt/decrypt methods are synchronous.

Describe the solution you'd like
I was wondering if there are any plans to support this use case, or whether there's an existing solution for this that I'm missing.

Describe alternatives you've considered
As a workaround, I am thinking of spinning up a separate task to monitor the keys and rotate when necessary (to avoid calling block_on in a new runtime). I am not sure whether this is the best way to go about this issue.

@cpu
Copy link
Member

cpu commented Feb 27, 2024

I was wondering if there are any plans to support this use case, or whether there's an existing solution for this that I'm missing.

I think #850 is the most relevant issue for capturing plans in this area. There's also the start of some work in #1648, but only the client-side and so nothing in relation to ProducesTickets yet.

@djc
Copy link
Member

djc commented Feb 27, 2024

Yeah, I think a potential workaround is to have some kind of channel to a background task.

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

No branches or pull requests

3 participants