Re: Custom oauth validator options - Mailing list pgsql-hackers

From Zsolt Parragi
Subject Re: Custom oauth validator options
Date
Msg-id CAN4CZFOZX7r4-i--ucw38mhb6z0WzC1U+VFt45mFwiw5qqqbXg@mail.gmail.com
Whole thread
In response to Re: Custom oauth validator options  (Jacob Champion <jacob.champion@enterprisedb.com>)
List pgsql-hackers
Claude pointed out that pg_hba_file_rules leaves the validator options out:

    host all all 127.0.0.1/32 oauth issuer="https://issuer.example"
scope="pg" validator.log="hi" validator.typo=1

    SELECT options FROM pg_hba_file_rules WHERE line_number = 2;
                              options
    -----------------------------------------------------------
     {issuer=https://issuer.example,scope=pg,validator=validator}

I think this matters a bit more than for the builtin options, because
unknown validator.* names can't be detected at reload time, and the
view is the only place where an admin can see what the server actually
parsed. The values still won't go through validations, e.g. in the
above example typo will be simply displayed, but I think that's
already better than hiding them and is worth doing.

The attached patch emits them as validator.<name>=<value>, in the
order they appear on the line. Since there's no limit on how many
options a line can have, the fixed MAX_HBA_OPTIONS array doesn't work
anymore, so options are sized dynamically now (MAX_HBA_OPTIONS plus
the number of validator options).

Attachment

pgsql-hackers by date:

Previous
From: Vadim Ponomarev
Date:
Subject: Re: Reduce SyncRepLock contention on the commit path
Next
From: Srinath Reddy Sadipiralla
Date:
Subject: [RFC PATCH v1] On-demand WAL replay: accept connections before crash recovery has applied the WAL