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

Dick Hardt <> Mon, 06 July 2020 20:41 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 2879E3A0A8B for <>; Mon, 6 Jul 2020 13:41:54 -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 mURADvjcuHGF for <>; Mon, 6 Jul 2020 13:41:52 -0700 (PDT)
Received: from ( [IPv6:2a00:1450:4864:20::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 69C523A0A87 for <>; Mon, 6 Jul 2020 13:41:52 -0700 (PDT)
Received: by with SMTP id e8so12903318ljb.0 for <>; Mon, 06 Jul 2020 13:41:52 -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=fQ/aRR0rixwXJ9hpBo21V+Tf1uuSZeRGIg4OU/4nISI=; b=gRThaIguTojpqM0PTQ7UHfONngPERoHYgU7g2UoLbqx1zBSQCfbhQQjJVMMVNLwQ43 cmGsxV7PuSu2vnaSu5+el5mzePWunA1qv5uW/SAbt9ATWrh0YyXKX/MDkxeqvHZHKD8Z 3DzOwQob3D2e6QOeN2zcu6iK1CISmpZhcZlgyn5cmyEAwKZ4imZtsGS63f7THo1JDxOC A84UCzQH32hUQ/u9avbkT5kcX9kKtPmf520a3OtBqJc1G/3D+B/BJIoil3zjOqygCjjd Tk2L02RXy3EP2+QKZs6kfiw/NqsXPRq59av3iQQaKhp/vH0JhjyAycMwlnYDLKBKMJNO oVUQ==
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=fQ/aRR0rixwXJ9hpBo21V+Tf1uuSZeRGIg4OU/4nISI=; b=HGKZxR5RkxCN3NUeuMdeBdEB24nbEPHCAcbjV/sYSBH3iZ0edBUofRu7daBcfA9kJO EMGBv+ufHAQjDJj+d6GcxHumqt/7GFK82v5jBVYC828so/2qfLOq/Ls3/YiCSWy69NbN 5WoctMtT8txzeXAyi9u0ahFGisx6FeNFL60ORzzYWf9plZWr/JF4eU53fKX0SZIBIuzt S/GjhKLe673lgd3BtEfDoiwaQzxneuqNz+HOGwoYAwqC7RZGtp3jwKF1qaDWOZ08MPi2 IptlFDTW+qT6yOSNlupwtdmSuOi67fV+Yng8+lnEgUBnjeBFplqjZa0DRQtyKkZTDiww zIsQ==
X-Gm-Message-State: AOAM533s3QfbZr9tKBeASufz63+Cb67Ed1air8zUsRELS00j7oJCoyPm LVvSD+AQjfImbWGjkFaKlvki/1wKZF6vy6LH618=
X-Google-Smtp-Source: ABdhPJxisZjjhhmOX1X8JGZnJAcrTmZSNJQKwkAOx2D1vKrriWzh6ceNxWWdGWGexgU/6JH6+DX4ux85Bys7uQkU2Oc=
X-Received: by 2002:a2e:7f10:: with SMTP id a16mr29525338ljd.69.1594068110439; Mon, 06 Jul 2020 13:41:50 -0700 (PDT)
MIME-Version: 1.0
References: <> <>
In-Reply-To: <>
From: Dick Hardt <>
Date: Mon, 6 Jul 2020 13:41:14 -0700
Message-ID: <>
To: Justin Richer <>
Content-Type: multipart/alternative; boundary="0000000000007879ce05a9cbe794"
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 20:41:55 -0000

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

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.