You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by is...@apache.org on 2020/10/05 13:39:07 UTC
[airavata-custos] branch custos-python-sdk-demo updated: Add SECRET
entity type
This is an automated email from the ASF dual-hosted git repository.
isjarana pushed a commit to branch custos-python-sdk-demo
in repository https://gitbox.apache.org/repos/asf/airavata-custos.git
The following commit(s) were added to refs/heads/custos-python-sdk-demo by this push:
new 1a0e717 Add SECRET entity type
new f91dbdf Merge pull request #110 from isururanawaka/custos-python-sdk-demo
1a0e717 is described below
commit 1a0e7170ce178384d711c9d698460a19cd894c0c
Author: Isuru Ranawaka <ir...@gmail.com>
AuthorDate: Mon Oct 5 09:38:13 2020 -0400
Add SECRET entity type
---
.../secure_resources_with_custos_simulation.py | 23 ++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)
diff --git a/custos-samples/samples/secure_resources_with_custos_simulation.py b/custos-samples/samples/secure_resources_with_custos_simulation.py
index b7887e3..7877a43 100644
--- a/custos-samples/samples/secure_resources_with_custos_simulation.py
+++ b/custos-samples/samples/secure_resources_with_custos_simulation.py
@@ -292,35 +292,42 @@ permissions = [
]
entity_types = [
{
- 'id': 'SSH_KEY',
- 'name': 'SSH_KEY',
- 'description': 'SSH Keys'
+ 'id': 'SECRET',
+ 'name': 'SECRET',
+ 'description': 'SECRET Keys'
}
]
verifiy_admin_user()
+# Register users
register_users(users)
+# Create groups
create_groups(groups)
+# Allocate users to groups
allocate_users_to_groups(user_group_mapping)
+# Allocate child groups to parent group
allocate_child_group_to_parent_group(child_gr_parent_gr_mapping)
+# Creare resource
create_resource()
+# Create permissions
create_permissions(permissions)
+# Create entity types
create_entity_types(entity_types)
resources = [
{
'id': resource_ids[0],
- 'name': 'SSH Key',
+ 'name': 'SECRET',
'description': 'Register SSH Key Id',
'user_id': 'admin',
- 'type': 'SSH_KEY'
+ 'type': 'SECRET'
}
]
@@ -328,7 +335,7 @@ sharings = [
{
"entity_id": resource_ids[0],
"permission_type": "READ",
- "type": "SSH_KEY",
+ "type": "SECRET",
"user_id": "UserF"
}
]
@@ -341,10 +348,14 @@ gr_sharings = [{
"group_name": 'groupA'
}]
+# Register resources
register_resources(resources)
+# Share resource with users
share_resource_with_user(sharings)
+# Share resource with group
share_resource_with_group(gr_sharings)
+# Check user permissions
check_user_permissions(users)