-
Notifications
You must be signed in to change notification settings - Fork 29
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
Normal / Admin connection #11
Comments
My purpose is to avoid a dangling Say we have an instance of connection let conn = Connection::establish_jwt("http://localhost:8529", "username", "password").await.unwrap();
let db = conn.db("test_db").unwrap(); If we simple drop database Maybe we can move the BTW, the async/await support is on air in develop branch. I will publish it once I finished strong typing lib error. |
@fMeow Thank you for your answer. I somehow don't quite agree. The part about Rust being a statically typed language with many compiler checks refers mainly to the fact that unsafe programming styles should be mitigated, like ending up with dangling pointers, not handling paths in a decision tree etc. So it removes a lot of possibilities for fatal crashes / vulnerabilities / other unwanted effects. Regarding the database connection, I agree that a connection to a deleted database will not be of any value. But handling an error of this form (a database that's being queried does not exist anymore) is not something you can possibly verify at compile time. For one part, it could very well be that the ArangoDB cluster houses other applications with admin access (and they could for whatever reason delete a database still in use), or an administrator could do the same. I could actually even do the same with the current 'arangors' implementation by spawning a separate admin connection and deleting the database. Apart from that I also think that the error is quite nice to handle, as ArangoDB replies:
So pushing everything into one connection could make sense, as it will remove some complexity that might not be required. What do you think?
That's very pleasant news! |
Thank you for your illustration. I make it clear that Certainly creation and delete of database should not counted as admin role. So I moved This comes in the 0.3 version. |
@fMeow perfect, I'm looking forward to those changes. Many thanks! |
Hello there
I was wondering if there were any specific reason for having two different connection types for Admin and Normal connections? Is this really a requirement, or could we just switch to a single connection type?
I'm justing seeing some problems in r2d2 as the connections cannot be converted into admin connections. And so I started thinking about it and I somehow do not really see any advantage of having this distinction. The ArangoDB API will respond with an according error if someone without access is trying to modify the _system database.
The text was updated successfully, but these errors were encountered: