Moved files into server namespace/folder and updated docblock copyright statements

This commit is contained in:
Alex Bilbie
2013-05-08 11:29:24 -07:00
parent 2d6cc3c98e
commit 5524e9b9c8
24 changed files with 52 additions and 52 deletions

View File

@@ -0,0 +1,128 @@
<?php
/**
* OAuth 2.0 Session storage interface
*
* @package php-loep/oauth2-server
* @author Alex Bilbie <hello@alexbilbie.com>
* @copyright Copyright (c) 2013 PHP League of Extraordinary Packages
* @license http://mit-license.org/
* @link http://github.com/php-leop/oauth2-server
*/
namespace League\OAuth2\Storage;
interface SessionInterface
{
/**
* Create a new session
* @param string $clientId The client ID
* @param string $ownerType The type of the session owner (e.g. "user")
* @param string $ownerId The ID of the session owner (e.g. "123")
* @return int The session ID
*/
public function createSession($clientId, $ownerType, $ownerId);
/**
* Delete a session
* @param string $clientId The client ID
* @param string $ownerType The type of the session owner (e.g. "user")
* @param string $ownerId The ID of the session owner (e.g. "123")
* @return void
*/
public function deleteSession($clientId, $ownerType, $ownerId);
/**
* Associate a redirect URI with a session
* @param int $sessionId The session ID
* @param string $redirectUri The redirect URI
* @return void
*/
public function associateRedirectUri($sessionId, $redirectUri);
/**
* Associate an access token with a session
* @param int $sessionId The session ID
* @param string $accessToken The access token
* @param int $expireTime Unix timestamp of the access token expiry time
* @return void
*/
public function associateAccessToken($sessionId, $accessToken, $expireTime);
/**
* Remove an associated access token from a session
* @param int $sessionId The session ID
* @return void
*/
public function removeAccessToken($sessionId);
/**
* Associate a refresh token with a session
* @param int $accessTokenId The access token ID
* @param string $refreshToken The refresh token
* @param int $expireTime Unix timestamp of the refresh token expiry time
* @return void
*/
public function associateRefreshToken($accessTokenId, $refreshToken, $expireTime);
/**
* Assocate an authorization code with a session
* @param int $sessionId The session ID
* @param string $authCode The authorization code
* @param int $expireTime Unix timestamp of the access token expiry time
* @param string $scopeIds Comma seperated list of scope IDs to be later associated (default = null)
* @return void
*/
public function associateAuthCode($sessionId, $authCode, $expireTime, $scopeIds = null);
/**
* Remove an associated authorization token from a session
* @param int $sessionId The session ID
* @return void
*/
public function removeAuthCode($sessionId);
/**
* Validate an authorization code
* @param string $clientId The client ID
* @param string $redirectUri The redirect URI
* @param string $authCode The authorization code
* @return void
*/
public function validateAuthCode($clientId, $redirectUri, $authCode);
/**
* Validate an access token
* @param string $accessToken [description]
* @return void
*/
public function validateAccessToken($accessToken);
/**
* Validate a refresh token
* @param string $refreshToken The access token
* @return void
*/
public function validateRefreshToken($refreshToken);
/**
* Get an access token by ID
* @param int $accessTokenId The access token ID
* @return array
*/
public function getAccessToken($accessTokenId);
/**
* Associate a scope with an access token
* @param int $accessTokenId The ID of the access token
* @param int $scopeId The ID of the scope
* @return void
*/
public function associateScope($accessTokenId, $scopeId);
/**
* Get all associated access tokens for an access token
* @param string $accessToken The access token
* @return array
*/
public function getScopes($accessToken);
}