ory / ladon

A SDK for access control policies: authorization for the microservice and IoT age. Inspired by AWS IAM policies. Written for Go.

Home Page:https://www.ory.sh/?utm_source=github&utm_medium=banner&utm_campaign=ladon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: Thread-safety?

ccbrown opened this issue · comments

commented

It appears to me that the library might be thread-safe if the storage being used is thread-safe, as all of the operations as far as I can tell boil down to static logic and storage manipulations (which at least for the case of sqlx.DB are thread-safe).

I'm not entirely confident in my own assessment though, and wouldn't trust this without some assurance that matching the thread-safety of the storage implementation is an actual design goal (meaning the library will remain thread-safe in the future).

So what is the library's policy on thread-safety?

Yup, it's thread-safe which is why you see a sync.RWMutex in some of the stores, and also the -race flag in the CI config. If you find issues with thread-safety feel free to report them here

commented

Thanks! Hadn't looked that closely at those parts yet. Closing the issue, but a readme or documentation note like what you may find for many of the standard types might not be a bad idea.