mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-23 13:39:48 +05:30
Renamed scopes.key to scopes.scope. Updated ScopeInterface and PDO/Scope. Fixes #45
This commit is contained in:
parent
7035792325
commit
d677b765b2
@ -65,13 +65,13 @@ CREATE TABLE `oauth_session_refresh_tokens` (
|
|||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
CREATE TABLE `oauth_scopes` (
|
CREATE TABLE `oauth_scopes` (
|
||||||
`id` SMALLINT(5) UNSIGNED NOT NULL AUTO_INCREMENT,
|
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
`key` VARCHAR(255) NOT NULL,
|
`scope` varchar(255) NOT NULL,
|
||||||
`name` VARCHAR(255) NOT NULL,
|
`name` varchar(255) NOT NULL,
|
||||||
`description` VARCHAR(255) DEFAULT NULL,
|
`description` varchar(255) DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
UNIQUE KEY `u_oasc_sc` (`key`)
|
UNIQUE KEY `u_oasc_sc` (`scope_key`)
|
||||||
) ENGINE=INNODB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
CREATE TABLE `oauth_session_token_scopes` (
|
CREATE TABLE `oauth_session_token_scopes` (
|
||||||
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
@ -10,7 +10,7 @@ class Scope implements ScopeInterface
|
|||||||
{
|
{
|
||||||
$db = \ezcDbInstance::get();
|
$db = \ezcDbInstance::get();
|
||||||
|
|
||||||
$stmt = $db->prepare('SELECT * FROM oauth_scopes WHERE oauth_scopes.key = :scope');
|
$stmt = $db->prepare('SELECT * FROM oauth_scopes WHERE oauth_scopes.scope = :scope');
|
||||||
$stmt->bindValue(':scope', $scope);
|
$stmt->bindValue(':scope', $scope);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ class Scope implements ScopeInterface
|
|||||||
|
|
||||||
return array(
|
return array(
|
||||||
'id' => $row->id,
|
'id' => $row->id,
|
||||||
'scope' => $row->key,
|
'scope' => $row->scope,
|
||||||
'name' => $row->name,
|
'name' => $row->name,
|
||||||
'description' => $row->description
|
'description' => $row->description
|
||||||
);
|
);
|
||||||
|
@ -19,7 +19,7 @@ interface ScopeInterface
|
|||||||
* Example SQL query:
|
* Example SQL query:
|
||||||
*
|
*
|
||||||
* <code>
|
* <code>
|
||||||
* SELECT * FROM oauth_scopes WHERE oauth_scopes.key = :scope
|
* SELECT * FROM oauth_scopes WHERE scope = :scope
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* Response:
|
* Response:
|
||||||
@ -28,7 +28,7 @@ interface ScopeInterface
|
|||||||
* Array
|
* Array
|
||||||
* (
|
* (
|
||||||
* [id] => (int) The scope's ID
|
* [id] => (int) The scope's ID
|
||||||
* [key] => (string) The scope itself
|
* [scope] => (string) The scope itself
|
||||||
* [name] => (string) The scope's name
|
* [name] => (string) The scope's name
|
||||||
* [description] => (string) The scope's description
|
* [description] => (string) The scope's description
|
||||||
* )
|
* )
|
||||||
|
Loading…
Reference in New Issue
Block a user