Repository: airavata-php-gateway Updated Branches: refs/heads/develop 40df106a2 -> cfdd5399d
removing username from AuthzContext Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/cfdd5399 Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/cfdd5399 Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/cfdd5399 Branch: refs/heads/develop Commit: cfdd5399d9917e9b0cae2fc3188d0bfaea411e37 Parents: 40df106 Author: scnakandala <[email protected]> Authored: Mon May 2 19:05:12 2016 -0400 Committer: scnakandala <[email protected]> Committed: Mon May 2 19:05:12 2016 -0400 ---------------------------------------------------------------------- app/controllers/AccountController.php | 4 +++- app/filters.php | 3 ++- app/libraries/Airavata/Model/Security/Types.php | 25 +------------------- 3 files changed, 6 insertions(+), 26 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cfdd5399/app/controllers/AccountController.php ---------------------------------------------------------------------- diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index 613c36c..7f8e6d1 100644 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -120,7 +120,9 @@ class AccountController extends BaseController $authzToken = new Airavata\Model\Security\AuthzToken(); $authzToken->accessToken = $accessToken; - $authzToken->gatewayId = Config::get('pga_config.airavata')['gateway-id']; + $authzToken->claimsMap['gatewayID'] = Config::get('pga_config.airavata')['gateway-id']; + $authzToken->claimsMap['userName'] = $username; + Session::put('authz-token',$authzToken); Session::put('oauth-refresh-code',$refreshToken); Session::put('oauth-expiration-time',$expirationTime); http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cfdd5399/app/filters.php ---------------------------------------------------------------------- diff --git a/app/filters.php b/app/filters.php index 398f5b3..e28b25b 100755 --- a/app/filters.php +++ b/app/filters.php @@ -27,7 +27,8 @@ App::before(function ($request) { $expirationTime = time() + $response->expires_in - 300; $authzToken = Session::get('authz-token'); $authzToken->accessToken = $accessToken; - $authzToken->gatewayId = Config::get('pga_config.airavata')['gateway-id']; + $authzToken->claimsMap['gatewayID'] = Config::get('pga_config.airavata')['gateway-id']; + $authzToken->claimsMap['userName'] = Session::get('username'); Session::put('authz-token',$authzToken); Session::put('oauth-refresh-code',$refreshToken); Session::put('oauth-expiration-time',$expirationTime); http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/cfdd5399/app/libraries/Airavata/Model/Security/Types.php ---------------------------------------------------------------------- diff --git a/app/libraries/Airavata/Model/Security/Types.php b/app/libraries/Airavata/Model/Security/Types.php index 901565c..f388971 100644 --- a/app/libraries/Airavata/Model/Security/Types.php +++ b/app/libraries/Airavata/Model/Security/Types.php @@ -25,10 +25,6 @@ class AuthzToken { */ public $accessToken = null; /** - * @var string - */ - public $gatewayId = null; - /** * @var array */ public $claimsMap = null; @@ -41,10 +37,6 @@ class AuthzToken { 'type' => TType::STRING, ), 2 => array( - 'var' => 'gatewayId', - 'type' => TType::STRING, - ), - 3 => array( 'var' => 'claimsMap', 'type' => TType::MAP, 'ktype' => TType::STRING, @@ -62,9 +54,6 @@ class AuthzToken { if (isset($vals['accessToken'])) { $this->accessToken = $vals['accessToken']; } - if (isset($vals['gatewayId'])) { - $this->gatewayId = $vals['gatewayId']; - } if (isset($vals['claimsMap'])) { $this->claimsMap = $vals['claimsMap']; } @@ -98,13 +87,6 @@ class AuthzToken { } break; case 2: - if ($ftype == TType::STRING) { - $xfer += $input->readString($this->gatewayId); - } else { - $xfer += $input->skip($ftype); - } - break; - case 3: if ($ftype == TType::MAP) { $this->claimsMap = array(); $_size0 = 0; @@ -142,16 +124,11 @@ class AuthzToken { $xfer += $output->writeString($this->accessToken); $xfer += $output->writeFieldEnd(); } - if ($this->gatewayId !== null) { - $xfer += $output->writeFieldBegin('gatewayId', TType::STRING, 2); - $xfer += $output->writeString($this->gatewayId); - $xfer += $output->writeFieldEnd(); - } if ($this->claimsMap !== null) { if (!is_array($this->claimsMap)) { throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); } - $xfer += $output->writeFieldBegin('claimsMap', TType::MAP, 3); + $xfer += $output->writeFieldBegin('claimsMap', TType::MAP, 2); { $output->writeMapBegin(TType::STRING, TType::STRING, count($this->claimsMap)); {
