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 2022/03/06 12:01:18 UTC
[airavata-custos] branch develop updated: addEXternalIPDLinksOFUsers
This is an automated email from the ASF dual-hosted git repository.
isjarana pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata-custos.git
The following commit(s) were added to refs/heads/develop by this push:
new 39cb0db addEXternalIPDLinksOFUsers
new 6823746 Merge pull request #261 from isururanawaka/develop
39cb0db is described below
commit 39cb0db30eec51fe989ffc1db5533ca9bfe852b8
Author: Isuru Ranawaka <ir...@gmail.com>
AuthorDate: Sun Mar 6 07:00:19 2022 -0500
addEXternalIPDLinksOFUsers
---
.../tenant/manamgement/client/TenantManagementClient.java | 13 +++++++++++++
.../custosauthenticator/custos.py | 2 +-
.../src/main/resources/protos/IamAdminService.proto | 7 +++++++
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/custos-client-sdks/custos-java-clients/tenant-management-client/src/main/java/org/apache/custos/tenant/manamgement/client/TenantManagementClient.java b/custos-client-sdks/custos-java-clients/tenant-management-client/src/main/java/org/apache/custos/tenant/manamgement/client/TenantManagementClient.java
index 3837406..fe190b7 100644
--- a/custos-client-sdks/custos-java-clients/tenant-management-client/src/main/java/org/apache/custos/tenant/manamgement/client/TenantManagementClient.java
+++ b/custos-client-sdks/custos-java-clients/tenant-management-client/src/main/java/org/apache/custos/tenant/manamgement/client/TenantManagementClient.java
@@ -165,6 +165,14 @@ public class TenantManagementClient extends AbstractClient {
return attachedHeaders(userToken).getTenant(tenantRequest);
}
+ public Tenant getTenant(String clientId) {
+ GetTenantRequest tenantRequest = GetTenantRequest
+ .newBuilder()
+ .setClientId(clientId)
+ .build();
+ return blockingStub.getTenant(tenantRequest);
+ }
+
/**
* delete tenant identified by clientId
@@ -175,6 +183,11 @@ public class TenantManagementClient extends AbstractClient {
attachedHeaders(userToken).deleteTenant(tenantRequest);
}
+ public void deleteTenant(String clientId) {
+ DeleteTenantRequest tenantRequest = DeleteTenantRequest.newBuilder().setClientId(clientId).build();
+ blockingStub.deleteTenant(tenantRequest);
+ }
+
/**
* Add tenant roles to tenant
diff --git a/custos-client-sdks/custos_jupyterhub_authenticator/custosauthenticator/custos.py b/custos-client-sdks/custos_jupyterhub_authenticator/custosauthenticator/custos.py
index 9e19723..154f3c4 100644
--- a/custos-client-sdks/custos_jupyterhub_authenticator/custosauthenticator/custos.py
+++ b/custos-client-sdks/custos_jupyterhub_authenticator/custosauthenticator/custos.py
@@ -101,7 +101,7 @@ class CustosOAuthenticator(OAuthenticator):
"""We set up auth_state based on additional Custos info if we
receive it.
"""
-
+
code = handler.get_argument("code")
authS = "{}:{}".format(self.client_id, self.client_secret)
diff --git a/custos-integration-services/custos-integration-services-swagger/src/main/resources/protos/IamAdminService.proto b/custos-integration-services/custos-integration-services-swagger/src/main/resources/protos/IamAdminService.proto
index 42aef71..77fe2bb 100644
--- a/custos-integration-services/custos-integration-services-swagger/src/main/resources/protos/IamAdminService.proto
+++ b/custos-integration-services/custos-integration-services-swagger/src/main/resources/protos/IamAdminService.proto
@@ -429,6 +429,12 @@ message GetExternalIDPsResponse {
repeated ExternalIDPLink idp_links = 1;
}
+message AddExternalIDPLinksRequest {
+ repeated ExternalIDPLink idp_links = 1;
+ int64 tenant_id= 2;
+ string client_id = 3;
+}
+
service IamAdminService {
rpc setUPTenant (SetUpTenantRequest) returns (SetUpTenantResponse);
@@ -453,6 +459,7 @@ service IamAdminService {
rpc removeAdminPrivilege (UserSearchRequest) returns (OperationStatus);
rpc deleteExternalIDPLinksOfUsers(DeleteExternalIDPsRequest) returns (OperationStatus);
rpc getExternalIDPLinksOfUsers(GetExternalIDPsRequest) returns (GetExternalIDPsResponse);
+ rpc addExternalIDPLinksOfUsers(AddExternalIDPLinksRequest) returns (OperationStatus);
rpc registerAndEnableUsers (RegisterUsersRequest) returns (RegisterUsersResponse);
rpc addUserAttributes (AddUserAttributesRequest) returns (OperationStatus);