Re: One Role, Two Passwords

Поиск
Список
Период
Сортировка
Искать
От
Daniel Farina
Тема
Re: One Role, Two Passwords
Дата
Msg-id
AANLkTi=a-fH8DPTtmk5GrOdzZx8VStAWhEwLg9m13HrQ@mail.gmail.com
Ответ на
Список
Дерево обсуждения
One Role, Two Passwords Daniel Farina <drfarina@acm.org>
Re: One Role, Two Passwords Tom Lane <tgl@sss.pgh.pa.us>
Re: One Role, Two Passwords Daniel Farina <drfarina@acm.org>
Re: One Role, Two Passwords Josh Berkus <josh@agliodbs.com>
Re: One Role, Two Passwords Daniel Farina <drfarina@acm.org>
Re: One Role, Two Passwords Josh Berkus <josh@agliodbs.com>
Re: One Role, Two Passwords Robert Haas <robertmhaas@gmail.com>
Re: One Role, Two Passwords Stephen Frost <sfrost@snowman.net>
Re: One Role, Two Passwords Robert Haas <robertmhaas@gmail.com>
Re: One Role, Two Passwords Daniel Farina <drfarina@acm.org>
Re: One Role, Two Passwords Stephen Frost <sfrost@snowman.net>
Re: One Role, Two Passwords Daniel Farina <drfarina@acm.org>
Re: One Role, Two Passwords Florian Pflug <fgp@phlo.org>
Re: One Role, Two Passwords Florian Pflug <fgp@phlo.org>
Re: One Role, Two Passwords Daniel Farina <drfarina@acm.org>
Re: One Role, Two Passwords Garick Hamlin <ghamlin@isc.upenn.edu>
Re: One Role, Two Passwords Andreas Karlsson <andreas@proxel.se>
Re: One Role, Two Passwords Andrew Dunstan <andrew@dunslane.net>
Re: One Role, Two Passwords Daniel Farina <drfarina@acm.org>
Re: One Role, Two Passwords Stephen Frost <sfrost@snowman.net>
On Thu, Jan 20, 2011 at 6:19 PM, Stephen Frost  wrote:
> Errr, well, ok, this is curious.
>
> gis=> alter user sfrost set role gis;
> ALTER ROLE
> gis=> ^D\q
> beren:/home/sfrost> psql --cluster 8.4/main -d gis
> psql (8.4.5)
> Type "help" for help.
>
> gis=> show role;
>  role
> ------
>  gis

So far, I think this does exactly what you think it would...

This is how I think a mostly-transparent one-role-two-password (ish)
system would look like using this property, using a group, as Tom
suggested:

-- Note: This role does not have LOGIN set
CREATE ROLE public_facing_name;

-- The first set of credentials
CREATE ROLE first_arbitrary_name IN ROLE public_facing_name LOGIN
PASSWORD 'first_secret';
ALTER ROLE first_arbitrary_name SET ROLE public_facing_name;

-- The second set of credentials
CREATE ROLE second_arbitrary_string IN ROLE public_facing_neme LOGIN
PASSWORD 'second_secret';
ALTER ROLE second_arbitrary_name SET ROLE public_facing_name;

When one logs in as one_arbitrary_name or second_arbitrary_name, all
CREATE statements -- and indeed, all privilege checks -- will take
place against public_facing_name. No objects should ever get created
under the roles "first_arbitrary_name" or "second_arbitrary_name," and
no ownership ever assigned to them, unless the client runs SET ROLE to
un-do what was done.  This would be annoying (when dropping sets of
credentials, or when ownership-specific privileges apply to one set of
credentials but not the other) but may not occur much at large.

Thoughts?

--
fdr

В списке pgsql-hackers по дате отправления
От: Joel Jacobson
Дата:
От: Simon Riggs
Дата:
FAQ