You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@trafficserver.apache.org by Masakazu Kitajo <ma...@apache.org> on 2025/07/14 23:54:26 UTC

[API Proposal] TSHttpTxnVerifiedAddrSet/Get

I'd like to propose a pair of new TS APIs below.

TSReturnCode TSHttpTxnVerifiedAddrSet(TSHttpTxn txnp, const struct sockaddr
*addr);
TSReturnCode TSHttpTxnVerifiedAddrGet(TSHttpTxn txnp, const struct sockaddr
**addr);

The motivation is to enable plugins to provide client's "real" IP address
for ATS core and other plugins. Plugins that use the setter function are
expected to read clien's real IP address from somewhere (e.g. Forwarded
header field), and also check the validity. If a plugin successfully
verifies client's IP address, it may call the setter function for later
use. The IP address set by a plugin will be used by ATS remap ACL, and
other plugins which call the getter function, if they are configured to do
so.

Pull Request:
https://github.com/apache/trafficserver/pull/12359

-- Masakazu

Re: [API Proposal] TSHttpTxnVerifiedAddrSet/Get

Posted by Leif Hedstrom <zw...@apache.org>.
+1.

These would be good additions to add to plugins such as HRW and TxnBox, and
of course we’ll add it to Cripts when available :).

— Leif


On Mon, Jul 14, 2025 at 17:54 Masakazu Kitajo <ma...@apache.org> wrote:

> I'd like to propose a pair of new TS APIs below.
>
> TSReturnCode TSHttpTxnVerifiedAddrSet(TSHttpTxn txnp, const struct sockaddr
> *addr);
> TSReturnCode TSHttpTxnVerifiedAddrGet(TSHttpTxn txnp, const struct sockaddr
> **addr);
>
> The motivation is to enable plugins to provide client's "real" IP address
> for ATS core and other plugins. Plugins that use the setter function are
> expected to read clien's real IP address from somewhere (e.g. Forwarded
> header field), and also check the validity. If a plugin successfully
> verifies client's IP address, it may call the setter function for later
> use. The IP address set by a plugin will be used by ATS remap ACL, and
> other plugins which call the getter function, if they are configured to do
> so.
>
> Pull Request:
> https://github.com/apache/trafficserver/pull/12359
>
> -- Masakazu
>

Re: [API Proposal] TSHttpTxnVerifiedAddrSet/Get

Posted by Leif Hedstrom <zw...@apache.org>.
+1.

These would be good additions to add to plugins such as HRW and TxnBox, and
of course we’ll add it to Cripts when available :).

— Leif


On Mon, Jul 14, 2025 at 17:54 Masakazu Kitajo <ma...@apache.org> wrote:

> I'd like to propose a pair of new TS APIs below.
>
> TSReturnCode TSHttpTxnVerifiedAddrSet(TSHttpTxn txnp, const struct sockaddr
> *addr);
> TSReturnCode TSHttpTxnVerifiedAddrGet(TSHttpTxn txnp, const struct sockaddr
> **addr);
>
> The motivation is to enable plugins to provide client's "real" IP address
> for ATS core and other plugins. Plugins that use the setter function are
> expected to read clien's real IP address from somewhere (e.g. Forwarded
> header field), and also check the validity. If a plugin successfully
> verifies client's IP address, it may call the setter function for later
> use. The IP address set by a plugin will be used by ATS remap ACL, and
> other plugins which call the getter function, if they are configured to do
> so.
>
> Pull Request:
> https://github.com/apache/trafficserver/pull/12359
>
> -- Masakazu
>