| From: | Ajit Awekar <ajitpostgres(at)gmail(dot)com> |
|---|---|
| To: | Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> |
| Cc: | VASUKI M <vasukianand0119(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: [OAuth2] Infrastructure for tracking token expiry time |
| Date: | 2026-02-17 05:20:24 |
| Message-ID: | CAER375Oh6U_kqP0SK8OP47vy3PBd4p1C027Gaod3B2bqKgMFoQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Thanks Vasuki and Zsolt for your reply and comments.
>> First, is Port always zero-initialized? If not, we might want to
explicitly initialize the new expiry field to a known value. Right now it
looks like we’re relying on zero to mean “not provided”, but since
TimestampTz value 0 is a valid timestamp (Postgres epoch), I’m wondering
whether it would be clearer to use an explicit invalid/sentinel value
instead.
I agree. The attached patch value is now initialised to
sentinel DT_NOBEGIN to indicate no expiry value has been provided yet.
>> Also, in the case where the validator returns an expiry that is already
in the past, should we reject the authentication immediately? Or is that
expected to be fully handled inside the validator module?
The design assumes that the Validator module will handle the immediate
rejection of tokens already in the past. The expiry field is intended for
the backend to manage session life after successful authentication
>> Finally, do you have a particular enforcement model in mind for
follow-up work (e.g., check at statement start, transaction boundaries, or
via some timeout mechanism)? It would help to understand how you see this
being used.
Ideally we should check this at statement start.
>> This API looks simple for providers that use JWT access tokens, but
what about providers that use opaque tokens and an introspection API
to check validity instead?
For providers using opaque tokens or introspection APIs where an 'exp'
claim might be missing, the API remains compatible by allowing the
validator to return DT_NOBEGIN.
Request a review.
Thanks & Best Regards,
Ajit
On Tue, 17 Feb 2026 at 01:10, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
wrote:
> Hello
>
> This API looks simple for providers that use JWT access tokens, but
> what about providers that use opaque tokens and an introspection API
> to check validity instead? Some validators might not be able to
> provide anything meaningful without a periodic call to a "check
> validity now" method, and even some providers that use JWT access
> tokens support immediate revocation, where these periodic checks would
> be useful.
>
| Attachment | Content-Type | Size |
|---|---|---|
| password_expiry_oauth_V1.diff | text/x-patch | 2.1 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | vignesh C | 2026-02-17 05:43:32 | Re: Skipping schema changes in publication |
| Previous Message | Noah Misch | 2026-02-17 05:15:57 | Re: AIX support |