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
database class : editing security settings #13
Comments
someone did the homework already : https://medium.com/@eiri/couchdb-authorization-in-nutshell-5ae697fe9a all i have to do is build it into php-couchdb, and verify that it all works of course. |
i'm stuck :(
returns object(GuzzleHttp\Psr7\Stream)#211 (7) { and the call to $client->getAllDbs() works just fine, i'm no expert on GuzzleHTTP.. anyone got an idea why i can't get to the JSON listed as output for the curl commandline command? |
Cast the returned value from |
cool! sorry i didn't get back to you earlier, i was busy with other code tasks. i'll get onto implementing low-level and basic functionality to assign permissions to specific users on databases, hopefully to be included in future versions of your library. i'll try to follow your code conventions where-ever possible, and will provide an example usage script as well. i have some other tasks on my desk as well, but i'll update this thread with a link to my copy of this library (i host it at github.com and will fork it into php-couchdb-sa for the necessary flexibility in developing these extensions), as soon as i have something worth-while. that could take a few weeks, but no more than 2 months i think. |
i've run into another snag.. thread for php-couchdb upgrade : #13 the two articles i found on couchdb permissions management : now, from the articles by @eiri, i can get and set the server-wide admins, i can enter users into the _users couchdb database, but i can't link these users to become the sole admin of a database in couchdb. that error that is mentioned in the database permissions article, CouchDB Fatal error: Uncaught GuzzleHttp\Exception\ServerException: Server error: in /home/rene/data1/htdocs/localhost/seductiveapps/lib/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113 in the article, it's mentioned that this error message ("no_majority") is wrong (somebody ought to fix that imho), that appears not to be the case, on my test system that is the latest ubuntu.com with the latest couchdb (installed per instructions found on couchdb.apache.org) as you can see, it's already using a couchdb admin's credentials to do all of these calls. i've spied on Fauxton (localhost:5984/_utils), and even using less JSON ([2] instead of [1]) like Fauxton does, gets me the same results in PHP. [1] $json = '{ "admins" : { "names" : [], "roles" : [] }, "members" : { "names" : ["Administrator"], "roles" : [] } }'; this could be caused by couchdb, or by the PHP stack i use to get to couchdb. |
did work from the command-line : i don't really have the time to dig into this right now, guzzle's code conventions are a bit cryptic to me. |
fixed it :) i was using the wrong parameter into one of the components used by php-couchdb. i've uploaded my improved sources to gitlab. links are listed earlier in this thread. |
UPDATE : CouchDB has been upgraded to version 3.0.0 now, and with that comes 1 vital change that all users of php-couchdb who desire real user management at their couchdb layer.. it's that adding security settings is now compulsory if you want to access a database at all as 'a normal user'. i've found that the easiest way for me to add this into php-couchdb is for me to edit ibm-watson-data-lab/php-couchdb/src/PHPCouchDB/Server.php and change the function useDb a little.. before $exist = false, add : now you can do, in your client code aimed into php-couchdb, the following :
` |
i'm going to use CouchDB 2.2.0, Fauxton (/_utils) and the chrome debugger to build functionality into the php-couchdb database class that allows you to set security settings on databases, over the next few days/weeks.
the thing is, i read about how unit tests are required for a merge, and i could use some tips on how to quickly write the proper unit tests, and how to submit the changes..
actually, i'd rather not spend days reading manuals about this and that to become an expert on your particular source-code version control and unit testing code stacks..
can i simply submit the changed php-couchdb code to someone by email or adding them into this issue report even, along with example code that would get put into my https://gitlab.com/seductiveapps/seductiveapps/blob/master/seductiveapps/siteData/reInit.php ?
pretty please? :)
The text was updated successfully, but these errors were encountered: