Class Auth_OpenID_TrustRoot


A wrapper for trust-root related functions

Located in /Auth/OpenID/TrustRoot.php (line 49)

Method Summary
 static void buildDiscoveryURL ( $realm)
 static bool isSane (string $trust_root)
 static bool match (string $trust_root, string $url)
static buildDiscoveryURL (line 61)
void buildDiscoveryURL ( $realm)
  • $realm
static isSane (line 202)

Is this trust root sane?

A trust root is sane if it is syntactically valid and it has a reasonable domain name. Specifically, the domain name must be more than one level below a standard TLD or more than two levels below a two-letter tld.

For example, '*.com' is not a sane trust root, but '*' is. '*' is not sane, but '*' is.

This check is not always correct, but it attempts to err on the side of marking sane trust roots insane instead of marking insane trust roots sane. For example, '' is marked as insane even though it "should" (for some meaning of should) be marked sane.

This function should be used when creating OpenID servers to alert the users of the server when a consumer attempts to get the user to accept a suspicious trust root.

  • return: Whether the trust root looks OK
bool isSane (string $trust_root)
  • string $trust_root: The trust root to check
static match (line 272)

Does this URL match the given trust root?

Return whether the URL falls under the given trust root. This does not check whether the trust root is sane. If the URL or trust root do not parse, this function will return false.

  • return: Whether the URL matches against the trust root
bool match (string $trust_root, string $url)
  • string $trust_root: The trust root to match against
  • string $url: The URL to check

Documentation generated on Thu, 29 Jul 2010 13:59:36 -0700 by phpDocumentor 1.4.3