[webfinger] Webfinger extension for Sinatra

Eric Mill <eric@konklone.com> Mon, 14 October 2013 20:32 UTC

Return-Path: <konklone@gmail.com>
X-Original-To: webfinger@ietfa.amsl.com
Delivered-To: webfinger@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E865721F9CAF for <webfinger@ietfa.amsl.com>; Mon, 14 Oct 2013 13:32:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.977
X-Spam-Level:
X-Spam-Status: No, score=-1.977 tagged_above=-999 required=5 tests=[AWL=-0.000, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, NO_RELAYS=-0.001]
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 W7ArfiDFcT7Y for <webfinger@ietfa.amsl.com>; Mon, 14 Oct 2013 13:32:39 -0700 (PDT)
Received: from mail-ea0-x230.google.com (mail-ea0-x230.google.com [IPv6:2a00:1450:4013:c01::230]) by ietfa.amsl.com (Postfix) with ESMTP id 703E921F9ADD for <webfinger@ietf.org>; Mon, 14 Oct 2013 13:32:39 -0700 (PDT)
Received: by mail-ea0-f176.google.com with SMTP id q16so3569970ead.7 for <webfinger@ietf.org>; Mon, 14 Oct 2013 13:32:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to:content-type; bh=u64FLq2F4bGpfjKwjKxoEjTt4IohEcAi3X/BndyEIj0=; b=Tuaty7IOHYGs8s9WWczwkvxsPPgqgmAdtF9FSPWKJJByHXYIEtR1ihJ/JuElkF518V dyOYWuRQU9tluxusvtq9ngAyVgqCjRhqDpvQgJH/+fqmflaOv/o9x+aWziAA1M3qzhKT RQbJjDKTQ4exGB7F1caFvwDi2suLyXBLTR6UOv4Jpyp2TBtKYdwPo3LZcvSLPQGKnGXQ drxSYc3VLdJ8d607fq59CxjInHVaVFhGLUzSK1QxfgNb43dUEzLfuyvps0sCEBMC6+TG 1frDWKWZ0EH+8iTNR3fysbVtvL7AGsDJr0CttksucsvbvRGsYXXYIJJ+oGtmlpzU/a58 xPWA==
X-Received: by 10.15.75.73 with SMTP id k49mr58330923eey.36.1381782758087; Mon, 14 Oct 2013 13:32:38 -0700 (PDT)
MIME-Version: 1.0
Sender: konklone@gmail.com
Received: by 10.223.167.69 with HTTP; Mon, 14 Oct 2013 13:31:56 -0700 (PDT)
From: Eric Mill <eric@konklone.com>
Date: Mon, 14 Oct 2013 16:31:56 -0400
X-Google-Sender-Auth: 57629vdX2tsRMmOXVDvUlDpbKec
Message-ID: <CANBOYLVDDc8yx52oA1dXrD6wThp+AzWy3mgXhYMNoQO7Y8ZaDQ@mail.gmail.com>
To: "webfinger@ietf.org" <webfinger@ietf.org>, webfinger@googlegroups.com
Content-Type: multipart/alternative; boundary=001a11c1af4c73e0ee04e8b95e82
Subject: [webfinger] Webfinger extension for Sinatra
X-BeenThere: webfinger@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Discussion of the Webfinger protocol proposal in the Applications Area <webfinger.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/webfinger>, <mailto:webfinger-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/webfinger>
List-Post: <mailto:webfinger@ietf.org>
List-Help: <mailto:webfinger-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/webfinger>, <mailto:webfinger-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 14 Oct 2013 20:32:41 -0000

Hi all,

I just wrote an extension for Sinatra, a popular Ruby-based microframework,
that adds a Webfinger endpoint for a given email address and set of
metadata:
https://github.com/konklone/sinatra-webfinger#a-webfinger-plugin-for-sinatra

The idea here is to lower the barrier to adding a Webfinger endpoint for
one's email, for people running Sinatra apps on their domain (like me). I'm
using this on my blog
here<https://konklone.com/.well-known/webfinger?resource=acct:eric@konklone.com>
.

It does a couple things I'd like your reaction to. For one, it auto-decides
whether data should be in "properties" or "links" based on whether the
value is a URL. For two, it lets you specify common short strings as keys,
and does the mapping to a URI for you, when there is one.

So this is the Ruby code:

webfinger "eric@konklone.com" => {
  name: "Eric Mill",
  website: "https://konklone.com"}

And this is what the endpoint will produce:

{
  "subject": "eric@konklone.com".com",
  "properties": {
    "http://schema.org/name": "Eric Mill"
  },
  "links": [
    {
      "rel": "http://webfinger.net/rel/profile-page",
      "href": "https://konklone.com"
    }
  ]}

I'm doing the mapping from field name to URI here:
https://github.com/konklone/sinatra-webfinger/blob/master/data/urns.yml based
on Will Norris' and Paul Jones' collections of URIs.

Next, I'd like to tackle an extension for Jekyll, and a generator for a
straight static file you can serve with a couple of lines in
nginx/Apache/S3. I'll probably follow the approach I'm taking here in
sinatra-webfinger as closely as possible, so, feedback very welcome!

-- Eric

-- 
konklone.com | @konklone <https://twitter.com/konklone>