ory / fosite

Extensible security first OAuth 2.0 and OpenID Connect SDK for Go.
https://www.ory.sh/?utm_source=github&utm_medium=banner&utm_campaign=fosite
Apache License 2.0
2.32k stars 359 forks source link

refactor: transactional interface #772

Closed alnr closed 5 months ago

alnr commented 11 months ago

BREAKING CHANGE: This patch changes the transactional interface to improve transactional isolation across all handlers. Instead of begin/commit/rollback being called within the handler, we now use MaybeTransaction which (a) can start a new transaction or (b) use the already existing transaction.

The callback style makes the code significantly more readable and it is easier to handle issues such as panics. See the godoc for more information on the implementation.

aeneasr commented 5 months ago

The current implementation does work indeed, we just need to wrap it in Ory Hydra!