Skip to content

Commit

Permalink
Release (#22)
Browse files Browse the repository at this point in the history
* Merge (#17)

* release (#15)

* Eoepca 910 um keycloak develop an identity api based on keycloak api (#9)

* feat: keycloak_client methods added for identity_api

* feat: added scopes crud (for future?) and fixes on permissions and policies cruds

* Merge (#10)

* Update docker compose

* Fix keycloak client constructor

* Update README.md

* Update docker compose

* Add nginx config

* Change nginx

* Add realm admin role

* Remove auth keycloak client (#11)

* Add dummy service demo

* Add dummy-service nginx

* Update demos

* Update nginx configs

* Update gatekeeper config

* feat: added register_general_policy function

* fix: small fix in register_general_policy

* fix: one more fix

* feat: added delete permissions

* feat: added create client function

* Add gatekeeper cookie name

* Improve create client script

* feat: added inputs to script but not working yet

* Update create-client.sh

* Update create-client.sh

* Update create-client.sh

* Update create-client.sh

* Update create-client.sh

* Update create-client.sh

* Update create-client.sh

* Fix issues

* Improve create client script

* Fix issue

* Fix keycloak client

* Cleanup and reformat

---------

Co-authored-by: flaviorosadme <[email protected]>
Co-authored-by: flaviorosadme <[email protected]>

* Cleanup

* Update requirements.yaml

* Update requirements.lock

* Update keycloak_client.py

* Add demo realm import

* Return error if exists

---------

Co-authored-by: flaviorosadme <[email protected]>
Co-authored-by: flaviorosadme <[email protected]>

* Update keycloak_client.py

* Update keycloak_client.py

* Add create group

---------

Co-authored-by: flaviorosadme <[email protected]>
Co-authored-by: flaviorosadme <[email protected]>
  • Loading branch information
3 people authored Dec 21, 2023
1 parent 09d97c6 commit c8bb5b9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion identityutils/keycloak_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,14 @@ def delete_resource_permissions(self, client_id, permission_id):
def create_client(self, payload, skip_exists=True):
return self.keycloak_admin.create_client(payload=payload, skip_exists=skip_exists)


def create_group(self, id, name, skip_exists=True):
payload = {
id: id,
name: name
}
return self.keycloak_admin.create_group(payload=payload, skip_exists=skip_exists)

def generate_protection_pat(self, client_id, client_secret):
"""Generate a personal access token
"""
Expand Down Expand Up @@ -612,4 +620,4 @@ def get_rpt(self, client_id, client_secret, uri, token, ticket):
connection.add_param_headers("Content-Type", "application/x-www-form-urlencoded")
connection.add_param_headers("Authorization", "Bearer " + token)
data = connection.raw_post(urls_patterns.URL_TOKEN.format(**params_path), data=payload)
return raise_error_from_response(data, KeycloakPostError)
return raise_error_from_response(data, KeycloakPostError)

0 comments on commit c8bb5b9

Please sign in to comment.