MINOR: http_ext: add rfc7239_n2nn converter
authorAurelien DARRAGON <adarragon@haproxy.com>
Fri, 30 Dec 2022 15:45:42 +0000 (16:45 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 27 Jan 2023 14:18:59 +0000 (15:18 +0100)
commit07d6753c89b9e00b67f7dfb93dbfcfe5bf6259b5
tree49cb5000f79a54677aa2e9850527cb68fa2aba6c
parent6fb58b8c9d53e2d28a3085d6f583fa72d24daaae
MINOR: http_ext: add rfc7239_n2nn converter

Adding new http converter: rfc7239_n2nn.

Takes a string representing 7239 forwarded header node (extracted from
either 'for' or 'by' 7239 header fields) as input and translates it
to either ipv4 address, ipv6 address or str ('_' prefixed if obfuscated
or "unknown" if unknown), according to 7239RFC.

  Example:
    # extract 'for' field from forwarded header, extract nodename from
    # resulting node identifier and store the result in req.fnn
    http-request set-var(req.fnn) req.hdr(forwarded),rfc7239_field(for),rfc7239_n2nn
    #input: "for=\"127.0.0.1:9999\""
    #  output: 127.0.0.1
    #input: "for=\"_name:_port\""
    #  output: "_name"

Depends on:
  - "MINOR: http_ext: introduce http ext converters"
doc/configuration.txt
src/http_ext.c