Repository: airavata-php-gateway
Updated Branches:
  refs/heads/develop 1ce03109d -> ef1cf42e9


AIRAVATA-2232 Update to new ssh generation methods


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/a96d930a
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/a96d930a
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/a96d930a

Branch: refs/heads/develop
Commit: a96d930a9a2a155f3f3dd6ddd02bc4b2fe302130
Parents: 31b233c
Author: Marcus Christie <[email protected]>
Authored: Tue Nov 29 11:46:05 2016 -0500
Committer: Marcus Christie <[email protected]>
Committed: Tue Nov 29 11:47:29 2016 -0500

----------------------------------------------------------------------
 app/controllers/AdminController.php        |  2 +-
 app/controllers/UserSettingsController.php |  2 +-
 app/libraries/AdminUtilities.php           | 12 +++++++-----
 app/libraries/URPUtilities.php             |  2 +-
 4 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/a96d930a/app/controllers/AdminController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AdminController.php 
b/app/controllers/AdminController.php
index 18f48cd..33fc58d 100644
--- a/app/controllers/AdminController.php
+++ b/app/controllers/AdminController.php
@@ -342,7 +342,7 @@ class AdminController extends BaseController {
     }
 
        public function createSSH(){
-               $newToken = AdminUtilities::create_ssh_token();
+               $newToken = AdminUtilities::create_ssh_token_for_gateway(null);
                $pubkey = AdminUtilities::get_pubkey_from_token( $newToken);
                return Response::json( array( "token" => $newToken, "pubkey" => 
$pubkey));
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/a96d930a/app/controllers/UserSettingsController.php
----------------------------------------------------------------------
diff --git a/app/controllers/UserSettingsController.php 
b/app/controllers/UserSettingsController.php
index 88fdc37..ef09932 100644
--- a/app/controllers/UserSettingsController.php
+++ b/app/controllers/UserSettingsController.php
@@ -58,7 +58,7 @@ class UserSettingsController extends BaseController
 
         $description = Input::get("credential-description");
 
-        if (AdminUtilities::create_ssh_token_with_description($description)) {
+        if (AdminUtilities::create_ssh_token_for_user($description)) {
             return Redirect::to("account/credential-store")->with("message", 
"SSH Key '$description' was added");
         }
     }

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/a96d930a/app/libraries/AdminUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/AdminUtilities.php b/app/libraries/AdminUtilities.php
index d514cce..e0829d7 100644
--- a/app/libraries/AdminUtilities.php
+++ b/app/libraries/AdminUtilities.php
@@ -4,6 +4,7 @@ use Airavata\Model\Workspace\Gateway;
 use Airavata\Model\Workspace\GatewayApprovalStatus;
 use Airavata\Model\Workspace\Notification;
 use Airavata\Model\Workspace\NotificationPriority;
+use Airavata\Model\Credential\Store\CredentialOwnerType;
 
 class AdminUtilities
 {
@@ -165,13 +166,14 @@ class AdminUtilities
         return $expContainer;
     }
 
-    public static function create_ssh_token(){
-        return $newToken = Airavata::generateAndRegisterSSHKeys( 
Session::get('authz-token'), Session::get("gateway_id"), 
Session::get("username"));
+    public static function create_ssh_token_for_gateway($description) {
+        return Airavata::generateAndRegisterSSHKeys(
+            Session::get('authz-token'), Session::get("gateway_id"), 
Session::get("username"), $description, CredentialOwnerType::GATEWAY);
     }
 
-    public static function create_ssh_token_with_description($description){
-        return Airavata::generateAndRegisterSSHKeysWithDescription(
-            Session::get('authz-token'), Session::get("gateway_id"), 
Session::get("username"), $description);
+    public static function create_ssh_token_for_user($description) {
+        return Airavata::generateAndRegisterSSHKeys(
+            Session::get('authz-token'), Session::get("gateway_id"), 
Session::get("username"), $description, CredentialOwnerType::USER);
     }
 
     public static function create_pwd_token($inputs){

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/a96d930a/app/libraries/URPUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/URPUtilities.php b/app/libraries/URPUtilities.php
index be62b5c..e21f377 100644
--- a/app/libraries/URPUtilities.php
+++ b/app/libraries/URPUtilities.php
@@ -31,7 +31,7 @@ class URPUtilities
 
         $userId = Session::get('username');
         $gatewayId = Session::get('gateway_id');
-        $credentialStoreToken = 
AdminUtilities::create_ssh_token_with_description("Default SSH Key");
+        $credentialStoreToken = 
AdminUtilities::create_ssh_token_for_user("Default SSH Key");
         $userResourceProfileData = new UserResourceProfile(array(
                 "userId" => $userId,
                 "gatewayID" => $gatewayId,

Reply via email to