airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sma...@apache.org
Subject airavata-php-gateway git commit: Changing the launch and terminate methods to use a gatewayid instead of a token id
Date Thu, 08 Oct 2015 19:46:16 GMT
Repository: airavata-php-gateway
Updated Branches:
  refs/heads/master c0780d59c -> 70bc4b995


Changing the launch and terminate methods to use a gatewayid instead of a token id


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

Branch: refs/heads/master
Commit: 70bc4b995820aab6badc08cd1ca8ded3cdd70114
Parents: c0780d5
Author: Suresh Marru <smarru@apache.org>
Authored: Thu Oct 8 15:46:11 2015 -0400
Committer: Suresh Marru <smarru@apache.org>
Committed: Thu Oct 8 15:46:11 2015 -0400

----------------------------------------------------------------------
 app/config/pga_config.php.template      |  5 ---
 app/libraries/Airavata/API/Airavata.php | 65 ++++++++++++----------------
 app/libraries/ExperimentUtilities.php   |  6 +--
 3 files changed, 31 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/70bc4b99/app/config/pga_config.php.template
----------------------------------------------------------------------
diff --git a/app/config/pga_config.php.template b/app/config/pga_config.php.template
index 292ecc2..3a9e042 100644
--- a/app/config/pga_config.php.template
+++ b/app/config/pga_config.php.template
@@ -139,11 +139,6 @@ return array(
         'advanced-experiment-options' => '',
 
         /**
-         * Credentials Store Token
-         */
-        'credential-store-token' => 'bdc612fe-401e-4684-88e9-317f99409c45',
-
-        /**
          * Default queue name
          */
         'queue-name' => 'long',

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/70bc4b99/app/libraries/Airavata/API/Airavata.php
----------------------------------------------------------------------
diff --git a/app/libraries/Airavata/API/Airavata.php b/app/libraries/Airavata/API/Airavata.php
index f274185..77ad7cd 100644
--- a/app/libraries/Airavata/API/Airavata.php
+++ b/app/libraries/Airavata/API/Airavata.php
@@ -704,15 +704,6 @@ interface AiravataIf {
    * @param airavataExperimentId
    *    The identifier for the requested experiment. This is returned during the create experiment
step.
    * 
-   * @param airavataCredStoreToken:
-   *   A requirement to execute experiments within Airavata is to first register the targeted
remote computational account
-   *     credentials with Airavata Credential Store. The administrative API (related to credential
store) will return a
-   *     generated token associated with the registered credentials. The client has to security
posses this token id and is
-   *     required to pass it to Airavata Server for all execution requests.
-   *   Note: At this point only the credential store token is required so the string is directly
passed here. In future if
-   *     if more security credentials are enables, then the structure ExecutionSecurityParameters
should be used.
-   *   Note: This parameter is not persisted within Airavata Registry for security reasons.
-   * 
    * @return
    *   This method call does not have a return value.
    * 
@@ -742,14 +733,14 @@ interface AiravataIf {
    * 
    * @param \Airavata\Model\Security\AuthzToken $authzToken
    * @param string $airavataExperimentId
-   * @param string $airavataCredStoreToken
+   * @param string $gatewayId
    * @throws \Airavata\API\Error\InvalidRequestException
    * @throws \Airavata\API\Error\ExperimentNotFoundException
    * @throws \Airavata\API\Error\AiravataClientException
    * @throws \Airavata\API\Error\AiravataSystemException
    * @throws \Airavata\API\Error\AuthorizationException
    */
-  public function launchExperiment(\Airavata\Model\Security\AuthzToken $authzToken, $airavataExperimentId,
$airavataCredStoreToken);
+  public function launchExperiment(\Airavata\Model\Security\AuthzToken $authzToken, $airavataExperimentId,
$gatewayId);
   /**
    * @param \Airavata\Model\Security\AuthzToken $authzToken
    * @param string $airavataExperimentId
@@ -901,14 +892,14 @@ interface AiravataIf {
    * 
    * @param \Airavata\Model\Security\AuthzToken $authzToken
    * @param string $airavataExperimentId
-   * @param string $tokenId
+   * @param string $gatewayId
    * @throws \Airavata\API\Error\InvalidRequestException
    * @throws \Airavata\API\Error\ExperimentNotFoundException
    * @throws \Airavata\API\Error\AiravataClientException
    * @throws \Airavata\API\Error\AiravataSystemException
    * @throws \Airavata\API\Error\AuthorizationException
    */
-  public function terminateExperiment(\Airavata\Model\Security\AuthzToken $authzToken, $airavataExperimentId,
$tokenId);
+  public function terminateExperiment(\Airavata\Model\Security\AuthzToken $authzToken, $airavataExperimentId,
$gatewayId);
   /**
    * Register a Application Module.
    * 
@@ -4701,18 +4692,18 @@ class AiravataClient implements \Airavata\API\AiravataIf {
     throw new \Exception("validateExperiment failed: unknown result");
   }
 
-  public function launchExperiment(\Airavata\Model\Security\AuthzToken $authzToken, $airavataExperimentId,
$airavataCredStoreToken)
+  public function launchExperiment(\Airavata\Model\Security\AuthzToken $authzToken, $airavataExperimentId,
$gatewayId)
   {
-    $this->send_launchExperiment($authzToken, $airavataExperimentId, $airavataCredStoreToken);
+    $this->send_launchExperiment($authzToken, $airavataExperimentId, $gatewayId);
     $this->recv_launchExperiment();
   }
 
-  public function send_launchExperiment(\Airavata\Model\Security\AuthzToken $authzToken,
$airavataExperimentId, $airavataCredStoreToken)
+  public function send_launchExperiment(\Airavata\Model\Security\AuthzToken $authzToken,
$airavataExperimentId, $gatewayId)
   {
     $args = new \Airavata\API\Airavata_launchExperiment_args();
     $args->authzToken = $authzToken;
     $args->airavataExperimentId = $airavataExperimentId;
-    $args->airavataCredStoreToken = $airavataCredStoreToken;
+    $args->gatewayId = $gatewayId;
     $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
     if ($bin_accel)
     {
@@ -5169,18 +5160,18 @@ class AiravataClient implements \Airavata\API\AiravataIf {
     throw new \Exception("cloneExperiment failed: unknown result");
   }
 
-  public function terminateExperiment(\Airavata\Model\Security\AuthzToken $authzToken, $airavataExperimentId,
$tokenId)
+  public function terminateExperiment(\Airavata\Model\Security\AuthzToken $authzToken, $airavataExperimentId,
$gatewayId)
   {
-    $this->send_terminateExperiment($authzToken, $airavataExperimentId, $tokenId);
+    $this->send_terminateExperiment($authzToken, $airavataExperimentId, $gatewayId);
     $this->recv_terminateExperiment();
   }
 
-  public function send_terminateExperiment(\Airavata\Model\Security\AuthzToken $authzToken,
$airavataExperimentId, $tokenId)
+  public function send_terminateExperiment(\Airavata\Model\Security\AuthzToken $authzToken,
$airavataExperimentId, $gatewayId)
   {
     $args = new \Airavata\API\Airavata_terminateExperiment_args();
     $args->authzToken = $authzToken;
     $args->airavataExperimentId = $airavataExperimentId;
-    $args->tokenId = $tokenId;
+    $args->gatewayId = $gatewayId;
     $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
     if ($bin_accel)
     {
@@ -20955,7 +20946,7 @@ class Airavata_launchExperiment_args {
   /**
    * @var string
    */
-  public $airavataCredStoreToken = null;
+  public $gatewayId = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -20970,7 +20961,7 @@ class Airavata_launchExperiment_args {
           'type' => TType::STRING,
           ),
         3 => array(
-          'var' => 'airavataCredStoreToken',
+          'var' => 'gatewayId',
           'type' => TType::STRING,
           ),
         );
@@ -20982,8 +20973,8 @@ class Airavata_launchExperiment_args {
       if (isset($vals['airavataExperimentId'])) {
         $this->airavataExperimentId = $vals['airavataExperimentId'];
       }
-      if (isset($vals['airavataCredStoreToken'])) {
-        $this->airavataCredStoreToken = $vals['airavataCredStoreToken'];
+      if (isset($vals['gatewayId'])) {
+        $this->gatewayId = $vals['gatewayId'];
       }
     }
   }
@@ -21024,7 +21015,7 @@ class Airavata_launchExperiment_args {
           break;
         case 3:
           if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->airavataCredStoreToken);
+            $xfer += $input->readString($this->gatewayId);
           } else {
             $xfer += $input->skip($ftype);
           }
@@ -21055,9 +21046,9 @@ class Airavata_launchExperiment_args {
       $xfer += $output->writeString($this->airavataExperimentId);
       $xfer += $output->writeFieldEnd();
     }
-    if ($this->airavataCredStoreToken !== null) {
-      $xfer += $output->writeFieldBegin('airavataCredStoreToken', TType::STRING, 3);
-      $xfer += $output->writeString($this->airavataCredStoreToken);
+    if ($this->gatewayId !== null) {
+      $xfer += $output->writeFieldBegin('gatewayId', TType::STRING, 3);
+      $xfer += $output->writeString($this->gatewayId);
       $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();
@@ -23224,7 +23215,7 @@ class Airavata_terminateExperiment_args {
   /**
    * @var string
    */
-  public $tokenId = null;
+  public $gatewayId = null;
 
   public function __construct($vals=null) {
     if (!isset(self::$_TSPEC)) {
@@ -23239,7 +23230,7 @@ class Airavata_terminateExperiment_args {
           'type' => TType::STRING,
           ),
         3 => array(
-          'var' => 'tokenId',
+          'var' => 'gatewayId',
           'type' => TType::STRING,
           ),
         );
@@ -23251,8 +23242,8 @@ class Airavata_terminateExperiment_args {
       if (isset($vals['airavataExperimentId'])) {
         $this->airavataExperimentId = $vals['airavataExperimentId'];
       }
-      if (isset($vals['tokenId'])) {
-        $this->tokenId = $vals['tokenId'];
+      if (isset($vals['gatewayId'])) {
+        $this->gatewayId = $vals['gatewayId'];
       }
     }
   }
@@ -23293,7 +23284,7 @@ class Airavata_terminateExperiment_args {
           break;
         case 3:
           if ($ftype == TType::STRING) {
-            $xfer += $input->readString($this->tokenId);
+            $xfer += $input->readString($this->gatewayId);
           } else {
             $xfer += $input->skip($ftype);
           }
@@ -23324,9 +23315,9 @@ class Airavata_terminateExperiment_args {
       $xfer += $output->writeString($this->airavataExperimentId);
       $xfer += $output->writeFieldEnd();
     }
-    if ($this->tokenId !== null) {
-      $xfer += $output->writeFieldBegin('tokenId', TType::STRING, 3);
-      $xfer += $output->writeString($this->tokenId);
+    if ($this->gatewayId !== null) {
+      $xfer += $output->writeFieldBegin('gatewayId', TType::STRING, 3);
+      $xfer += $output->writeString($this->gatewayId);
       $xfer += $output->writeFieldEnd();
     }
     $xfer += $output->writeFieldStop();

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/70bc4b99/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
index 3e98cb0..8d83db1 100644
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -24,8 +24,8 @@ class ExperimentUtilities
     public static function launch_experiment($expId)
     {
         try {
-            $hardCodedToken = Config::get('pga_config.airavata')['credential-store-token'];
-            Airavata::launchExperiment(Session::get('authz-token'), $expId, $hardCodedToken);
+            $gatewayId = Config::get('pga_config.airavata')['gateway-id'];
+            Airavata::launchExperiment(Session::get('authz-token'), $expId, $gatewayId);
         } catch (InvalidRequestException $ire) {
             CommonUtilities::print_error_message('<p>There was a problem launching
the experiment.
             Please try again later or submit a bug report using the link in the Help menu.</p>'
.
@@ -461,7 +461,7 @@ class ExperimentUtilities
     {
 
         try {
-            Airavata::terminateExperiment(Session::get('authz-token'), $expId, Config::get('pga_config.airavata')["credential-store-token"]);
+            Airavata::terminateExperiment(Session::get('authz-token'), $expId, Config::get('pga_config.airavata')["gateway-id"]);
 
             CommonUtilities::print_success_message("Experiment canceled!");
         } catch (InvalidRequestException $ire) {


Mime
View raw message