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 2016/11/29 19:09:08 UTC
[3/4] airavata git commit: AIRAVATA-2232 Add CredentialOwnerType to
credential model
AIRAVATA-2232 Add CredentialOwnerType to credential model
Added date stripping from Thrift generated stub classes to
credential-store-stubs/pom.xml.
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/2e05c239
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/2e05c239
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/2e05c239
Branch: refs/heads/develop
Commit: 2e05c239eb46ff2e21fe62fbe94466b225c57a7b
Parents: a1dba1d
Author: Marcus Christie <ma...@iu.edu>
Authored: Tue Nov 29 09:30:00 2016 -0500
Committer: Marcus Christie <ma...@iu.edu>
Committed: Tue Nov 29 09:30:00 2016 -0500
----------------------------------------------------------------------
.../server/handler/AiravataServerHandler.java | 28 +-
airavata-api/airavata-api-stubs/pom.xml | 7 +-
.../java/org/apache/airavata/api/Airavata.java | 1806 +++---------------
.../resources/lib/Airavata/API/Airavata.php | 409 +---
.../Airavata/Model/Credential/Store/Types.php | 32 +
.../credential/store/credential/Credential.java | 4 +
.../store/credential/CredentialOwnerType.java | 28 +
.../server/CredentialStoreServerHandler.java | 12 +-
.../store/store/impl/db/CredentialsDAO.java | 15 +-
.../store/store/impl/db/CredentialsDAOTest.java | 7 +
.../credential-store-stubs/pom.xml | 24 +
.../store/cpi/CredentialStoreService.java | 2 +-
.../store/datamodel/APICredential.java | 2 +-
.../store/datamodel/CertificateCredential.java | 2 +-
.../store/datamodel/CommunityUser.java | 2 +-
.../store/datamodel/CredentialOwnerType.java | 61 +
.../store/datamodel/PasswordCredential.java | 2 +-
.../store/datamodel/SSHCredential.java | 136 +-
.../store/datamodel/SSHCredentialSummary.java | 2 +-
.../exception/CredentialStoreException.java | 2 +-
.../src/main/resources/credstore-derby.sql | 2 +
.../src/main/resources/credstore-mysql.sql | 2 +
.../airavata-apis/airavata_api.thrift | 38 +-
.../credential_store_data_models.thrift | 8 +-
.../generate-thrift-stubs.sh | 24 -
25 files changed, 635 insertions(+), 2022 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/2e05c239/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
index f90517a..10d2217 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/handler/AiravataServerHandler.java
@@ -31,6 +31,7 @@ import org.apache.airavata.common.utils.Constants;
import org.apache.airavata.common.utils.ServerSettings;
import org.apache.airavata.credential.store.client.CredentialStoreClientFactory;
import org.apache.airavata.credential.store.cpi.CredentialStoreService;
+import org.apache.airavata.credential.store.datamodel.CredentialOwnerType;
import org.apache.airavata.credential.store.datamodel.PasswordCredential;
import org.apache.airavata.credential.store.datamodel.SSHCredential;
import org.apache.airavata.credential.store.datamodel.SSHCredentialSummary;
@@ -441,7 +442,7 @@ public class AiravataServerHandler implements Airavata.Iface {
@Override
@SecurityCheck
- public String generateAndRegisterSSHKeys(AuthzToken authzToken, String gatewayId, String userName) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
+ public String generateAndRegisterSSHKeys(AuthzToken authzToken, String gatewayId, String userName, String description, CredentialOwnerType credentialOwnerType) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
try {
if (csClient == null){
csClient = getCredentialStoreServiceClient();
@@ -449,29 +450,10 @@ public class AiravataServerHandler implements Airavata.Iface {
SSHCredential sshCredential = new SSHCredential();
sshCredential.setUsername(userName);
sshCredential.setGatewayId(gatewayId);
- String key = csClient.addSSHCredential(sshCredential);
- logger.debug("Airavata generated SSH keys for gateway : " + gatewayId + " and for user : " + userName);
- return key;
- }catch (Exception e){
- logger.error("Error occurred while registering SSH Credential", e);
- AiravataSystemException exception = new AiravataSystemException();
- exception.setAiravataErrorType(AiravataErrorType.INTERNAL_ERROR);
- exception.setMessage("Error occurred while registering SSH Credential. More info : " + e.getMessage());
- throw exception;
- }
- }
-
- @Override
- @SecurityCheck
- public String generateAndRegisterSSHKeysWithDescription(AuthzToken authzToken, String gatewayId, String userName, String desc) throws InvalidRequestException, AiravataClientException, AiravataSystemException, TException {
- try {
- if (csClient == null){
- csClient = getCredentialStoreServiceClient();
+ sshCredential.setDescription(description);
+ if (credentialOwnerType != null) {
+ sshCredential.setCredentialOwnerType(credentialOwnerType);
}
- SSHCredential sshCredential = new SSHCredential();
- sshCredential.setUsername(userName);
- sshCredential.setGatewayId(gatewayId);
- sshCredential.setDescription(desc);
String key = csClient.addSSHCredential(sshCredential);
logger.debug("Airavata generated SSH keys for gateway : " + gatewayId + " and for user : " + userName);
return key;
http://git-wip-us.apache.org/repos/asf/airavata/blob/2e05c239/airavata-api/airavata-api-stubs/pom.xml
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-stubs/pom.xml b/airavata-api/airavata-api-stubs/pom.xml
index 7dbf8d4..0e23ec3 100644
--- a/airavata-api/airavata-api-stubs/pom.xml
+++ b/airavata-api/airavata-api-stubs/pom.xml
@@ -25,12 +25,17 @@
<url>http://airavata.apache.org/</url>
<dependencies>
- <dependency>
+ <dependency>
<groupId>org.apache.airavata</groupId>
<artifactId>airavata-data-models</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>org.apache.airavata</groupId>
+ <artifactId>airavata-credential-store-stubs</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
<version>${thrift.version}</version>