Re: [Txauth] Polymorphism (Was: JSON Schema?)

Dick Hardt <> Mon, 06 July 2020 21:19 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 34ED83A0B06 for <>; Mon, 6 Jul 2020 14:19:03 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Status: No, score=-2.098 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (2048-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id AuHazCeuXKxV for <>; Mon, 6 Jul 2020 14:19:01 -0700 (PDT)
Received: from ( [IPv6:2a00:1450:4864:20::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 8133C3A0B03 for <>; Mon, 6 Jul 2020 14:19:01 -0700 (PDT)
Received: by with SMTP id 9so47267187ljv.5 for <>; Mon, 06 Jul 2020 14:19:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3ZIq0SSh7b5K25vLdtmm3hu833hKf4jEz4Rlz7AajRM=; b=PwGz98Cwk6mp5HaJSvNhk+oAbkSVGZGDezmHyQXzFhYhvk8pmqRfqSc5V+23kKMo5N V35n4n3cNxRikRBvb26ARZ3kSwUesPbzeOj0TxspejZPRgZOw9wBRmvKlsqRVPC18ImF H4Xdsgt/vDm7HvaHZH7K+j1GuCyje6SArJvNGjkf6mrT7qbaFMA9z5F59xzQZHftfvro qXdAo5xfq2NeT2ljn4TqRs7/tuUUhYdR010ZOY4vKdqY/69od+iwKpCNgAJ/2sgaVlbH 4xxnu6RY2NRfmPWgIRSdf8wSAqhfv3GApsQS+gEhGQ3BS1Ab9S+znGa+Y2o4R9DK8RTi SSyw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3ZIq0SSh7b5K25vLdtmm3hu833hKf4jEz4Rlz7AajRM=; b=kCiaz4y/UmytyNvDJIuCXtDHz9JrMNaln417P/jFM4qMYEU/kBC9eZ0t9rW4Jh+Er/ NmPudgQMP7M3URR+gG2ucuL5RtV0Y4iGH6ojXvPTfZeisbnjcLQIXGAh/kHofFIkkXfI HtbZ9ytx68dDZNuvvDvsfW5fZUa5Bisi03I0aSm4i5u7yyxcOIGRPpI/ytW9bdNTndri r5zx3Px3XF5KG+JJ0Vn+c8AEQDZgjWApVz/a8T0roWCs9v95LTTBIPdiHRPXB2ivPaXh P2Wn4CigwIfCDX8vXpcFh+12Hv6IZ7RgtrbUKyHU4u50mJ0kgpoTJFgi6o04s+p6+Sea 5KQg==
X-Gm-Message-State: AOAM530VFM5+t0rZsj25j0jOtp+rcwJ9dUFnc38R78DpgwcvV1TDogVy Frp0hhzHwR1ZDVOoA+4m0lU8VBz6fe76o8AglVo=
X-Google-Smtp-Source: ABdhPJw6r8KRO5ROCw0hmvs/VVlBtcw17I4DXLSccf7cX520IBxKVFV+yfscWFw3tlKddrocKhzmJpvCIMVZDL7gwxE=
X-Received: by 2002:a2e:9611:: with SMTP id v17mr16723460ljh.110.1594070339498; Mon, 06 Jul 2020 14:18:59 -0700 (PDT)
MIME-Version: 1.0
References: <> <> <> <>
In-Reply-To: <>
From: Dick Hardt <>
Date: Mon, 6 Jul 2020 14:18:23 -0700
Message-ID: <>
To: Justin Richer <>
Content-Type: multipart/alternative; boundary="0000000000005535a605a9cc6c84"
Archived-At: <>
Subject: Re: [Txauth] Polymorphism (Was: JSON Schema?)
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Mon, 06 Jul 2020 21:19:03 -0000

I agree with:

"I think polymorphism should be one of the tools in consideration from the

I was disagreeing with the 'should' in:

"GNAP should make use of a polymorphic protocol structure"

On Mon, Jul 6, 2020 at 2:15 PM Justin Richer <> wrote:

> I once felt that way, too, and the first few iterations of XYZ did not use
> polymorphism. But I found, through hands-on experience, that it solves many
> more problems than it creates. I think that JWT didn’t quite do it because
> there was one limited place in the spec that used the feature — it was the
> exception, not a core part of the data model. And, JWT implementations that
> don’t expect an array in “aud” aren’t compliant, after all.
> This is obviously an implementation detail for the WG to debate, and I
> think polymorphism should be one of the tools in consideration from the
> start.
>  — Justin
> On Jul 6, 2020, at 4:41 PM, Dick Hardt <> wrote:
> Responding to Justin's polymorphism comments ...
> On Mon, Jul 6, 2020 at 12:54 PM Justin Richer <> wrote:
>> Polymorphism in the protocol is an important part of the XYZ proposal’s
>> design, and as a feature it directly addresses a number of the items you
>> found when doing your XAuth implementation, like parsing OAuth scopes and
>> dealing with the authorization/authorizations mutually-exclusive oddness
>> that you mentioned. I strongly believe that GNAP should make use of a
>> polymorphic protocol structure for these and other reasons. Polymorphism is
>> a built-in feature of the JSON data model, and it’s also fully possible to
>> support under CBOR and other data serialization languages. Even JWT most
>> famously uses polymorphism for the “aud” field, which can be a string or an
>> array of strings depending on context, all with clear semantics.
>  I strongly disagree with "GNAP should make use of a polymorphic protocol
> structure"
> We should use it only if we really need it, and it makes implementations
> simpler. I personally don't think it accomplished that in JWT with the
> audience. I would bet there is a fair amount of code that does not check if
> the 'aud' property is an array, it just assumes it is a string.
> wrt. my authorization / authorizations oddness, polymorphism would not
> solve it as the contents of both authorization / authorizations in XAuth
> are objects.
> /Dick