[OAUTH-WG] Namespacing "type" in RAR

Justin Richer <jricher@mit.edu> Fri, 17 July 2020 15:38 UTC

Return-Path: <jricher@mit.edu>
X-Original-To: oauth@ietfa.amsl.com
Delivered-To: oauth@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E81773A0788 for <oauth@ietfa.amsl.com>; Fri, 17 Jul 2020 08:38:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.92
X-Spam-Level:
X-Spam-Status: No, score=-1.92 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2bXCJ5c0APYC for <oauth@ietfa.amsl.com>; Fri, 17 Jul 2020 08:38:54 -0700 (PDT)
Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1A3E43A0772 for <oauth@ietf.org>; Fri, 17 Jul 2020 08:38:53 -0700 (PDT)
Received: from [192.168.1.7] (static-71-174-62-56.bstnma.fios.verizon.net [71.174.62.56]) (authenticated bits=0) (User authenticated as jricher@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 06HFcqlc024111 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for <oauth@ietf.org>; Fri, 17 Jul 2020 11:38:52 -0400
From: Justin Richer <jricher@mit.edu>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\))
Message-Id: <E9F67961-B83D-40EF-A9CC-F3E4B495379F@mit.edu>
Date: Fri, 17 Jul 2020 11:38:52 -0400
To: oauth <oauth@ietf.org>
X-Mailer: Apple Mail (2.3608.80.23.2.2)
Archived-At: <https://mailarchive.ietf.org/arch/msg/oauth/lYP8VhnMjDga1YZOCh1C7ssUNCo>
Subject: [OAUTH-WG] Namespacing "type" in RAR
X-BeenThere: oauth@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: OAUTH WG <oauth.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/oauth>, <mailto:oauth-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/oauth/>
List-Post: <mailto:oauth@ietf.org>
List-Help: <mailto:oauth-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/oauth>, <mailto:oauth-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Jul 2020 15:38:57 -0000

The “type” field in the RAR spec serves an important purpose: it defines what goes in the rest of the object, including what other fields are available and what values are allowed for those fields. It provides an API-level definition for requesting access based on multiple dimensions, and that’s really powerful and flexible. Each type can use any of the general-purpose fields like “actions” and/or add its own fields as necessary, and the “type” parameter keeps everything well-defined.

The question, then, is what defines what’s allowed to go into the “type” field itself? And what defines how that value maps to the requirements for the rest of the object? The draft doesn’t say anything about it at the moment, but we should choose the direction we want to go. On the surface, there are three main options:

1) Require all values to be registered. 
2) Require all values to be collision-resistant (eg, URIs).
3) Require all values to be defined by the AS (and/or the RS’s that it protects).

Are there any other options?

Here are my thoughts on each approach:

1) While it usually makes sense to register things for interoperability, this is a case where I think that a registry would actually hurt interoperability and adoption. Like a “scope” value, the RAR “type” is ultimately up to the AS and RS to interpret in their own context. We :want: people to define rich objects for their APIs and enable fine-grained access for their systems, and if they have to register something every time they come up with a new API to protect, it’s going to be an unmaintainable mess. I genuinely don’t think this would scale, and that most developers would just ignore the registry and do what they want anyway. And since many of these systems are inside domains, it’s completely unenforceable in practice.

2) This seems reasonable, but it’s a bit of a nuisance to require everything to be a URI here. It’s long and ugly, and a lot of APIs are going to be internal to a given group, deployment, or ecosystem anyway. This makes sense when you’ve got something reusable across many deployments, like OIDC, but it’s overhead when what you’re doing is tied to your environment.

3) This allows the AS and RS to define the request parameters for their APIs just like they do today with scopes. Since it’s always the combination of “this type :AT: this AS/RS”, name spacing is less of an issue across systems. We haven’t seen huge problems in scope value overlap in the wild, though it does occur from time to time it’s more than manageable. A client isn’t going to just “speak RAR”, it’s going to be speaking RAR so that it can access something in particular.

And all that brings me to my proposal: 

4) Require all values to be defined by the AS, and encourage specification developers to use URIs for collision resistance.

So officially in RAR, the AS would decide what “type” means, and nobody else. But we can also guide people who are developing general-purpose interoperable APIs to use URIs for their RAR “type” definitions. This would keep those interoperable APIs from stepping on each other, and from stepping on any locally-defined special “type” structure. But at the end of the day, the URI carries no more weight than just any other string, and the AS decides what it means and how it applies.

My argument is that this seems to have worked very, very well for scopes, and the RAR “type” is cut from similar descriptive cloth.

What does the rest of the group think? How should we manage the RAR “type” values and what they mean?

 — Justin