postgresql icon indicating copy to clipboard operation
postgresql copied to clipboard

Default ident mapping

Open MVKozlov opened this issue 4 years ago • 1 comments

I believe that default Ident mapping should be like this

 # pg_ident.conf
 postgresql_pg_ident:
   - comment: "root is allowed to login as {{ postgresql_admin_user }}"
     mapname: "root_as_{{ postgresql_admin_user }}"
-    system_username: "{{ postgresql_admin_user }}"
+    system_username: root
     pg_username: "{{ postgresql_admin_user }}"

MVKozlov avatar Nov 25 '19 09:11 MVKozlov

The contents of my pg_ident.conf file is:

# MAPNAME       SYSTEM-USERNAME         PG-USERNAME
# root is allowed to login as postgres
root_as_postgres  postgres  postgres

Which is unnecessary, as postgres (linux) is implicitly mapped to postgres (database):

https://www.postgresql.org/docs/current/auth-username-maps.html

To be honest I don't know anyone that uses root to login to their database via this method... and I would not recommend this type of setup, but the code written as it stands is incorrect. Embarrassingly, I added it with #348. :-/

Personally, I would call for removing this default altogether and adding it to the documentation/examples so that people to add it back in if they so desired:

# pg_ident.conf
postgresql_pg_ident:
  - comment: "root is allowed to login as {{ postgresql_admin_user }}"
    mapname: "root_as_{{ postgresql_admin_user }}"
    system_username: "root"
    pg_username: "{{ postgresql_admin_user }}"

What do you think @otakup0pe , @UnderGreen ? Anyone... Bueller?!?

gclough avatar Mar 11 '21 18:03 gclough

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

github-actions[bot] avatar Dec 22 '23 23:12 github-actions[bot]

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

github-actions[bot] avatar Feb 20 '24 23:02 github-actions[bot]