headscale
headscale copied to clipboard
All internal calls must go via rpc layer
Currently we have done a lot of work to move the client away from direct database manipulation and to go via our new rpc interface (available via grpc and http).
This rpc interfaces can also be used internally in the code without actually using a network protocol, and we can use that as an abstraction layer to achieve a couple of things:
- Hide the complexity of database manipulation from the “users” (developers)
- Provide convenience functions that only allows the modification necessary, instead of providing access to the whole database
- Make database hardening and race condition handling easier to achieve by only having to solve it once.
- If we make convenience functions, the api will automatically support it!
TLDR: "Protect" the database and force us to keep the API up to date.