Re: [apps-discuss] I-D Action: draft-ietf-appsawg-http-forwarded-01.txt

Julian Reschke <julian.reschke@gmx.de> Fri, 30 March 2012 10:01 UTC

Return-Path: <julian.reschke@gmx.de>
X-Original-To: apps-discuss@ietfa.amsl.com
Delivered-To: apps-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 94B0621F8965 for <apps-discuss@ietfa.amsl.com>; Fri, 30 Mar 2012 03:01:36 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -104.079
X-Spam-Level:
X-Spam-Status: No, score=-104.079 tagged_above=-999 required=5 tests=[AWL=-1.480, BAYES_00=-2.599, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WN6CU3UshXel for <apps-discuss@ietfa.amsl.com>; Fri, 30 Mar 2012 03:01:35 -0700 (PDT)
Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.22]) by ietfa.amsl.com (Postfix) with SMTP id 7176E21F8971 for <apps-discuss@ietf.org>; Fri, 30 Mar 2012 03:01:35 -0700 (PDT)
Received: (qmail invoked by alias); 30 Mar 2012 10:01:29 -0000
Received: from mail.greenbytes.de (EHLO [IPv6:::1]) [217.91.35.233] by mail.gmx.net (mp004) with SMTP; 30 Mar 2012 12:01:29 +0200
X-Authenticated: #1915285
X-Provags-ID: V01U2FsdGVkX194Sc0fbK14UaTlkM2m7kMrAnVhHTV043x3rFaKOf 6sdfq0Vjf1r/SK
Message-ID: <4F758476.4020003@gmx.de>
Date: Fri, 30 Mar 2012 12:01:26 +0200
From: Julian Reschke <julian.reschke@gmx.de>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120312 Thunderbird/11.0
MIME-Version: 1.0
To: Andreas Petersson <andreas@sbin.se>
References: <20120326151030.7902.33251.idtracker@ietfa.amsl.com> <20120326173417.6058d1f6@hetzer> <CABkgnnW1ZaTYDSBX5qc9TBovszR5i2RUEPvBAHr87by8MwSwEA@mail.gmail.com> <4F71721A.7010301@gmx.de> <20120327160343.45e7e832@hetzer> <4F71CEDA.50502@gmx.de>
In-Reply-To: <4F71CEDA.50502@gmx.de>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
X-Y-GMX-Trusted: 0
Cc: apps-discuss@ietf.org
Subject: Re: [apps-discuss] I-D Action: draft-ietf-appsawg-http-forwarded-01.txt
X-BeenThere: apps-discuss@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: General discussion of application-layer protocols <apps-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/apps-discuss>
List-Post: <mailto:apps-discuss@ietf.org>
List-Help: <mailto:apps-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 30 Mar 2012 10:01:36 -0000

On 2012-03-27 16:29, Julian Reschke wrote:
> ...

OK, details...:

>        Forwarded   = "Forwarded" ":" LWS Forwarded-v
>        Forwarded-v = 1#forwarded-element

If you use RFC2616ABNF, the LWS isn't needed here.

(If you did switch to base this on HTTPbis, I would recommend just to 
define the *value* ABNF).

>        forwarded-element =
>                OWS forwarded-value *( OWS ";" OWS forwarded-value ) OWS

I would recommend to allow leading and trailing ";"; if you don't you 
will end up with some recipients allowing them (because it's the 
simplest way to parse it) and some not doing so.

Thus:

        forwarded-element =
            [ forwarded-value ] *( ";" [ forwarded-value ] )

Also OWS isn't needed here if you use RFC2616ABNF.

(see similar discussion in websec)

>        forwarded-value   = for-kv | by-kv | proto-kv | host-kv | ext-kv
>
>        for-kv     = "for=" node
>        by-kv      = "by="  node
>        proto-kv   = "proto=" proto-name
>        host-kv    = "host=" host
>        ext-kv     =  extension "=" ext-value
>        proto-name = ALPHA *( ALPHA | DIGIT | "+" | "-" | "." )

I would change this to

    forwarded-element = token "=" value
    value             = token / quoted-string

And then define the various values independently of the base ABNF.

Example:

The syntax of a "for" value, after potential quoted-string unescaping, 
MUST conform to the "node" ABNF.

(Also, it's kind of weird to use the name "value" for something that is 
not the right-hand side of a name/value pair; would be good to make 
"forwarded-value" something else)

Finally:

>        extension = 1*( ALPHA | DIGIT | "-" )
>        ext-value = <any OCTET except CTLs, "," and ";",
>          but including SP>

This should be

   extension = token
   ext-value = token | quoted-string

for consistency with all the other values.

Best regards, Julian