You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2015/08/02 22:42:53 UTC
[12/13] airavata git commit: adding Authz token as a parameter for
Airavata credential store API methods
http://git-wip-us.apache.org/repos/asf/airavata/blob/eb4a737c/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
index 38e6e6a..0928ada 100644
--- a/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
+++ b/airavata-api/airavata-client-sdks/airavata-php-sdk/src/main/resources/lib/Airavata/API/Airavata.php
@@ -103,6 +103,7 @@ interface AiravataIf {
*
*
*
+ * @param \Airavata\Model\Security\AuthzToken $authzToken
* @param string $gatewayId
* @param string $userName
* @return string
@@ -110,23 +111,25 @@ interface AiravataIf {
* @throws \Airavata\API\Error\AiravataClientException
* @throws \Airavata\API\Error\AiravataSystemException
*/
- public function generateAndRegisterSSHKeys($gatewayId, $userName);
+ public function generateAndRegisterSSHKeys(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId, $userName);
/**
+ * @param \Airavata\Model\Security\AuthzToken $authzToken
* @param string $airavataCredStoreToken
* @return string
* @throws \Airavata\API\Error\InvalidRequestException
* @throws \Airavata\API\Error\AiravataClientException
* @throws \Airavata\API\Error\AiravataSystemException
*/
- public function getSSHPubKey($airavataCredStoreToken);
+ public function getSSHPubKey(\Airavata\Model\Security\AuthzToken $authzToken, $airavataCredStoreToken);
/**
+ * @param \Airavata\Model\Security\AuthzToken $authzToken
* @param string $userName
* @return array
* @throws \Airavata\API\Error\InvalidRequestException
* @throws \Airavata\API\Error\AiravataClientException
* @throws \Airavata\API\Error\AiravataSystemException
*/
- public function getAllUserSSHPubKeys($userName);
+ public function getAllUserSSHPubKeys(\Airavata\Model\Security\AuthzToken $authzToken, $userName);
/**
* Creates a Project with basic metadata.
* A Project is a container of experiments.
@@ -2967,15 +2970,16 @@ class AiravataClient implements \Airavata\API\AiravataIf {
throw new \Exception("isGatewayExist failed: unknown result");
}
- public function generateAndRegisterSSHKeys($gatewayId, $userName)
+ public function generateAndRegisterSSHKeys(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId, $userName)
{
- $this->send_generateAndRegisterSSHKeys($gatewayId, $userName);
+ $this->send_generateAndRegisterSSHKeys($authzToken, $gatewayId, $userName);
return $this->recv_generateAndRegisterSSHKeys();
}
- public function send_generateAndRegisterSSHKeys($gatewayId, $userName)
+ public function send_generateAndRegisterSSHKeys(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId, $userName)
{
$args = new \Airavata\API\Airavata_generateAndRegisterSSHKeys_args();
+ $args->authzToken = $authzToken;
$args->gatewayId = $gatewayId;
$args->userName = $userName;
$bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
@@ -3028,15 +3032,16 @@ class AiravataClient implements \Airavata\API\AiravataIf {
throw new \Exception("generateAndRegisterSSHKeys failed: unknown result");
}
- public function getSSHPubKey($airavataCredStoreToken)
+ public function getSSHPubKey(\Airavata\Model\Security\AuthzToken $authzToken, $airavataCredStoreToken)
{
- $this->send_getSSHPubKey($airavataCredStoreToken);
+ $this->send_getSSHPubKey($authzToken, $airavataCredStoreToken);
return $this->recv_getSSHPubKey();
}
- public function send_getSSHPubKey($airavataCredStoreToken)
+ public function send_getSSHPubKey(\Airavata\Model\Security\AuthzToken $authzToken, $airavataCredStoreToken)
{
$args = new \Airavata\API\Airavata_getSSHPubKey_args();
+ $args->authzToken = $authzToken;
$args->airavataCredStoreToken = $airavataCredStoreToken;
$bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
if ($bin_accel)
@@ -3088,15 +3093,16 @@ class AiravataClient implements \Airavata\API\AiravataIf {
throw new \Exception("getSSHPubKey failed: unknown result");
}
- public function getAllUserSSHPubKeys($userName)
+ public function getAllUserSSHPubKeys(\Airavata\Model\Security\AuthzToken $authzToken, $userName)
{
- $this->send_getAllUserSSHPubKeys($userName);
+ $this->send_getAllUserSSHPubKeys($authzToken, $userName);
return $this->recv_getAllUserSSHPubKeys();
}
- public function send_getAllUserSSHPubKeys($userName)
+ public function send_getAllUserSSHPubKeys(\Airavata\Model\Security\AuthzToken $authzToken, $userName)
{
$args = new \Airavata\API\Airavata_getAllUserSSHPubKeys_args();
+ $args->authzToken = $authzToken;
$args->userName = $userName;
$bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
if ($bin_accel)
@@ -12046,6 +12052,10 @@ class Airavata_generateAndRegisterSSHKeys_args {
static $_TSPEC;
/**
+ * @var \Airavata\Model\Security\AuthzToken
+ */
+ public $authzToken = null;
+ /**
* @var string
*/
public $gatewayId = null;
@@ -12058,16 +12068,24 @@ class Airavata_generateAndRegisterSSHKeys_args {
if (!isset(self::$_TSPEC)) {
self::$_TSPEC = array(
1 => array(
+ 'var' => 'authzToken',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\Model\Security\AuthzToken',
+ ),
+ 2 => array(
'var' => 'gatewayId',
'type' => TType::STRING,
),
- 2 => array(
+ 3 => array(
'var' => 'userName',
'type' => TType::STRING,
),
);
}
if (is_array($vals)) {
+ if (isset($vals['authzToken'])) {
+ $this->authzToken = $vals['authzToken'];
+ }
if (isset($vals['gatewayId'])) {
$this->gatewayId = $vals['gatewayId'];
}
@@ -12097,13 +12115,21 @@ class Airavata_generateAndRegisterSSHKeys_args {
switch ($fid)
{
case 1:
+ if ($ftype == TType::STRUCT) {
+ $this->authzToken = new \Airavata\Model\Security\AuthzToken();
+ $xfer += $this->authzToken->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->gatewayId);
} else {
$xfer += $input->skip($ftype);
}
break;
- case 2:
+ case 3:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->userName);
} else {
@@ -12123,13 +12149,21 @@ class Airavata_generateAndRegisterSSHKeys_args {
public function write($output) {
$xfer = 0;
$xfer += $output->writeStructBegin('Airavata_generateAndRegisterSSHKeys_args');
+ if ($this->authzToken !== null) {
+ if (!is_object($this->authzToken)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('authzToken', TType::STRUCT, 1);
+ $xfer += $this->authzToken->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
if ($this->gatewayId !== null) {
- $xfer += $output->writeFieldBegin('gatewayId', TType::STRING, 1);
+ $xfer += $output->writeFieldBegin('gatewayId', TType::STRING, 2);
$xfer += $output->writeString($this->gatewayId);
$xfer += $output->writeFieldEnd();
}
if ($this->userName !== null) {
- $xfer += $output->writeFieldBegin('userName', TType::STRING, 2);
+ $xfer += $output->writeFieldBegin('userName', TType::STRING, 3);
$xfer += $output->writeString($this->userName);
$xfer += $output->writeFieldEnd();
}
@@ -12294,6 +12328,10 @@ class Airavata_getSSHPubKey_args {
static $_TSPEC;
/**
+ * @var \Airavata\Model\Security\AuthzToken
+ */
+ public $authzToken = null;
+ /**
* @var string
*/
public $airavataCredStoreToken = null;
@@ -12302,12 +12340,20 @@ class Airavata_getSSHPubKey_args {
if (!isset(self::$_TSPEC)) {
self::$_TSPEC = array(
1 => array(
+ 'var' => 'authzToken',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\Model\Security\AuthzToken',
+ ),
+ 2 => array(
'var' => 'airavataCredStoreToken',
'type' => TType::STRING,
),
);
}
if (is_array($vals)) {
+ if (isset($vals['authzToken'])) {
+ $this->authzToken = $vals['authzToken'];
+ }
if (isset($vals['airavataCredStoreToken'])) {
$this->airavataCredStoreToken = $vals['airavataCredStoreToken'];
}
@@ -12334,6 +12380,14 @@ class Airavata_getSSHPubKey_args {
switch ($fid)
{
case 1:
+ if ($ftype == TType::STRUCT) {
+ $this->authzToken = new \Airavata\Model\Security\AuthzToken();
+ $xfer += $this->authzToken->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->airavataCredStoreToken);
} else {
@@ -12353,8 +12407,16 @@ class Airavata_getSSHPubKey_args {
public function write($output) {
$xfer = 0;
$xfer += $output->writeStructBegin('Airavata_getSSHPubKey_args');
+ if ($this->authzToken !== null) {
+ if (!is_object($this->authzToken)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('authzToken', TType::STRUCT, 1);
+ $xfer += $this->authzToken->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
if ($this->airavataCredStoreToken !== null) {
- $xfer += $output->writeFieldBegin('airavataCredStoreToken', TType::STRING, 1);
+ $xfer += $output->writeFieldBegin('airavataCredStoreToken', TType::STRING, 2);
$xfer += $output->writeString($this->airavataCredStoreToken);
$xfer += $output->writeFieldEnd();
}
@@ -12519,6 +12581,10 @@ class Airavata_getAllUserSSHPubKeys_args {
static $_TSPEC;
/**
+ * @var \Airavata\Model\Security\AuthzToken
+ */
+ public $authzToken = null;
+ /**
* @var string
*/
public $userName = null;
@@ -12527,12 +12593,20 @@ class Airavata_getAllUserSSHPubKeys_args {
if (!isset(self::$_TSPEC)) {
self::$_TSPEC = array(
1 => array(
+ 'var' => 'authzToken',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\Model\Security\AuthzToken',
+ ),
+ 2 => array(
'var' => 'userName',
'type' => TType::STRING,
),
);
}
if (is_array($vals)) {
+ if (isset($vals['authzToken'])) {
+ $this->authzToken = $vals['authzToken'];
+ }
if (isset($vals['userName'])) {
$this->userName = $vals['userName'];
}
@@ -12559,6 +12633,14 @@ class Airavata_getAllUserSSHPubKeys_args {
switch ($fid)
{
case 1:
+ if ($ftype == TType::STRUCT) {
+ $this->authzToken = new \Airavata\Model\Security\AuthzToken();
+ $xfer += $this->authzToken->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->userName);
} else {
@@ -12578,8 +12660,16 @@ class Airavata_getAllUserSSHPubKeys_args {
public function write($output) {
$xfer = 0;
$xfer += $output->writeStructBegin('Airavata_getAllUserSSHPubKeys_args');
+ if ($this->authzToken !== null) {
+ if (!is_object($this->authzToken)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('authzToken', TType::STRUCT, 1);
+ $xfer += $this->authzToken->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
if ($this->userName !== null) {
- $xfer += $output->writeFieldBegin('userName', TType::STRING, 1);
+ $xfer += $output->writeFieldBegin('userName', TType::STRING, 2);
$xfer += $output->writeString($this->userName);
$xfer += $output->writeFieldEnd();
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/eb4a737c/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/api/Airavata-remote
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/api/Airavata-remote b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/api/Airavata-remote
index 99b3ee1..470ca44 100755
--- a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/api/Airavata-remote
+++ b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/api/Airavata-remote
@@ -31,9 +31,9 @@ if len(sys.argv) <= 1 or sys.argv[1] == '--help':
print(' bool deleteGateway(AuthzToken authzToken, string gatewayId)')
print(' getAllGateways(AuthzToken authzToken)')
print(' bool isGatewayExist(AuthzToken authzToken, string gatewayId)')
- print(' string generateAndRegisterSSHKeys(string gatewayId, string userName)')
- print(' string getSSHPubKey(string airavataCredStoreToken)')
- print(' getAllUserSSHPubKeys(string userName)')
+ print(' string generateAndRegisterSSHKeys(AuthzToken authzToken, string gatewayId, string userName)')
+ print(' string getSSHPubKey(AuthzToken authzToken, string airavataCredStoreToken)')
+ print(' getAllUserSSHPubKeys(AuthzToken authzToken, string userName)')
print(' string createProject(AuthzToken authzToken, string gatewayId, Project project)')
print(' void updateProject(AuthzToken authzToken, string projectId, Project updatedProject)')
print(' Project getProject(AuthzToken authzToken, string projectId)')
@@ -240,22 +240,22 @@ elif cmd == 'isGatewayExist':
pp.pprint(client.isGatewayExist(eval(args[0]),args[1],))
elif cmd == 'generateAndRegisterSSHKeys':
- if len(args) != 2:
- print('generateAndRegisterSSHKeys requires 2 args')
+ if len(args) != 3:
+ print('generateAndRegisterSSHKeys requires 3 args')
sys.exit(1)
- pp.pprint(client.generateAndRegisterSSHKeys(args[0],args[1],))
+ pp.pprint(client.generateAndRegisterSSHKeys(eval(args[0]),args[1],args[2],))
elif cmd == 'getSSHPubKey':
- if len(args) != 1:
- print('getSSHPubKey requires 1 args')
+ if len(args) != 2:
+ print('getSSHPubKey requires 2 args')
sys.exit(1)
- pp.pprint(client.getSSHPubKey(args[0],))
+ pp.pprint(client.getSSHPubKey(eval(args[0]),args[1],))
elif cmd == 'getAllUserSSHPubKeys':
- if len(args) != 1:
- print('getAllUserSSHPubKeys requires 1 args')
+ if len(args) != 2:
+ print('getAllUserSSHPubKeys requires 2 args')
sys.exit(1)
- pp.pprint(client.getAllUserSSHPubKeys(args[0],))
+ pp.pprint(client.getAllUserSSHPubKeys(eval(args[0]),args[1],))
elif cmd == 'createProject':
if len(args) != 3:
http://git-wip-us.apache.org/repos/asf/airavata/blob/eb4a737c/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/api/Airavata.py
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/api/Airavata.py b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/api/Airavata.py
index d4de996..f3c5799 100644
--- a/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/api/Airavata.py
+++ b/airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/api/Airavata.py
@@ -75,7 +75,7 @@ class Iface:
"""
pass
- def generateAndRegisterSSHKeys(self, gatewayId, userName):
+ def generateAndRegisterSSHKeys(self, authzToken, gatewayId, userName):
"""
Generate and Register SSH Key Pair with Airavata Credential Store.
@@ -93,21 +93,24 @@ class Iface:
Parameters:
+ - authzToken
- gatewayId
- userName
"""
pass
- def getSSHPubKey(self, airavataCredStoreToken):
+ def getSSHPubKey(self, authzToken, airavataCredStoreToken):
"""
Parameters:
+ - authzToken
- airavataCredStoreToken
"""
pass
- def getAllUserSSHPubKeys(self, userName):
+ def getAllUserSSHPubKeys(self, authzToken, userName):
"""
Parameters:
+ - authzToken
- userName
"""
pass
@@ -2373,7 +2376,7 @@ class Client(Iface):
raise result.ae
raise TApplicationException(TApplicationException.MISSING_RESULT, "isGatewayExist failed: unknown result");
- def generateAndRegisterSSHKeys(self, gatewayId, userName):
+ def generateAndRegisterSSHKeys(self, authzToken, gatewayId, userName):
"""
Generate and Register SSH Key Pair with Airavata Credential Store.
@@ -2391,15 +2394,17 @@ class Client(Iface):
Parameters:
+ - authzToken
- gatewayId
- userName
"""
- self.send_generateAndRegisterSSHKeys(gatewayId, userName)
+ self.send_generateAndRegisterSSHKeys(authzToken, gatewayId, userName)
return self.recv_generateAndRegisterSSHKeys()
- def send_generateAndRegisterSSHKeys(self, gatewayId, userName):
+ def send_generateAndRegisterSSHKeys(self, authzToken, gatewayId, userName):
self._oprot.writeMessageBegin('generateAndRegisterSSHKeys', TMessageType.CALL, self._seqid)
args = generateAndRegisterSSHKeys_args()
+ args.authzToken = authzToken
args.gatewayId = gatewayId
args.userName = userName
args.write(self._oprot)
@@ -2427,17 +2432,19 @@ class Client(Iface):
raise result.ase
raise TApplicationException(TApplicationException.MISSING_RESULT, "generateAndRegisterSSHKeys failed: unknown result");
- def getSSHPubKey(self, airavataCredStoreToken):
+ def getSSHPubKey(self, authzToken, airavataCredStoreToken):
"""
Parameters:
+ - authzToken
- airavataCredStoreToken
"""
- self.send_getSSHPubKey(airavataCredStoreToken)
+ self.send_getSSHPubKey(authzToken, airavataCredStoreToken)
return self.recv_getSSHPubKey()
- def send_getSSHPubKey(self, airavataCredStoreToken):
+ def send_getSSHPubKey(self, authzToken, airavataCredStoreToken):
self._oprot.writeMessageBegin('getSSHPubKey', TMessageType.CALL, self._seqid)
args = getSSHPubKey_args()
+ args.authzToken = authzToken
args.airavataCredStoreToken = airavataCredStoreToken
args.write(self._oprot)
self._oprot.writeMessageEnd()
@@ -2464,17 +2471,19 @@ class Client(Iface):
raise result.ase
raise TApplicationException(TApplicationException.MISSING_RESULT, "getSSHPubKey failed: unknown result");
- def getAllUserSSHPubKeys(self, userName):
+ def getAllUserSSHPubKeys(self, authzToken, userName):
"""
Parameters:
+ - authzToken
- userName
"""
- self.send_getAllUserSSHPubKeys(userName)
+ self.send_getAllUserSSHPubKeys(authzToken, userName)
return self.recv_getAllUserSSHPubKeys()
- def send_getAllUserSSHPubKeys(self, userName):
+ def send_getAllUserSSHPubKeys(self, authzToken, userName):
self._oprot.writeMessageBegin('getAllUserSSHPubKeys', TMessageType.CALL, self._seqid)
args = getAllUserSSHPubKeys_args()
+ args.authzToken = authzToken
args.userName = userName
args.write(self._oprot)
self._oprot.writeMessageEnd()
@@ -8382,7 +8391,7 @@ class Processor(Iface, TProcessor):
iprot.readMessageEnd()
result = generateAndRegisterSSHKeys_result()
try:
- result.success = self._handler.generateAndRegisterSSHKeys(args.gatewayId, args.userName)
+ result.success = self._handler.generateAndRegisterSSHKeys(args.authzToken, args.gatewayId, args.userName)
except apache.airavata.api.error.ttypes.InvalidRequestException, ire:
result.ire = ire
except apache.airavata.api.error.ttypes.AiravataClientException, ace:
@@ -8400,7 +8409,7 @@ class Processor(Iface, TProcessor):
iprot.readMessageEnd()
result = getSSHPubKey_result()
try:
- result.success = self._handler.getSSHPubKey(args.airavataCredStoreToken)
+ result.success = self._handler.getSSHPubKey(args.authzToken, args.airavataCredStoreToken)
except apache.airavata.api.error.ttypes.InvalidRequestException, ire:
result.ire = ire
except apache.airavata.api.error.ttypes.AiravataClientException, ace:
@@ -8418,7 +8427,7 @@ class Processor(Iface, TProcessor):
iprot.readMessageEnd()
result = getAllUserSSHPubKeys_result()
try:
- result.success = self._handler.getAllUserSSHPubKeys(args.userName)
+ result.success = self._handler.getAllUserSSHPubKeys(args.authzToken, args.userName)
except apache.airavata.api.error.ttypes.InvalidRequestException, ire:
result.ire = ire
except apache.airavata.api.error.ttypes.AiravataClientException, ace:
@@ -12000,17 +12009,20 @@ class isGatewayExist_result:
class generateAndRegisterSSHKeys_args:
"""
Attributes:
+ - authzToken
- gatewayId
- userName
"""
thrift_spec = (
None, # 0
- (1, TType.STRING, 'gatewayId', None, None, ), # 1
- (2, TType.STRING, 'userName', None, None, ), # 2
+ (1, TType.STRUCT, 'authzToken', (apache.airavata.model.security.ttypes.AuthzToken, apache.airavata.model.security.ttypes.AuthzToken.thrift_spec), None, ), # 1
+ (2, TType.STRING, 'gatewayId', None, None, ), # 2
+ (3, TType.STRING, 'userName', None, None, ), # 3
)
- def __init__(self, gatewayId=None, userName=None,):
+ def __init__(self, authzToken=None, gatewayId=None, userName=None,):
+ self.authzToken = authzToken
self.gatewayId = gatewayId
self.userName = userName
@@ -12024,11 +12036,17 @@ class generateAndRegisterSSHKeys_args:
if ftype == TType.STOP:
break
if fid == 1:
+ if ftype == TType.STRUCT:
+ self.authzToken = apache.airavata.model.security.ttypes.AuthzToken()
+ self.authzToken.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
if ftype == TType.STRING:
self.gatewayId = iprot.readString();
else:
iprot.skip(ftype)
- elif fid == 2:
+ elif fid == 3:
if ftype == TType.STRING:
self.userName = iprot.readString();
else:
@@ -12043,18 +12061,24 @@ class generateAndRegisterSSHKeys_args:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('generateAndRegisterSSHKeys_args')
+ if self.authzToken is not None:
+ oprot.writeFieldBegin('authzToken', TType.STRUCT, 1)
+ self.authzToken.write(oprot)
+ oprot.writeFieldEnd()
if self.gatewayId is not None:
- oprot.writeFieldBegin('gatewayId', TType.STRING, 1)
+ oprot.writeFieldBegin('gatewayId', TType.STRING, 2)
oprot.writeString(self.gatewayId)
oprot.writeFieldEnd()
if self.userName is not None:
- oprot.writeFieldBegin('userName', TType.STRING, 2)
+ oprot.writeFieldBegin('userName', TType.STRING, 3)
oprot.writeString(self.userName)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
+ if self.authzToken is None:
+ raise TProtocol.TProtocolException(message='Required field authzToken is unset!')
if self.gatewayId is None:
raise TProtocol.TProtocolException(message='Required field gatewayId is unset!')
if self.userName is None:
@@ -12064,6 +12088,7 @@ class generateAndRegisterSSHKeys_args:
def __hash__(self):
value = 17
+ value = (value * 31) ^ hash(self.authzToken)
value = (value * 31) ^ hash(self.gatewayId)
value = (value * 31) ^ hash(self.userName)
return value
@@ -12188,15 +12213,18 @@ class generateAndRegisterSSHKeys_result:
class getSSHPubKey_args:
"""
Attributes:
+ - authzToken
- airavataCredStoreToken
"""
thrift_spec = (
None, # 0
- (1, TType.STRING, 'airavataCredStoreToken', None, None, ), # 1
+ (1, TType.STRUCT, 'authzToken', (apache.airavata.model.security.ttypes.AuthzToken, apache.airavata.model.security.ttypes.AuthzToken.thrift_spec), None, ), # 1
+ (2, TType.STRING, 'airavataCredStoreToken', None, None, ), # 2
)
- def __init__(self, airavataCredStoreToken=None,):
+ def __init__(self, authzToken=None, airavataCredStoreToken=None,):
+ self.authzToken = authzToken
self.airavataCredStoreToken = airavataCredStoreToken
def read(self, iprot):
@@ -12209,6 +12237,12 @@ class getSSHPubKey_args:
if ftype == TType.STOP:
break
if fid == 1:
+ if ftype == TType.STRUCT:
+ self.authzToken = apache.airavata.model.security.ttypes.AuthzToken()
+ self.authzToken.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
if ftype == TType.STRING:
self.airavataCredStoreToken = iprot.readString();
else:
@@ -12223,14 +12257,20 @@ class getSSHPubKey_args:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('getSSHPubKey_args')
+ if self.authzToken is not None:
+ oprot.writeFieldBegin('authzToken', TType.STRUCT, 1)
+ self.authzToken.write(oprot)
+ oprot.writeFieldEnd()
if self.airavataCredStoreToken is not None:
- oprot.writeFieldBegin('airavataCredStoreToken', TType.STRING, 1)
+ oprot.writeFieldBegin('airavataCredStoreToken', TType.STRING, 2)
oprot.writeString(self.airavataCredStoreToken)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
+ if self.authzToken is None:
+ raise TProtocol.TProtocolException(message='Required field authzToken is unset!')
if self.airavataCredStoreToken is None:
raise TProtocol.TProtocolException(message='Required field airavataCredStoreToken is unset!')
return
@@ -12238,6 +12278,7 @@ class getSSHPubKey_args:
def __hash__(self):
value = 17
+ value = (value * 31) ^ hash(self.authzToken)
value = (value * 31) ^ hash(self.airavataCredStoreToken)
return value
@@ -12361,15 +12402,18 @@ class getSSHPubKey_result:
class getAllUserSSHPubKeys_args:
"""
Attributes:
+ - authzToken
- userName
"""
thrift_spec = (
None, # 0
- (1, TType.STRING, 'userName', None, None, ), # 1
+ (1, TType.STRUCT, 'authzToken', (apache.airavata.model.security.ttypes.AuthzToken, apache.airavata.model.security.ttypes.AuthzToken.thrift_spec), None, ), # 1
+ (2, TType.STRING, 'userName', None, None, ), # 2
)
- def __init__(self, userName=None,):
+ def __init__(self, authzToken=None, userName=None,):
+ self.authzToken = authzToken
self.userName = userName
def read(self, iprot):
@@ -12382,6 +12426,12 @@ class getAllUserSSHPubKeys_args:
if ftype == TType.STOP:
break
if fid == 1:
+ if ftype == TType.STRUCT:
+ self.authzToken = apache.airavata.model.security.ttypes.AuthzToken()
+ self.authzToken.read(iprot)
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
if ftype == TType.STRING:
self.userName = iprot.readString();
else:
@@ -12396,14 +12446,20 @@ class getAllUserSSHPubKeys_args:
oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
return
oprot.writeStructBegin('getAllUserSSHPubKeys_args')
+ if self.authzToken is not None:
+ oprot.writeFieldBegin('authzToken', TType.STRUCT, 1)
+ self.authzToken.write(oprot)
+ oprot.writeFieldEnd()
if self.userName is not None:
- oprot.writeFieldBegin('userName', TType.STRING, 1)
+ oprot.writeFieldBegin('userName', TType.STRING, 2)
oprot.writeString(self.userName)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
def validate(self):
+ if self.authzToken is None:
+ raise TProtocol.TProtocolException(message='Required field authzToken is unset!')
if self.userName is None:
raise TProtocol.TProtocolException(message='Required field userName is unset!')
return
@@ -12411,6 +12467,7 @@ class getAllUserSSHPubKeys_args:
def __hash__(self):
value = 17
+ value = (value * 31) ^ hash(self.authzToken)
value = (value * 31) ^ hash(self.userName)
return value
http://git-wip-us.apache.org/repos/asf/airavata/blob/eb4a737c/thrift-interface-descriptions/airavata-api/airavata_api.thrift
----------------------------------------------------------------------
diff --git a/thrift-interface-descriptions/airavata-api/airavata_api.thrift b/thrift-interface-descriptions/airavata-api/airavata_api.thrift
index f62b13d..d34c29d 100644
--- a/thrift-interface-descriptions/airavata-api/airavata_api.thrift
+++ b/thrift-interface-descriptions/airavata-api/airavata_api.thrift
@@ -135,17 +135,21 @@ service Airavata {
*
**/
- string generateAndRegisterSSHKeys (1: required string gatewayId, 2: required string userName)
+ string generateAndRegisterSSHKeys (1: required security_model.AuthzToken authzToken,
+ 2: required string gatewayId,
+ 3: required string userName)
throws (1: airavata_errors.InvalidRequestException ire,
2: airavata_errors.AiravataClientException ace,
3: airavata_errors.AiravataSystemException ase)
- string getSSHPubKey (1: required string airavataCredStoreToken)
+ string getSSHPubKey (1: required security_model.AuthzToken authzToken,
+ 2: required string airavataCredStoreToken)
throws (1: airavata_errors.InvalidRequestException ire,
2: airavata_errors.AiravataClientException ace,
3: airavata_errors.AiravataSystemException ase)
- map<string, string> getAllUserSSHPubKeys (1: required string userName)
+ map<string, string> getAllUserSSHPubKeys (1: required security_model.AuthzToken authzToken,
+ 2: required string userName)
throws (1: airavata_errors.InvalidRequestException ire,
2: airavata_errors.AiravataClientException ace,
3: airavata_errors.AiravataSystemException ase)