[ZF-10089] Zend_Log
[zend/radio.git] / library / Zend / OpenId / Provider / Storage.php
blob61ed0ebfd86cf93069ebc948b81a256d76a1ca9a
1 <?php
3 /**
4 * Zend Framework
6 * LICENSE
8 * This source file is subject to the new BSD license that is bundled
9 * with this package in the file LICENSE.txt.
10 * It is also available through the world-wide-web at this URL:
11 * http://framework.zend.com/license/new-bsd
12 * If you did not receive a copy of the license and are unable to
13 * obtain it through the world-wide-web, please send an email
14 * to license@zend.com so we can send you a copy immediately.
16 * @category Zend
17 * @package Zend_OpenId
18 * @subpackage Zend_OpenId_Provider
19 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
20 * @license http://framework.zend.com/license/new-bsd New BSD License
21 * @version $Id$
24 /**
25 * Abstract class to implement external storage for OpenID consumer
27 * @category Zend
28 * @package Zend_OpenId
29 * @subpackage Zend_OpenId_Provider
30 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
31 * @license http://framework.zend.com/license/new-bsd New BSD License
33 abstract class Zend_OpenId_Provider_Storage
36 /**
37 * Stores information about session identified by $handle
39 * @param string $handle assiciation handle
40 * @param string $macFunc HMAC function (sha1 or sha256)
41 * @param string $secret shared secret
42 * @param string $expires expiration UNIX time
43 * @return void
45 abstract public function addAssociation($handle, $macFunc, $secret, $expires);
47 /**
48 * Gets information about association identified by $handle
49 * Returns true if given association found and not expired and false
50 * otherwise
52 * @param string $handle assiciation handle
53 * @param string &$macFunc HMAC function (sha1 or sha256)
54 * @param string &$secret shared secret
55 * @param string &$expires expiration UNIX time
56 * @return bool
58 abstract public function getAssociation($handle, &$macFunc, &$secret, &$expires);
60 /**
61 * Register new user with given $id and $password
62 * Returns true in case of success and false if user with given $id already
63 * exists
65 * @param string $id user identity URL
66 * @param string $password encoded user password
67 * @return bool
69 abstract public function addUser($id, $password);
71 /**
72 * Returns true if user with given $id exists and false otherwise
74 * @param string $id user identity URL
75 * @return bool
77 abstract public function hasUser($id);
79 /**
80 * Verify if user with given $id exists and has specified $password
82 * @param string $id user identity URL
83 * @param string $password user password
84 * @return bool
86 abstract public function checkUser($id, $password);
88 /**
89 * Returns array of all trusted/untrusted sites for given user identified
90 * by $id
92 * @param string $id user identity URL
93 * @return array
95 abstract public function getTrustedSites($id);
97 /**
98 * Stores information about trusted/untrusted site for given user
100 * @param string $id user identity URL
101 * @param string $site site URL
102 * @param mixed $trusted trust data from extensions or just a boolean value
103 * @return bool
105 abstract public function addSite($id, $site, $trusted);