Add username and password handling from user mapping#33
Conversation
Retrieve username and password from user mapping instead of server options.
'root' is a special role, so no need to grant permissions to it.
There was a problem hiding this comment.
Looks nice all in all. Good use of the pg_sys things even if they're unsafe, but there's no safe way to do it afaik. You've added tests and updated the docs, which I'm happy with. Please add the small change i suggested for the error message. Also sorry for taking so long to review
|
So..... Should we merge it? |
|
I believe it would be nice if before merging, we can test this branch for the internal project(s) using this extension? Need to perform some initial steps.
Something like: etcdctl role add root
etcdctl user add etcd_user:secret
etcdctl user grant-role etcd_user root
etcdctl auth enable-- After CREATE SERVER ...
CREATE USER MAPPING FOR CURRENT_USER SERVER my_etcd_server OPTIONS (user 'etcd_user', password 'secret'); |
why do we need this line? |
|
root is special role with all permissions. We can create our own role, grant permissions to that role, and then grant that role to a user. Or maybe, we can just create I just wanted to give an example of creating a user other than root user. EDIT: to enable auth, |
|
Oh, so weird! :) Root is a special role but nevertheless it must be created! :) 🤯 |
if-loop69420
left a comment
There was a problem hiding this comment.
Looks good. Thanks for adding the error message :)
User/password options are in server options which is not according to the standard. We retrieve username and password from user mapping instead of server options.
Those using this FDW need to enable auth, setup roles/users (like root) on etcd, as mentioned in docs. Then create a user mapping for that user with password like