You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2018/06/18 18:42:40 UTC

[airavata] branch group-based-auth updated (8863fb9 -> b7b8054)

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a change to branch group-based-auth
in repository https://gitbox.apache.org/repos/asf/airavata.git.


    from 8863fb9  Test framework intital commit
     new 19a0373  AIRAVATA-2837 Log when groupResourceProfileId is missing
     new b7b8054  AIRAVATA-2837 Set experiment id same as before refactor

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/airavata/api/server/handler/AiravataServerHandler.java | 4 +++-
 .../core/repositories/expcatalog/ExperimentRepository.java        | 3 +--
 .../registry/core/repositories/expcatalog/ProjectRepository.java  | 8 ++------
 3 files changed, 6 insertions(+), 9 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
machristie@apache.org.

[airavata] 02/02: AIRAVATA-2837 Set experiment id same as before refactor

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch group-based-auth
in repository https://gitbox.apache.org/repos/asf/airavata.git

commit b7b80546ccec7f858f59b25ef1691312a71ddf9f
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon Jun 18 14:41:09 2018 -0400

    AIRAVATA-2837 Set experiment id same as before refactor
---
 .../core/repositories/expcatalog/ExperimentRepository.java        | 3 +--
 .../registry/core/repositories/expcatalog/ProjectRepository.java  | 8 ++------
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRepository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRepository.java
index 8465404..29bd905 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRepository.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ExperimentRepository.java
@@ -28,7 +28,6 @@ import org.apache.airavata.model.status.ExperimentState;
 import org.apache.airavata.model.status.ExperimentStatus;
 import org.apache.airavata.registry.core.entities.expcatalog.ExperimentEntity;
 import org.apache.airavata.registry.core.utils.DBConstants;
-import org.apache.airavata.registry.core.utils.ExpCatalogUtils;
 import org.apache.airavata.registry.core.utils.ObjectMapperSingleton;
 import org.apache.airavata.registry.core.utils.QueryConstants;
 import org.apache.airavata.registry.cpi.RegistryException;
@@ -57,7 +56,7 @@ public class ExperimentRepository extends ExpCatAbstractRepository<ExperimentMod
     protected ExperimentEntity saveExperiment(ExperimentModel experimentModel) throws RegistryException {
         if (experimentModel.getExperimentId() == null || experimentModel.getExperimentId().equals(airavata_commonsConstants.DEFAULT_ID)) {
             logger.debug("Setting the Experiment's ExperimentId");
-            experimentModel.setExperimentId(ExpCatalogUtils.getID(experimentModel.getExperimentName()));
+            experimentModel.setExperimentId(AiravataUtils.getId(experimentModel.getExperimentName()));
         }
         String experimentId = experimentModel.getExperimentId();
 
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ProjectRepository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ProjectRepository.java
index 1535fe1..6231a6e 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ProjectRepository.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/expcatalog/ProjectRepository.java
@@ -20,6 +20,7 @@
 */
 package org.apache.airavata.registry.core.repositories.expcatalog;
 
+import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.model.commons.airavata_commonsConstants;
 import org.apache.airavata.model.workspace.Project;
 import org.apache.airavata.registry.core.entities.expcatalog.ProjectEntity;
@@ -49,7 +50,7 @@ public class ProjectRepository extends ExpCatAbstractRepository<Project, Project
     protected ProjectEntity saveProject(Project project, String gatewayId) throws RegistryException {
         if (project.getProjectID() == null || project.getProjectID().equals(airavata_commonsConstants.DEFAULT_ID)) {
             logger.debug("Setting the Project's ProjectId");
-            project.setProjectID(getProjectId(project.getName()));
+            project.setProjectID(AiravataUtils.getId(project.getName()));
         }
 
         Mapper mapper = ObjectMapperSingleton.getInstance();
@@ -76,11 +77,6 @@ public class ProjectRepository extends ExpCatAbstractRepository<Project, Project
         saveProjectData(project, projectId);
     }
 
-    private String getProjectId(String projectName){
-        String pro = projectName.replaceAll("\\s", "");
-        return pro + "_" + UUID.randomUUID();
-    }
-
     public Project getProject(String projectId) throws RegistryException {
         return get(projectId);
     }

-- 
To stop receiving notification emails like this one, please contact
machristie@apache.org.

[airavata] 01/02: AIRAVATA-2837 Log when groupResourceProfileId is missing

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch group-based-auth
in repository https://gitbox.apache.org/repos/asf/airavata.git

commit 19a0373b933286bf4ce404af2a5f3701db7ec896
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon Jun 18 14:39:55 2018 -0400

    AIRAVATA-2837 Log when groupResourceProfileId is missing
---
 .../org/apache/airavata/api/server/handler/AiravataServerHandler.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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 0fe59ac..cc81dfd 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
@@ -1868,7 +1868,9 @@ public class AiravataServerHandler implements Airavata.Iface {
                 List<GroupResourceProfile> groupResourceProfiles = getGroupResourceList(authzToken, gatewayId);
                 if (!groupResourceProfiles.isEmpty()) {
                     // Just pick the first one
-                    experiment.getUserConfigurationData().setGroupResourceProfileId(groupResourceProfiles.get(0).getGroupResourceProfileId());
+                    final String groupResourceProfileId = groupResourceProfiles.get(0).getGroupResourceProfileId();
+                    logger.warn("Experiment {} doesn't have groupResourceProfileId, picking first one user has access to: {}", airavataExperimentId, groupResourceProfileId);
+                    experiment.getUserConfigurationData().setGroupResourceProfileId(groupResourceProfileId);
                     regClient.updateExperimentConfiguration(airavataExperimentId, experiment.getUserConfigurationData());
                 } else {
                     throw new AuthorizationException("User " + username + " in gateway " + gatewayId + " doesn't have access to any group resource profiles.");

-- 
To stop receiving notification emails like this one, please contact
machristie@apache.org.