XRDS Simple for Movable Type

| 1 Comment | 2 TrackBacks

DiSo is built on the idea of implementing social networking concepts on existing standards where possible. One of those standards is XRDS Simple, a service description and discovery format that is a part of several recent and upcoming standards including OpenID and OAuth. This weekend I decided to build a generalized service for Movable Type that implements XRDS.

XRDS Simple for Movable Type (version 0.1)

XRDS Simple for Movable Type implements XRDS Simple service discovery. New web services like OpenID and OAuth are encouraging the use of XRDS (eXtensible Resource Descriptor Sequence) (and specifically the new, simplified version) for service discovery.

XRDS Simple for Movable Type is a faceless application that gives plugins a way to register services to be advertised in the discovery document, similar to how plugins can register new streams with Mark’s Action Streams plugin.

Registering A Plugin’s Services

Sample configuration YAML:

xrds_services:
    openid2:
        type: http://specs.openid.net/auth/2.0/server
        # media_type:
        uri: http://endpoint.example.net
        namespace_id: openid
        namespace_uri: http://openid.net/xmlns/1.0
        priority: 10
        # local_id: http://redmonk.net
        local_id_handler: sub { "http://example.com" }

A plugin registers its services with XRDS Simple by including an xrds_services section in config.yaml. In that section are any number of service definitions, each listed under a unique identifier.

Within the service definition are a number of items which generally follow the XRDS Simple spec[1]. Of note are the namespace_id, namespace_uri, and local_id_handler.

Each service can register a namespace to be included in the xml declaration of the discovery document. The namespace_id and namespace_uri parameters are used to construct an xsmlns: attribute, like:

xmlns:openid="http://openid.net/xmlns/1.0"

XRDS also supports the concept of a local id - an identifier for this site or user on the service the discovery document points to. The local_id parameter will be added to the generated document in the service definition. Sometimes the local_id will need to be set programatically. In that case, pass in a coderef as local_id_handler.

local_id_handler: sub { "http://example.com" }

What’s it good for?

XRDS is developing as the discovery mechanism for a new generation of social applications. Eventually, Movable Type’s OpenID server and delegation could be changed to use this simpler yaml-based configuration, and let the plugin generate the appropriate XRDS document, instead of generating the document itself. As Movable Type begins to offer OAuth-based services, those too can be listed - per the OAuth Discovery spec.

Check it out

As this is a faceless application, and there are currently no services in MT using this code, this is really developer-preview code. Download and peruse the plugin - it’s very simple. I’d be interested in feedback on the code and the YAML format as well. Upcoming features include support for multiple Type and MediaType elements (per the spec), as well as support for passing a coderef for parameters instead of static values.

Download

Download XRDS Simple for Movable Type or check it out from the DiSo repository.

2 TrackBacks

TrackBack URL: http://redmonk.net/mt/mt-tb.cgi/419

from Movable Type Monday: TypePad AntiSpam, MTOS 4.2, New Plugins and Tutorials : The Blog Herald on June 3, 2008 8:19 AM
from XRDS-Simple On The Move : DiSo Project on June 4, 2008 4:25 PM

1 Comment

Excellent! This is great Steve -- can't wait to get some interop going between Movable Type and WordPress!

Leave a comment

R.E.M. Says:

About this Entry

This page contains a single entry by Steve published on May 27, 2008 7:39 PM.

Fascinating Feynman was the previous entry in this blog.

DiSo: XRDS on the move is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

OpenID accepted here Learn more about OpenID