TYPO3 CMS  TYPO3_6-2
Auth_OpenID_TrustRoot Class Reference

Static Public Member Functions

static buildDiscoveryURL ($realm)
 
static _parse ($trust_root)
 
static isSane ($trust_root)
 
static match ($trust_root, $url)
 

Detailed Description

A wrapper for trust-root related functions

Definition at line 47 of file TrustRoot.php.

Member Function Documentation

◆ _parse()

static Auth_OpenID_TrustRoot::_parse (   $trust_root)
static

Parse a URL into its trust_root parts.

private

Parameters
string$trust_rootThe url to parse
Returns
mixed $parsed Either an associative array of trust root parts or false if parsing failed.

Definition at line 94 of file TrustRoot.php.

Referenced by Auth_OpenID_returnToMatches(), buildDiscoveryURL(), Auth_OpenID_CheckIDRequest\make(), and Auth_OpenID_CheckIDRequest\trustRootValid().

◆ buildDiscoveryURL()

static Auth_OpenID_TrustRoot::buildDiscoveryURL (   $realm)
static

◆ isSane()

static Auth_OpenID_TrustRoot::isSane (   $trust_root)
static

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 '*.foo.com' is. '*.co.uk' is not sane, but '*.bbc.co.uk' 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, 'kink.fm' 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.

Parameters
string$trust_rootThe trust root to check
Returns
bool $sanity Whether the trust root looks OK

Definition at line 200 of file TrustRoot.php.

Referenced by buildDiscoveryURL().

◆ match()

static Auth_OpenID_TrustRoot::match (   $trust_root,
  $url 
)
static

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.

Parameters
string$trust_rootThe trust root to match against
string$urlThe URL to check
Returns
bool $matches Whether the URL matches against the trust root

Definition at line 270 of file TrustRoot.php.

Referenced by Auth_OpenID_AX_FetchRequest\Auth_OpenID_AX_FetchRequest(), Auth_OpenID_returnToMatches(), buildDiscoveryURL(), and Auth_OpenID_CheckIDRequest\trustRootValid().