author | Michael Krelin <hacker@klever.net> | 2008-03-01 16:14:55 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2008-03-01 16:14:55 (UTC) |
commit | fe00dd0be8fd88dc8179eed7a38663f07c1288a7 (patch) (unidiff) | |
tree | 7c16d78aef4f216192b197a37420ec9c0a77d2c4 | |
parent | d85adfb349b3c7a988bec21fcbad86f5f98c70de (diff) | |
download | foxri-fe00dd0be8fd88dc8179eed7a38663f07c1288a7.zip foxri-fe00dd0be8fd88dc8179eed7a38663f07c1288a7.tar.gz foxri-fe00dd0be8fd88dc8179eed7a38663f07c1288a7.tar.bz2 |
added more OpenID service types and handling of append='qxri' attribute
* added OpenID 1.1 and 2.0 service types to SERVICE_CLASSES
* append qxri to URI in presence of append='qxri' attribute (append='authority'
is yet to be handled)
* added more OpenID service type URIs to friendlyServiceName()
Signed-off-by: Michael Krelin <hacker@klever.net>
-rwxr-xr-x | src/components/xriProtocolHandler.js | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/components/xriProtocolHandler.js b/src/components/xriProtocolHandler.js index 1105874..3d27784 100755 --- a/src/components/xriProtocolHandler.js +++ b/src/components/xriProtocolHandler.js | |||
@@ -50,4 +50,7 @@ var SERVICE_CLASSES = { | |||
50 | 'xri://+i-service*(+contact)*($v*1.0)': 'i-contact', | 50 | 'xri://+i-service*(+contact)*($v*1.0)': 'i-contact', |
51 | 'http://openid.net/signon/1.0': 'openid', | 51 | 'http://openid.net/signon/1.0': 'openid', |
52 | 'http://openid.net/signon/1.1': 'openid', | ||
53 | 'http://specs.openid.net/auth/2.0/signon': 'openid', | ||
54 | 'http://specs.openid.net/auth/2.0/server': 'openid', | ||
52 | 'xri://$res*auth*($v*2.0)': 'res-auth', | 55 | 'xri://$res*auth*($v*2.0)': 'res-auth', |
53 | 'xri://+i-service*(+authn)*(+saml)*($v*1.0)': 'authn-saml', | 56 | 'xri://+i-service*(+authn)*(+saml)*($v*1.0)': 'authn-saml', |
@@ -238,8 +241,9 @@ function renderService(srv, doc, qxri) | |||
238 | 241 | ||
239 | 242 | ||
240 | res = runExpr(doc, srv, "xrd:URI/text()"); | 243 | res = runExpr(doc, srv, "xrd:URI"); |
241 | var u; | 244 | var uu; |
242 | while (u = res.iterateNext()) { | 245 | while (uu = res.iterateNext()) { |
243 | if (!u.nodeValue) | 246 | var u = uu.firstChild; |
247 | if (!(u.nodeValue && u.nodeType==3)) | ||
244 | continue; | 248 | continue; |
245 | 249 | ||
@@ -286,5 +290,12 @@ function renderService(srv, doc, qxri) | |||
286 | } | 290 | } |
287 | 291 | ||
288 | html_uris += "<a href=\""+u.nodeValue+"\">" | 292 | var linkhref = u.nodeValue; |
293 | var xrap = uu.getAttribute('append'); | ||
294 | if(xrap=='qxri') { | ||
295 | linkhref += qxri.replace(/^xri:\/\//,''); | ||
296 | }else if(xrap!=null){ | ||
297 | dump("Unhandled @append: "+xrap+"\n"); | ||
298 | } | ||
299 | html_uris += "<a href=\""+linkhref+"\">" | ||
289 | + linkContent + "</a>"; | 300 | + linkContent + "</a>"; |
290 | html_uris += "</div>"; | 301 | html_uris += "</div>"; |
@@ -393,5 +404,10 @@ function friendlyServiceName(srvType, uri) | |||
393 | return "Contact Service"; | 404 | return "Contact Service"; |
394 | } | 405 | } |
395 | else if (srvType && srvType == "http://openid.net/signon/1.0") { | 406 | else if (srvType && ( |
407 | srvType == "http://openid.net/signon/1.0" | ||
408 | || srvType == "http://openid.net/signon/1.1" | ||
409 | || srvType == "http://specs.openid.net/auth/2.0/signon" | ||
410 | || srcType == "http://specs.openid.net/auth/2.0/server" | ||
411 | ) ) { | ||
396 | return "OpenID Authentication Service"; | 412 | return "OpenID Authentication Service"; |
397 | } | 413 | } |