On Mon, Feb 16, 2026 at 3:44 PM Ajit Awekar <[email protected]> wrote:

> Hi Hackers,
>
> Currently, during OAuth2 authentication,  the ValidatorModuleResult
> structure allows a validator(extension) to return the authentication status
> and the authn_id.
> However, we ignore the token expiry time (exp claim).
>
> Once a token is validated, the backend has no record of when that token
> actually expires. A session can remain open indefinitely even if the
> underlying access token has expired shortly after the connection was
> established.
>
> This patch adds the infrastructure to capture and store this expiration
> timestamp within the backend session state. It does not implement an
> enforcement policy (such as auto-termination).
>

Hi Ajit,

Thanks for working on this. Storing the token expiry in the backend session
state makes sense as groundwork for future enforcement.

I had a couple of questions while reading the patch.

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.

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?

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.

The change itself looks straightforward, just trying to clarify the
intended semantics.

Best regards,
Vasuki M
C-DAC,Chennai.

Reply via email to