Let meta.openid set X-XRDS-Location header
authormartin f. krafft <madduck@madduck.net>
Tue, 11 Mar 2008 13:00:30 +0000 (14:00 +0100)
committerJoey Hess <joey@kodama.kitenet.net>
Tue, 11 Mar 2008 19:51:11 +0000 (15:51 -0400)
Adds an optional xrds-location parameter to the openid meta handler,
which allows for XRDS delegation.

A good document on XRDS is
http://www.windley.com/archives/2007/05/using_xrds.shtml

Signed-off-by: martin f. krafft <madduck@madduck.net>
IkiWiki/Plugin/meta.pm
doc/plugins/meta.mdwn

index 2df5a727c08b28a029127f1fdff5b368ed56c7a1..b9886472250ba9e78194ff1ccdf05275979408a0 100644 (file)
@@ -145,6 +145,10 @@ sub preprocess (@) { #{{{
                        push @{$metaheaders{$page}}, '<link href="'.encode_entities($value).
                                '" rel="openid.delegate" />';
                }
+               if (exists $params{xrds-location} && safeurl($params{xrds-location})) {
+                       push @{$metaheaders{$page}}, '<meta http-equiv="X-XRDS-Location"'.
+                               'content="'.encode_entities($params{xrds-location}).'" />';
+               }
        }
        elsif ($key eq 'redir') {
                return "" if $page ne $destpage;
index b503e45112f029da47c2e185678e6660a8517cde..336c798065b2ce741954b5fcbfaccb5fa640f46a 100644 (file)
@@ -64,10 +64,15 @@ Supported fields:
 * openid
 
   Adds html &lt;link&gt; tags to perform OpenID delegation to an external
-  OpenID server. This lets you use an ikiwiki page as your OpenID. Example:
+  OpenID server. An optional `xrds-location` parameter lets you specify the
+  location of any [eXtensible Resource
+  DescriptorS](http://www.windley.com/archives/2007/05/using_xrds.shtml).
 
-       \\[[meta openid="http://joeyh.myopenid.com/"
-       server="http://www.myopenid.com/server"]]
+  This lets you use an ikiwiki page as your OpenID. Example:
+
+       \\[[meta openid="http://joeyh.myopenid.com/"
+       server="http://www.myopenid.com/server"
+       xrds-location="http://www.myopenid.com/xrds?username=joeyh.myopenid.com""]]
 
 * link