pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jille Timmermans <jille@quis.cx>
To: pgsql-admin@lists.postgresql.org
Subject: pgperms: Declarative / config as code for PostgreSQL permissions
Date: Tue, 24 Jan 2023 20:42:58 +0100
Message-ID: <94e773aa6934b303dfce44c0ee46c744@quis.cx> (raw)

Hey all,

I wrote a tool that can manage PostgreSQL permissions from a config 
file. The config file describes your desired roles and grants and syncs 
them to your PostgreSQL cluster. This allows you to manage your 
permissions in Git, for example.

You can find detailed instructions and the binaries at 
https://github.com/SnoozeThis-org/pgperms.

Here's some example config to show its features:

> roles:
>   yourname:
>     password: SCRAM-SHA-256$4096:...
>     createdb: true
> databases:
> - mydatabase
> schemas:
> - mydatabase.myschema
> database_privileges:
> - roles: [yourname]
>   privileges: [CONNECT, TEMPORARY]
>   databases: [mydatabase]
> schema_privileges:
> - roles: [yourname]
>   privileges: [CREATE, USAGE]
>   schemas: [mydatabase.myschema]
> table_privileges:
> - roles: [yourname]
>   privileges: [SELECT, INSERT, UPDATE]
>   tables: [mydatabase.otherschema.*]

Let me know if you find any bugs or need any missing features. It'd be 
great to hear people find this useful :)

-- Jille
Development of pgperms is sponsored by SnoozeThis: a bot that can hold 
on to your blocked issues until they're actionable 
(https://www.snoozethis.com).





Message-ID: <94e773aa6934b303dfce44c0ee46c744@quis.cx>
Permalink:  ../94e773aa6934b303dfce44c0ee46c744@quis.cx/
Also on:    postgresql.org/message-id/94e773aa6934b303dfce44c0ee46c744@quis.cx

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: jille@quis.cx, pgsql-admin@lists.postgresql.org
  Subject: Re: pgperms: Declarative / config as code for PostgreSQL permissions
  In-Reply-To: <94e773aa6934b303dfce44c0ee46c744@quis.cx>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox