From 3cb79fc2b5f7dc3c2a4ba3d63edbff5f713002f8 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Thu, 9 May 2013 09:31:05 -0700 Subject: [PATCH 1/5] Fixed oauth_session_token_scopes primary key --- sql/mysql.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/mysql.sql b/sql/mysql.sql index 11b0de2a6..ca353e565 100644 --- a/sql/mysql.sql +++ b/sql/mysql.sql @@ -74,10 +74,10 @@ CREATE TABLE `oauth_scopes` ( ) ENGINE=INNODB DEFAULT CHARSET=utf8; CREATE TABLE `oauth_session_token_scopes` ( - `session_token_scope_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `session_access_token_id` int(10) unsigned DEFAULT NULL, `scope_id` smallint(5) unsigned NOT NULL, - PRIMARY KEY (`session_token_scope_id`), + PRIMARY KEY (`id`), UNIQUE KEY `u_setosc_setoid_scid` (`session_access_token_id`,`scope_id`), KEY `f_oasetosc_scid` (`scope_id`), CONSTRAINT `f_oasetosc_scid` FOREIGN KEY (`scope_id`) REFERENCES `oauth_scopes` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION, From d9c598af3c19cf99b136478233fa460fb382cbde Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Thu, 9 May 2013 09:38:08 -0700 Subject: [PATCH 2/5] Removed `DEFAULT ''` that has slipped in --- sql/mysql.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sql/mysql.sql b/sql/mysql.sql index ca353e565..ca03ac188 100644 --- a/sql/mysql.sql +++ b/sql/mysql.sql @@ -29,7 +29,7 @@ CREATE TABLE `oauth_sessions` ( CREATE TABLE `oauth_session_access_tokens` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `session_id` int(10) unsigned NOT NULL, - `access_token` char(40) NOT NULL DEFAULT '', + `access_token` char(40) NOT NULL, `access_token_expires` int(10) unsigned NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `u_oaseacto_acto_seid` (`access_token`,`session_id`), @@ -39,7 +39,7 @@ CREATE TABLE `oauth_session_access_tokens` ( CREATE TABLE `oauth_session_authcodes` ( `session_id` int(10) unsigned NOT NULL, - `auth_code` char(40) NOT NULL DEFAULT '', + `auth_code` char(40) NOT NULL, `auth_code_expires` int(10) unsigned NOT NULL, `scope_ids` char(255) DEFAULT NULL, PRIMARY KEY (`session_id`), @@ -48,16 +48,16 @@ CREATE TABLE `oauth_session_authcodes` ( CREATE TABLE `oauth_session_redirects` ( `session_id` int(10) unsigned NOT NULL, - `redirect_uri` varchar(255) NOT NULL DEFAULT '', + `redirect_uri` varchar(255) NOT NULL, PRIMARY KEY (`session_id`), CONSTRAINT `f_oasere_seid` FOREIGN KEY (`session_id`) REFERENCES `oauth_sessions` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `oauth_session_refresh_tokens` ( `session_access_token_id` int(10) unsigned NOT NULL, - `refresh_token` char(40) NOT NULL DEFAULT '', + `refresh_token` char(40) NOT NULL, `refresh_token_expires` int(10) unsigned NOT NULL, - `client_id` char(40) NOT NULL DEFAULT '', + `client_id` char(40) NOT NULL, PRIMARY KEY (`session_access_token_id`), KEY `client_id` (`client_id`), CONSTRAINT `oauth_session_refresh_tokens_ibfk_1` FOREIGN KEY (`client_id`) REFERENCES `oauth_clients` (`id`) ON DELETE CASCADE, From 69af2528440130ef7672ae72e7e12bfb41382874 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Thu, 9 May 2013 09:45:10 -0700 Subject: [PATCH 3/5] Fixed docblock --- src/League/OAuth2/Server/Storage/SessionInterface.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/League/OAuth2/Server/Storage/SessionInterface.php b/src/League/OAuth2/Server/Storage/SessionInterface.php index 46c207a8e..0ac099530 100644 --- a/src/League/OAuth2/Server/Storage/SessionInterface.php +++ b/src/League/OAuth2/Server/Storage/SessionInterface.php @@ -84,8 +84,8 @@ public function associateAccessToken($sessionId, $accessToken, $expireTime); * Example SQL query: * * - * oauth_session_refresh_tokens (session_access_token_id, refresh_token, refresh_token_expires) - * VALUE (:accessTokenId, :refreshToken, :expireTime) + * INSERT INTO oauth_session_refresh_tokens (session_access_token_id, refresh_token, refresh_token_expires, + * client_id) VALUE (:accessTokenId, :refreshToken, :expireTime, :clientId) * * * @param int $accessTokenId The access token ID From 2296d09e921af08581a99342429dff7339825386 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Thu, 9 May 2013 09:47:07 -0700 Subject: [PATCH 4/5] Changelog update --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a903ab1d8..4310c1833 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 2.0.5 (released 2013-05-09) + +* Fixed `oauth_session_token_scopes` table primary key +* Removed `DEFAULT ''` that has slipped into some tables +* Fixed docblock for `SessionInterface::associateRefreshToken()` + ## 2.0.4 (released 2013-05-09) * Renamed primary key in oauth_client_endpoints table From e6d0a19e8f2523ab9dffd5528cbf459f18c037eb Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Thu, 9 May 2013 09:47:11 -0700 Subject: [PATCH 5/5] Version bump --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2029ee459..0b2d4eb25 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "league/oauth2-server", "description": "A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.", - "version": "2.0.4", + "version": "2.0.5", "homepage": "https://github.com/php-loep/oauth2-server", "license": "MIT", "require": {