Package openid :: Package server :: Module trustroot
[frames | no frames]

Module openid.server.trustroot

This module contains the TrustRoot class, which helps handle trust root checking. This module is used by the openid.server.server module, but it is also available to server implementers who wish to use it for additional trust root checking.

It also implements relying party return_to URL verification, based on the realm.
Classes
TrustRoot This class represents an OpenID trust root.

Function Summary
[str] extractReturnToURLs(rp_uri, xrds_text)
Given a relying party discovery URL and its corresponding XRDS document, return a list of return_to URLs.
  returnToMatches(allowed_return_to_urls, return_to)
Is the return_to URL under one of the supplied allowed return_to URLs?
  verifyReturnTo(realm_str, return_to, _vrfy)
Verify that a return_to URL is valid for the given realm.

Function Details

extractReturnToURLs(rp_uri, xrds_text)

Given a relying party discovery URL and its corresponding XRDS document, return a list of return_to URLs.
Parameters:
rp_uri - The discovery URL
xrds_text - The xrds document, as a string
Returns:
A list of all relying party URLs that were found in the document.
           (type=[str])

returnToMatches(allowed_return_to_urls, return_to)

Is the return_to URL under one of the supplied allowed return_to URLs?

verifyReturnTo(realm_str, return_to, _vrfy=<function verifyWithRelyingPartyURL at 0x823fcdc>)

Verify that a return_to URL is valid for the given realm.

This function builds a discovery URL, performs Yadis discovery on it, makes sure that the URL does not redirect, parses out the return_to URLs, and finally checks to see if the current return_to URL matches the return_to.
Returns:
True if the return_to URL is valid for the realm
Raises:
DiscoveryFailure - When Yadis discovery fails

Generated by Epydoc 2.1 on Mon Aug 27 19:22:44 2007 http://epydoc.sf.net