Skip to content

Commit

Permalink
Release 1.4 (#34)
Browse files Browse the repository at this point in the history
* Issue #00 chore:  update var names of content service

* Issue #00 chore:  cadvisor limit  memory increased

* Issue #00 chore:  Jenkins slave  limit  memory increased

* Issue #00 chore:  cadvisor limit  memory increased

* Issue #00 chore:  diabled the health_check of learner-service

* Issue #00 chore:  Added health check for learner service

* Issue #00 chore:  incresed exporters limit and reservations memory

* Issue #SB-1236 chore:  Add new content service vars

* Issue #SB-1236 chore:  Update the content service docker file for installing imagemagik

* chore #000: api-onboarding

* Issue #00 chore:  updating mailing list

* Issue #SB-1236 fix: onboarding dialcode apis

* Issue #367  chore:  fix to the es backup

* Issue #367  chore:  fix to the es backup

* Issue #367  chore:  fix to the es backup

* Issue #365  chore:  Cassandra migration

* Issue #367  chore:  es backup issue

* Issue #SB-1403 fix: onboarding framework apis

* Issue #SB-1403 fix: onboarding framework apis

* Issue #SB-1403 fix: onboarding framework apis

* Issue #SB-1403 fix: onboarding framework apis url fix

* Issue #SB-1403 feat: added new api' "copy framework" (#25)

* Issue #000  chore:  MCF AND SSS

* Issue #22 feat: unified script for sunbird installation

* Issue #22 fix: fixed su permission

* Issue #22 fix: updated script for better compatibility

* Issue #22 feat: updated generate config

* Issue #22 feat: updated logging

* Issue #22 fix: updated atomic execution

* Issue #22 fix: ansible versioning fix

* Issue #22 fix: removed duplicated ansible installation

* Issue #22 fix : renamed mcf to config

* Issue #22 fix: removed core from sunbird installation

* Issue #22 feat: updated logging for script

* Issue #22 fix: removed core from unified script

* Issue #22 feat: changed ssl content to path

* Issue #367  chore:  es backup issue

* Issue #22 feat: dynamic inventory creation

* Issue #22 feat: cleanup config

* Issue #22 fix: theme copying is not mandatory

* Issue #22 feat: overriding vars with config

* Issue #22 fix: removed depricated mongodb

* Issue #22 fix: keycloak ansible inventory path

* Issue #22 fix: docker daemon permission denied

* Issue #22 fix: overriding vars

* Issue #22 fix: postgres user not found error

* Issue #22 fix: changed templatig to copying

to avoid infinite variable looping

* Issue #22 fix: idiomatic syntaxing

* Issue #22 fix: syntax error

* Issue #22 fix: syntax errors

* Issue #22 fix: removed templating for static files

* Issue #22 fix: variable

* Issue #22 fix: added static files

* Issue #22 fix: es variable not decalred

* Issue #22 feat: ignoring failed message

because of data already present at db

* Issue #22 feat: overriding vars

* Issue #22 chore:  updated the core services versions

* Issue #22 chore:  Change the environment to env in mcf

* Issue #22 chore:  Change the kong host details

* Issue #22 fix: stop at any error

* Issue #22 chore: jwt token copying

* Issue #22 chore: skip ansible_host_key_verification

* Issue #22 chore: certbot script added

* Issue #22 chore: certbot script added

* Issue #22 chore: certbot script added

* Issue #22 fix: ansible host overriding

* Issue #22 fix: ansible hosts overriding

* Issue #22 feat: removed mcf deps and posix naming conventions

* Issue #22 feat: removed custom sed and bought posix naming conventions

custom sed used to replace the ansible inventory, implimented ansible
idiomatic way.

* Issue #23 feat: restore cassandra to a fresh installation

* Issue #23 feat: cassandra restore

* Issue #23 feat: cassandra backup

* Issue #23 feat: cleaning up

* duplicate of cassandra_complete_backup

* duplicate complete_restore

* Issue #23 feat: posix nomenclature

* Issue #369 chore: fix alerts

* Issue #369 chore: fix alerts

* Issue #369 chore: fix alerts

* Issue #22 fix: updated missing var

* Issue #22 feat: updated unused vars

* Issue #22 fix: cleanup unused vars

* Issue #22 feat: improved docker installation check

* Issue #22 feat: idempotency

* Issue #22 fix: Idempotent deps

* Issue #29 fix: dpkg search failing

* Issue #29 fix: certbot ssl was not getting created

* Issue #22 feat: Updated mandatory and optional fields

* Issue #22 feat: updated for core services

* Issue #22 feat: Updated with jwt creation

* Issue #30 chore: hardcoding the deployer sudo pass

* Issue #22 fix: keycloak is not working after ansible ip overriding

* Issue #22 feat: update variables

* Issue #30 chore:  changed the inventory file

* Issue #30 chore:  changed the inventory file

* Issue #30 chore: postgres installation

* Issue #30 chore: postgres installation

* Script to automate realm management user creation and initial realm import for new keycloak install (#31)

* Issue #496 feat: Script to automate realm management user creation and initial realm import for new keycloak install

* Issue #496 feat: Script to automate realm management user creation and initial realm import for new keycloak install

* Issue #496 feat: Script to automate realm management user creation and initial realm import for new keycloak install

* Issue #31 chore: Script to automate realm management user creation and initial realm import for new keycloak install
  • Loading branch information
Manojvv authored Feb 7, 2018
1 parent 62dc46f commit ecf72fd
Show file tree
Hide file tree
Showing 33 changed files with 4,373 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ansible/roles/keycloak/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ wildfly_standalone_config_path: /opt/keycloak/keycloak/standalone/configuration/
keycloak_ext: <extension module="org.keycloak.keycloak-server-subsystem"/>
#keycloak_subsystem:
#keycloak_cache_container:
#keycloak_default_ds:
#keycloak_default_ds:
keycloak_download_file: keycloak-3.2.0.Final.tar.gz

keycloak_ds_driver_url: https://jdbc.postgresql.org/download/postgresql-9.2.1212.jar
#keycloak_ds_driver_path:
#keycloak_ds_driver_path:
keycloak_ds_driver_name: "postgresql"
keycloak_ds_driver_module: '
<?xml version="1.0" ?>
Expand Down Expand Up @@ -106,3 +106,10 @@ theme: "sunrise.tar.gz"
dest_theme: "/opt/keycloak/themes/"
theme_file: sunrise
keycloak_home: /opt/keycloak
keycloak_realm_json_file_path: "roles/keycloak/files/python-keycloak-0.12.0/keycloak-realm.json"
keycloak_user_manager_roles_json_file_path: "roles/keycloak/files/python-keycloak-0.12.0/roles.json"
keycloak_api_management_username: ""
keycloak_api_management_user_email: ""
keycloak_api_management_user_first_name: ""
keycloak_api_management_user_last_name: ""
keycloak_api_management_user_password: ""
19 changes: 19 additions & 0 deletions ansible/roles/keycloak/files/python-keycloak-0.12.0/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Metadata-Version: 1.1
Name: python-keycloak
Version: 0.12.0
Summary: python-keycloak is a Python package providing access to the Keycloak API.
Home-page: https://bitbucket.org/agriness/python-keycloak
Author: Marcos Pereira
Author-email: [email protected]
License: GNU General Public License - V3
Description-Content-Type: UNKNOWN
Description: UNKNOWN
Keywords: keycloak openid
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Development Status :: 3 - Alpha
Classifier: Operating System :: MacOS
Classifier: Operating System :: Unix
Classifier: Operating System :: Microsoft :: Windows
Classifier: Topic :: Utilities
210 changes: 210 additions & 0 deletions ansible/roles/keycloak/files/python-keycloak-0.12.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
[![Documentation Status](https://readthedocs.org/projects/python-keycloak/badge/?version=latest)](http://python-keycloak.readthedocs.io/en/latest/?badge=latest)

Python Keycloak
====================

For review- see https://bitbucket.org/agriness/python-keycloak

**python-keycloak** is a Python package providing access to the Keycloak API.

## Installation

### Via Pypi Package:

``` $ pip install python-keycloak ```

### Manually

``` $ python setup.py install ```

## Dependencies

python-keycloak depends on:

* Python 3
* [requests](http://docs.python-requests.org/en/master/)
* [python-jose](http://python-jose.readthedocs.io/en/latest/)

### Tests Dependencies

* unittest
* [httmock](https://github.com/patrys/httmock)

## Bug reports

Please report bugs and feature requests at
https://bitbucket.org/agriness/python-keycloak/issues

## Documentation

The documentation for python-keycloak is available on [readthedocs](http://python-keycloak.readthedocs.io).

## Contributors

* [Agriness Team](http://www.agriness.com/pt/)
* [Marcos Pereira]([email protected])
* [Martin Devlin]([email protected])
* [Shon T. Urbas]([email protected]>)

## Usage

```python
from keycloak import KeycloakOpenID

# Configure client
keycloak_openid = KeycloakOpenID(server_url="http://localhost:8080/auth/",
client_id="example_client",
realm_name="example_realm",
client_secret_key="secret")

# Get WellKnow
config_well_know = keycloak_openid.well_know()

# Get Token
token = keycloak_openid.token("user", "password")

# Get Userinfo
userinfo = keycloak_openid.userinfo(token['access_token'])

# Refresh token
token = keycloak_openid.refresh_token(token['refresh_token'])

# Logout
keycloak_openid.logout(token['refresh_token'])

# Get Certs
certs = keycloak_openid.certs()

# Get RPT (Entitlement)
token = keycloak_openid.token("user", "password")
rpt = keycloak_openid.entitlement(token['access_token'], "resource_id")

# Instropect RPT
token_rpt_info = keycloak_openid.introspect(keycloak_openid.introspect(token['access_token'], rpt=rpt['rpt'],
token_type_hint="requesting_party_token"))

# Introspect Token
token_info = keycloak_openid.introspect(token['access_token']))

# Decode Token
KEYCLOAK_PUBLIC_KEY = "secret"
options = {"verify_signature": True, "verify_aud": True, "exp": True}
token_info = keycloak_openid.decode_token(token['access_token'], key=KEYCLOAK_PUBLIC_KEY, options=options)

# Get permissions by token
token = keycloak_openid.token("user", "password")
keycloak_openid.load_authorization_config("example-authz-config.json")
policies = keycloak_openid.get_policies(token['access_token'], method_token_info='decode', key=KEYCLOAK_PUBLIC_KEY)
permissions = keycloak_openid.get_permissions(token['access_token'], method_token_info='introspect')

# KEYCLOAK ADMIN

from keycloak import KeycloakAdmin

keycloak_admin = KeycloakAdmin(server_url="http://localhost:8080/auth/",
username='example-admin',
password='secret',
realm_name="example_realm",
verify=True)

# Add user
new_user = keycloak_admin.create_user({"email": "[email protected]",
"username": "[email protected]",
"enabled": True,
"firstName": "Example",
"lastName": "Example",
"realmRoles": ["user_default", ],
"attributes": {"example": "1,2,3,3,"}})


# Add user and set password
new_user = keycloak_admin.create_user({"email": "[email protected]",
"username": "[email protected]",
"enabled": True,
"firstName": "Example",
"lastName": "Example",
"credentials": [{"value": "secret","type": "password",}],
"realmRoles": ["user_default", ],
"attributes": {"example": "1,2,3,3,"}})

# User counter
count_users = keycloak_admin.users_count()

# Get users Returns a list of users, filtered according to query parameters
users = keycloak_admin.get_users({})

# Get user ID from name
user-id-keycloak = keycloak_admin.get_user_id("[email protected]")

# Get User
user = keycloak_admin.get_user("user-id-keycloak")

# Update User
response = keycloak_admin.update_user(user_id="user-id-keycloak",
payload={'firstName': 'Example Update'})

# Update User Password
response = set_user_password(user_id="user-id-keycloak", password="secret", temporary=True)

# Delete User
response = keycloak_admin.delete_user(user_id="user-id-keycloak")

# Get consents granted by the user
consents = keycloak_admin.consents_user(user_id="user-id-keycloak")

# Send User Action
response = keycloak_admin.send_update_account(user_id="user-id-keycloak",
payload=json.dumps(['UPDATE_PASSWORD']))

# Send Verify Email
response = keycloak_admin.send_verify_email(user_id="user-id-keycloak")

# Get sessions associated with the user
sessions = keycloak_admin.get_sessions(user_id="user-id-keycloak")

# Get themes, social providers, auth providers, and event listeners available on this server
server_info = keycloak_admin.get_server_info()

# Get clients belonging to the realm Returns a list of clients belonging to the realm
clients = keycloak_admin.get_clients()

# Get client - id (not client-id) from client by name
client_id=keycloak_admin.get_client_id("my-client")

# Get representation of the client - id of client (not client-id)
client = keycloak_admin.get_client(client_id="client_id")

# Get all roles for the realm or client
realm_roles = keycloak_admin.get_realm_roles()

# Get all roles for the client
client_roles = keycloak_admin.get_client_roles(client_id="client_id")

# Get client role
role = keycloak_admin.get_client_role(client_id="client_id", role_name="role_name")

# Warning: Deprecated
# Get client role id from name
role_id = keycloak_admin.get_client_role_id(client_id="client_id", role_name="test")

# Create client role
keycloak_admin.create_client_role(client_id, "test")

# Assign client role to user. Note that BOTH role_name and role_id appear to be required.
keycloak_admin.assign_client_role(client_id="client_id", user_id="user_id", role_id="role_id", role_name="test")

# Create new group
group = keycloak_admin.create_group(name="Example Group")

# Get all groups
groups = keycloak_admin.get_groups()

# Get group
group = keycloak_admin.get_group(group_id='group_id')

# Get group by name
group = keycloak_admin.get_group_by_name(name_or_path='group_id', search_in_subgroups=True)

# Function to trigger user sync from provider
sync_users(storage_id="storage_di", action="action")
```
Loading

0 comments on commit ecf72fd

Please sign in to comment.