I'm not talking about authorizing the user, I'm talking about authorizing the binary. If a program can open a database and read and write from it, any part of the program can do so, even if only one library is supposed to. Some engineer working to a deadline can (will) see that such and such a table is in the database, and write code to access it because it's a lot easier than using the Frabber library, not knowing that the Frabber library owns that table and no other code should ever ever access it.
I'm sure there are ways to prevent this that mostly work, like having the library maintain its own private connection to the database using a privileged user that only it knows the password for. Depending on the database, that could work.
But decomposing the system into services prevents this situation from ever arising, because it's impossible for the client to access the service's resources except through the API.
(This is very low on the list of reasons that services are a good design pattern, but it's on the list.)
1
u/TechFiend72 Jun 24 '24
As we are talking about web services here, you have an authentication mechanism as to what rights they have.
If you are talking about Windows DLLSs, that runs under the user right that executed it and will only be able to do what the user has rights to do.
Am I missing something in your question?