Re: [Captive-portals] API access and .well-known

Erik Kline <ek@google.com> Wed, 24 January 2018 01:44 UTC

Return-Path: <ek@google.com>
X-Original-To: captive-portals@ietfa.amsl.com
Delivered-To: captive-portals@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A74E3124205 for <captive-portals@ietfa.amsl.com>; Tue, 23 Jan 2018 17:44:31 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.711
X-Spam-Level:
X-Spam-Status: No, score=-2.711 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=google.com
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 y5x4_6iZ571U for <captive-portals@ietfa.amsl.com>; Tue, 23 Jan 2018 17:44:29 -0800 (PST)
Received: from mail-yw0-x230.google.com (mail-yw0-x230.google.com [IPv6:2607:f8b0:4002:c05::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5DE16120047 for <captive-portals@ietf.org>; Tue, 23 Jan 2018 17:44:29 -0800 (PST)
Received: by mail-yw0-x230.google.com with SMTP id m84so948539ywd.5 for <captive-portals@ietf.org>; Tue, 23 Jan 2018 17:44:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=4xuSW1RMaTTfRui6DPg2YRUcZ6W3d3WmA4dhRvvheMY=; b=D0NfdleCUcMVVqGLRA1L6FP+AN74abnmDVXmZSDz3UFBYS7Lp4RQ6Y+0CaMi03P1Kr +9/u5HEhToMstIrIm+hfhPe4gCW3R029T/r6AmQJr38BWA2Kv+KbfUkMONYDD80/0LJv UTmxaoxW5Q31UBUwDaP+1gi3KL7EJxG+1Yq9ZYkQXyJQii0UCfCyzV0lJfAZSvKUmGol LTh//2hl0Bz8v1WvpslEoG4EPw4rsog6bxNpWHpJ7dIYVEAQXwH97R9jvPTHvxBDggiV /ci/sSTus7LHEmwxV/XE27g4Bps+r4Yk9SDDo5CBuajFBp4Xv8bgM43piKNWH/Zihico P5Kg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=4xuSW1RMaTTfRui6DPg2YRUcZ6W3d3WmA4dhRvvheMY=; b=q7sGFo2myy++HlU2W0xutGj1Onxkr3okNoSKNrYvHfnPigJqsmzYWCRovkCqiMwnx0 kUhlZ+REmgfzh0gGz2Jip7edmvtcgSfnTrp0ouyHBcZHgPGFb6/lIOx8WNTr9iC5IeSt Xe0bq/0hi55J+FhWJMm9dFEsytmYiccxn35k31JIakTpFeyhEDa8BKM9ZzlrUYMXZR/5 Y3jqKZeev+Z77rSJgajzjcBsiB0w+cr49Eb40updyXaDwW28RBeH3XIahoe4w+E696QR MYA912stHgv54SxjBu8VuvGDVtGeAW1XZuGaGrEW1ljF1zWZVMalF/Hy/c4I+OGMm8HB iR3w==
X-Gm-Message-State: AKwxytfYKDKJObs/32SG19OmHJX0mlkXW8+qOWhsHOPDrBTD82dk1guQ dGTHnKPtj2VdR7I0M2xqst0vjSUkKWWevwlwMLBX/tHv
X-Google-Smtp-Source: AH8x224DT63LlAeqAnQ95Zos9JUipltxGk5TxZERkUeIhw0FQQyV+uuJJCUqMShrFm4ph9czu49X5Iex998+cYb+oPM=
X-Received: by 10.129.196.8 with SMTP id j8mr4216216ywi.260.1516758268176; Tue, 23 Jan 2018 17:44:28 -0800 (PST)
MIME-Version: 1.0
Received: by 10.37.207.148 with HTTP; Tue, 23 Jan 2018 17:44:07 -0800 (PST)
In-Reply-To: <CABkgnnVUXvHy6tFar5JBYo7BYoFpC-XjmuOwoagZN2gPJHwR5g@mail.gmail.com>
References: <CABkgnnWc-FAO5mk8kM2h3gntRkizSuH1Ax0puKkidWDTtSp7SQ@mail.gmail.com> <e484feac-dd9f-a5b6-5f8b-9537e96773f5@nostrum.com> <CABkgnnVUXvHy6tFar5JBYo7BYoFpC-XjmuOwoagZN2gPJHwR5g@mail.gmail.com>
From: Erik Kline <ek@google.com>
Date: Wed, 24 Jan 2018 10:44:07 +0900
Message-ID: <CAAedzxq7aKGxgaRHRYLGt6Sn+k1ZRnYLydKyT3yWkG15CVywog@mail.gmail.com>
To: Martin Thomson <martin.thomson@gmail.com>
Cc: Adam Roach <adam@nostrum.com>, captive-portals@ietf.org
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg="sha-256"; boundary="94eb2c1a9094d23e2f05637bcd92"
Archived-At: <https://mailarchive.ietf.org/arch/msg/captive-portals/qCzCqdL-DYtS8pkRwY7Ybm2FShA>
Subject: Re: [Captive-portals] API access and .well-known
X-BeenThere: captive-portals@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Discussion of issues related to captive portals <captive-portals.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/captive-portals>, <mailto:captive-portals-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/captive-portals/>
List-Post: <mailto:captive-portals@ietf.org>
List-Help: <mailto:captive-portals-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/captive-portals>, <mailto:captive-portals-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 24 Jan 2018 01:44:32 -0000

<hat-free>

I quite like this option.  If we use this approach then it seems to me
host-side implementations can choose their level of support, right?

    [A] super basic HTML view interaction

Makes a GET for the RFC 7710 URL, ignores any Link relation, serves up
the HTML to the human.

    [B] HTML + Link support

Makes a GET for the RFC 7710 URL, notices the Link relate, and starts
a connection to the API endpoint for not really too much more cost
than following a 3xx redirect (especially if the HTML is structured
such that a webview would need to fetch lots of extra resources, which
the API-following code path could avoid loading).

    [C] some kind of clever HTML + Link support

Makes a HEAD for the RFC 7710 URL.  If there is no Link header try to
re-use the existing TCP connection to issue a GET and serve HTML to
the human.  If there is a Link relation, start a connection to the API
endpoint.

Do I understand things correctly, is this reasonable?

On 17 January 2018 at 11:16, Martin Thomson <martin.thomson@gmail.com> wrote:
> Right, I neglected to mention that option.  Call it (d) link relations.
>
> You might also do the reverse in the API-first arrangement that Tommy
> suggests (API at the URL, HTML at the other end of a link relation).
> It seems likely that 7710 deployment is scant enough that we would be
> free to make this decision without being constrained to deal with
> backwards compatibility.
>
> One likely deployment involves the thing that is configured being
> different to the thing that ultimately serves the content (for reasons
> of sorting out the UE identification, if nothing else), so it's
> possible that Adam's suggestion here doesn't add round trips that
> weren't already needed.
>
> On Wed, Jan 17, 2018 at 9:44 AM, Adam Roach <adam@nostrum.com> wrote:
>> [as an individual]
>>
>> I agree that we should strictly avoid synthesizing URLs in general, and
>> should try to avoid .well-known URLs in particular. Sometimes you're forced
>> to use .well-known (e.g., when there's literally no way to get a full URL to
>> the client), but that doesn't seem to be the case here.
>>
>>
>> On 1/14/18 11:39 PM, Martin Thomson wrote:
>>
>> a. use .well-known and just provide better justification for it
>> b. use content negotiation
>> c. find some way to get two URIs, like revising 7710 or finding an
>> alternative mechanism (such as the one in RFC 5986)
>>
>>
>> For what it's worth, I don't think (a) is possible -- I don't believe any
>> plausible justification text can be put together that explains why other
>> approaches are infeasible.
>>
>> Something else to consider is serving up the HTML portal on the endpoint you
>> get from RFC7710, and including a link-relation [RFC5988] header field that
>> points to the API; e.g.:
>>
>>
>> HTTP/1.1 200 OK
>> Link: <https://portal-api.example.com/json/>;rel="capport-api"
>> Content-Type: text/html
>>
>> <!DOCTYPE html PUBLIC ...
>> <html>...
>> [legacy portal page goes here]...
>> </html>
>>
>>
>> Importantly: clients interested only in the API can simply perform a HEAD
>> rather than a GET to retrieve the Link information. I'll note that this
>> provides a clear extension point if you decide you need yet a third thing to
>> be discoverable and/or need different HTTP endpoints for versioning in the
>> future. I do note that it requires an additional round trip, similar to the
>> redirection approach that has been discussed in conjunction with content
>> negotiation. Notably, taking this approach eliminates the need for
>> redirects, since the link header can point to any arbitrary URL.
>>
>> /a
>
> _______________________________________________
> Captive-portals mailing list
> Captive-portals@ietf.org
> https://www.ietf.org/mailman/listinfo/captive-portals