You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by my...@apache.org on 2020/01/30 14:14:54 UTC

[incubator-dlab] branch DLAB-1499 created (now 703183c)

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

mykolabodnar pushed a change to branch DLAB-1499
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git.


      at 703183c  [DLAB-1499]: Noteboks/links are not loaded successfully if project contains more than one edge fixed

This branch includes the following new commits:

     new 703183c  [DLAB-1499]: Noteboks/links are not loaded successfully if project contains more than one edge fixed

The 1 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.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org


[incubator-dlab] 01/01: [DLAB-1499]: Noteboks/links are not loaded successfully if project contains more than one edge fixed

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

mykolabodnar pushed a commit to branch DLAB-1499
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit 703183c60792bbcd3e04d50017a97eee637a4533
Author: Mykola_Bodnar1 <bo...@gmail.com>
AuthorDate: Thu Jan 30 16:14:19 2020 +0200

    [DLAB-1499]: Noteboks/links are not loaded successfully if project contains more than one edge fixed
---
 .../src/project/scripts/configure_keycloak.py      | 24 +++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/infrastructure-provisioning/src/project/scripts/configure_keycloak.py b/infrastructure-provisioning/src/project/scripts/configure_keycloak.py
index 22996d5..a34bd8e 100644
--- a/infrastructure-provisioning/src/project/scripts/configure_keycloak.py
+++ b/infrastructure-provisioning/src/project/scripts/configure_keycloak.py
@@ -81,7 +81,29 @@ if __name__ == "__main__":
         try:
             keycloak_token = requests.post(keycloak_auth_server_url, data=keycloak_auth_data, verify=False).json()
 
-            keycloak_client = requests.post(keycloak_client_create_url, json=keycloak_client_data,
+            keycloak_client_data_check = {
+                "clientId": keycloak_client_name,
+            }
+
+            keycloak_client_id = requests.get(keycloak_client_create_url, data=keycloak_auth_data,
+                                           params=keycloak_client_data_check,
+                                           headers={"Authorization": "Bearer " + keycloak_token.get("access_token"),
+                                                    "Content-Type": "application/json"}, verify=False).json()
+            if keycloak_client_id:
+                keycloak_client_redirectUris = keycloak_client_id[0]['redirectUris']
+                updated_keycloak_redirectUris = keycloak_client_redirectUris + keycloak_redirectUris
+                keycloak_client_data_upd = {
+                    "clientId": keycloak_client_name,
+                    "redirectUris": updated_keycloak_redirectUris,
+                }
+                keycloak_id_of_client = keycloak_client_id[0]['id']
+                keycloak_client_update_url = '{0}/admin/realms/{1}/clients/{2}'.format(args.keycloak_auth_server_url,
+                                                                           args.keycloak_realm_name, keycloak_id_of_client)
+                keycloak_client = requests.put(keycloak_client_update_url, json=keycloak_client_data_upd,
+                             headers={"Authorization": "Bearer " + keycloak_token.get("access_token"),
+                                      "Content-Type": "application/json"}, verify=False)
+            else:
+                keycloak_client = requests.post(keycloak_client_create_url, json=keycloak_client_data,
                                             headers={"Authorization": "Bearer " + keycloak_token.get("access_token"),
                                                      "Content-Type": "application/json"}, verify=False)
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org