Repository: airavata Updated Branches: refs/heads/develop 50cf71e44 -> 82e57526c
http://git-wip-us.apache.org/repos/asf/airavata/blob/82e57526/modules/sharing-registry/thrift_models/sharing_cpi.thrift ---------------------------------------------------------------------- diff --git a/modules/sharing-registry/thrift_models/sharing_cpi.thrift b/modules/sharing-registry/thrift_models/sharing_cpi.thrift new file mode 100644 index 0000000..3b26a27 --- /dev/null +++ b/modules/sharing-registry/thrift_models/sharing_cpi.thrift @@ -0,0 +1,98 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + +namespace java org.apache.airavata.sharing.registry.service.cpi + +include "./sharing_models.thrift" + +service GovRegistryService { + + /** + * Domain Operations + **/ + string createDomain(1: required sharing_models.Domain domain) throws (1: sharing_models.SharingRegistryException gre) + bool updateDomain(1: required sharing_models.Domain domain) throws (1: sharing_models.SharingRegistryException gre) + bool deleteDomain(1: required string domainId) throws (1: sharing_models.SharingRegistryException gre) + sharing_models.Domain getDomain(1: required string domainId) throws (1: sharing_models.SharingRegistryException gre) + list<sharing_models.Domain> getDomains(1: required i32 offset, 2: required i32 limit) throws (1: sharing_models.SharingRegistryException gre); + + /** + * User Operations + **/ + string createUser(1: required sharing_models.User user) throws (1: sharing_models.SharingRegistryException gre) + bool updatedUser(1: required sharing_models.User user) throws (1: sharing_models.SharingRegistryException gre) + bool deleteUser(1: required string userId) throws (1: sharing_models.SharingRegistryException gre) + sharing_models.User getUser(1: required string userId) throws (1: sharing_models.SharingRegistryException gre) + list<sharing_models.User> getUsers(1: required string domain, 2: required i32 offset, 3: required i32 limit) throws (1: sharing_models.SharingRegistryException gre); + + /** + * Group Operations + **/ + string createGroup(1: required sharing_models.UserGroup group) throws (1: sharing_models.SharingRegistryException gre) + bool updateGroup(1: required sharing_models.UserGroup group) throws (1: sharing_models.SharingRegistryException gre) + bool deleteGroup(1: required string groupId) throws (1: sharing_models.SharingRegistryException gre) + sharing_models.UserGroup getGroup(1: required string groupId) throws (1: sharing_models.SharingRegistryException gre) + list<sharing_models.UserGroup> getGroups(1: required string domain, 2: required i32 offset, 3: required i32 limit) + + bool addUsersToGroup(1: required list<string> userIds, 2: required string groupId) throws (1: sharing_models.SharingRegistryException gre); + bool removeUsersFromGroup(1: required list<string> userIds, 2: required string groupId) throws (1: sharing_models.SharingRegistryException gre); + map<string, sharing_models.GroupChildType> getGroupMembers(1: required string groupId, 2: required i32 offset, 3: required i32 limit) throws (1: sharing_models.SharingRegistryException gre); + bool addChildGroupToParentGroup(1: required string childId, 2: required string groupId) throws (1: sharing_models.SharingRegistryException gre); + bool removeChildGroupFromParentGroup(1: required string childId, 2: required string groupId) throws (1: sharing_models.SharingRegistryException gre); + + /** + * EntityType Operations + **/ + string createEntityType(1: required sharing_models.EntityType entityType) throws (1: sharing_models.SharingRegistryException gre) + bool updateEntityType(1: required sharing_models.EntityType entityType) throws (1: sharing_models.SharingRegistryException gre) + bool deleteEntityType(1: required string entityTypeId) throws (1: sharing_models.SharingRegistryException gre) + sharing_models.EntityType getEntityType(1: required string entityTypeId) throws (1: sharing_models.SharingRegistryException gre) + list<sharing_models.EntityType> getEntityTypes(1: required string domain, 2: required i32 offset, 3: required i32 limit) throws (1: sharing_models.SharingRegistryException gre); + + /** + * Entity Operations + **/ + string createEntity(1: required sharing_models.Entity entity) throws (1: sharing_models.SharingRegistryException gre) + bool updateEntity(1: required sharing_models.Entity entity) throws (1: sharing_models.SharingRegistryException gre) + bool deleteEntity(1: required string entityId) throws (1: sharing_models.SharingRegistryException gre) + sharing_models.Entity getEntity(1: required string entityId) throws (1: sharing_models.SharingRegistryException gre) + list<sharing_models.Entity> searchEntities(1: required string userId, 2: required string entityTypeId, 3: required map<sharing_models.EntitySearchFields, + string> filters, 4: required i32 offset, 5: required i32 limit) throws (1: sharing_models.SharingRegistryException gre) + list<sharing_models.User> getListOfSharedUsers(1: required string entityId, 2: required string permissionTypeId) throws (1: sharing_models.SharingRegistryException gre) + list<sharing_models.UserGroup> getListOfSharedGroups(1: required string entityId, 2: required string permissionTypeId) throws (1: sharing_models.SharingRegistryException gre) + + /** + * Permission Operations + **/ + string createPermissionType(1: required sharing_models.PermissionType permissionType) throws (1: sharing_models.SharingRegistryException gre) + bool updatePermissionType(1: required sharing_models.PermissionType permissionType) throws (1: sharing_models.SharingRegistryException gre) + bool deletePermissionType(1: required string entityTypeId) throws (1: sharing_models.SharingRegistryException gre) + sharing_models.PermissionType getPermissionType(1: required string permissionTypeId) throws (1: sharing_models.SharingRegistryException gre) + list<sharing_models.PermissionType> getPermissionTypes(1: required string domain, 2: required i32 offset, 3: required i32 limit) throws (1: sharing_models.SharingRegistryException gre) + + /** + * Sharing Entity with Users and Groups + **/ + bool shareEntityWithUsers(1: required string entityId, 2: required list<string> userList, 3: required string perssionTypeId, 4: required bool cascadePermission) throws (1: sharing_models.SharingRegistryException gre) + bool revokeEntitySharingFromUsers(1: required string entityId, 2: required list<string> userList, 3: required string perssionTypeId ) throws (1: sharing_models.SharingRegistryException gre) + bool shareEntityWithGroups(1: required string entityId, 2: required list<string> groupList, 3: required string perssionTypeId, 4: required bool cascadePermission) throws (1: sharing_models.SharingRegistryException gre) + bool revokeEntitySharingFromGroups(1: required string entityId, 2: required list<string> groupList, 3: required string perssionTypeId) throws (1: sharing_models.SharingRegistryException gre) + bool userHasAccess(1: required string domainId, 2: required string userId, 3: required string entityId, 4: required string permissionTypeId) throws (1: sharing_models.SharingRegistryException gre) +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/82e57526/modules/sharing-registry/thrift_models/sharing_models.thrift ---------------------------------------------------------------------- diff --git a/modules/sharing-registry/thrift_models/sharing_models.thrift b/modules/sharing-registry/thrift_models/sharing_models.thrift new file mode 100644 index 0000000..8e78143 --- /dev/null +++ b/modules/sharing-registry/thrift_models/sharing_models.thrift @@ -0,0 +1,129 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + + namespace java org.apache.airavata.sharing.registry.models + +const string DO_NOT_SET_AT_CLIENTS_ID = "DO_NOT_SET_AT_CLIENTS_ID" + +struct Domain { + 1: optional string domainId = DO_NOT_SET_AT_CLIENTS_ID, + 2: optional string name, + 3: optional string description, + 4: optional i64 createdTime, + 5: optional i64 updatedTime +} + + struct User { + 1: optional string userId = DO_NOT_SET_AT_CLIENTS_ID, + 2: optional string domainId, + 3: optional string userName, + 4: optional i64 createdTime, + 5: optional i64 updatedTime + } + +enum GroupType { + SINGLE_USER, + MULTI_USER +} + + struct UserGroup { + 1: optional string groupId = DO_NOT_SET_AT_CLIENTS_ID, + 2: optional string domainId, + 3: optional string name, + 6: optional string description, + 7: optional string ownerId, + 8: optional i64 createdTime, + 9: optional i64 updatedTime, + 10: optional GroupType groupType + } + + enum GroupChildType { + USER, + GROUP + } + + struct GroupMembership { + 1: optional string parentId, + 2: optional string childId, + 3: optional GroupChildType childType + 4: optional i64 createdTime, + 5: optional i64 updatedTime + } + + + +struct EntityType { + 1: optional string entityTypeId = DO_NOT_SET_AT_CLIENTS_ID, + 2: optional string domainId, + 3: optional string name, + 4: optional string description, + 5: optional i64 createdTime, + 6: optional i64 updatedTime +} + +enum EntitySearchFields { + NAME, + DESCRIPTION, + FULL_TEXT +} + + +struct Entity { + 1: optional string entityId = DO_NOT_SET_AT_CLIENTS_ID, + 2: optional string domainId, + 3: optional string entityTypeId, + 4: optional string ownerId, + 5: optional string parentEntityId, + 6: optional string name, + 7: optional string description, + 8: optional map<string,string> metadata, + 9: optional string fullText, + 10: optional i64 createdTime, + 11: optional i64 updatedTime +} + +struct PermissionType { + 1: optional string permissionTypeId = DO_NOT_SET_AT_CLIENTS_ID, + 2: optional string domainId, + 3: optional string name, + 4: optional string description, + 5: optional i64 createdTime, + 6: optional i64 updatedTime +} + +enum SharingType { + DIRECT_NON_CASCADING, + DIRECT_CASCADING, + INDIRECT_CASCADING + } + +struct Sharing { + 1: optional string permissionTypeId, + 2: optional string entityId, + 3: optional string groupId, + 4: optional SharingType sharingType, + 5: optional string inheritedParentId, + 6: optional i64 createdTime, + 7: optional i64 updatedTime +} + +exception SharingRegistryException { + 1: required string message +} http://git-wip-us.apache.org/repos/asf/airavata/blob/82e57526/modules/sharing-registry/thrift_models/thrift-gen.sh ---------------------------------------------------------------------- diff --git a/modules/sharing-registry/thrift_models/thrift-gen.sh b/modules/sharing-registry/thrift_models/thrift-gen.sh new file mode 100755 index 0000000..c9f2db9 --- /dev/null +++ b/modules/sharing-registry/thrift_models/thrift-gen.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +thrift --gen java sharing_models.thrift +cd gen-java +rm -r ../../sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/* +cp -r org/apache/airavata/sharing/registry/models/ ../../sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/models/ + +cd .. +thrift --gen java sharing_cpi.thrift +cd gen-java +rm -r ../../sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/service/cpi/* +cp -r org/apache/airavata/sharing/registry/service/cpi/ ../../sharing-registry-stubs/src/main/java/org/apache/airavata/sharing/registry/service/cpi/ + +cd .. + +rm -r gen-java \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata/blob/82e57526/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 7f7bca6..71fc9ba 100644 --- a/pom.xml +++ b/pom.xml @@ -630,7 +630,7 @@ <module>modules/server</module> <module>modules/workflow</module> <module>modules/test-suite</module> - <module>modules/group-manager</module> + <module>modules/sharing-registry</module> <!-- Deprecated Modules--> <!--<module>modules/integration-tests</module>--> <!--<module>modules/workflow-model</module>--> http://git-wip-us.apache.org/repos/asf/airavata/blob/82e57526/thrift-interface-descriptions/airavata-apis/airavata_api.thrift ---------------------------------------------------------------------- diff --git a/thrift-interface-descriptions/airavata-apis/airavata_api.thrift b/thrift-interface-descriptions/airavata-apis/airavata_api.thrift index 0f4f802..54bd588 100644 --- a/thrift-interface-descriptions/airavata-apis/airavata_api.thrift +++ b/thrift-interface-descriptions/airavata-apis/airavata_api.thrift @@ -3287,11 +3287,6 @@ bool createGroup(1: required security_model.AuthzToken authzToken, 2: required g 2: airavata_errors.AiravataClientException ace, 3: airavata_errors.AiravataSystemException ase, 4: airavata_errors.AuthorizationException ae) - - bool isDataSharingEnabled() throws (1: airavata_errors.InvalidRequestException ire, - 2: airavata_errors.AiravataClientException ace, - 3: airavata_errors.AiravataSystemException ase, - 4: airavata_errors.AuthorizationException ae) // //End of API }
