keycloak: Install users to keycloak instance
Closed
requested to merge generated-differential-D5279-source into generated-differential-D5279-target
1 unresolved thread
Related to swh-deposit#2858 (closed)
Test Plan
Run through docker
python -m migrate_users_to_keycloak --admin-user admin --admin-pass admin --credentials-path ./staging-users.yaml
INFO:__main__:keycloak server: http://localhost:5080/keycloak/auth/ ; realm: SoftwareHeritage
INFO:__main__:Client: swh-deposit ; client role: swh.deposit.api
INFO:__main__:User 'hal' installed.
INFO:__main__:User 'hal-preprod' installed.
INFO:__main__:User 'hal-test' installed.
INFO:__main__:User 'intel' installed.
INFO:__main__:User 'ipol' installed.
INFO:__main__:User 'swh' installed.
INFO:__main__:User 'swh-worker' installed.
INFO:__main__:User 'swh-olasd' installed.
INFO:__main__:User 'cottagelabs-alexsdutton' installed.
Migrated from D5279 (view on Phabricator)
Merge request reports
Activity
Filter activity
53 """ 54 # Read the credentials file, in yaml format: 55 # - username: "user" 56 # password: "pass" 57 # email: "some@email.org" 58 # - username: "user2" 59 # password: "pass2" 60 # email: "some2@email.org" 61 with open(credentials_path, "r") as f: 62 user_creds = yaml.safe_load(f.read()) 63 64 keycloak_admin = KeycloakAdmin(server_url, admin_user, admin_pass, realm_name=realm_name) 65 66 # Keycloak information 67 client_id = keycloak_admin.get_client_id(client_name) 68 user_role = keycloak_admin.get_client_role(client_id, client_role_name) mentioned in merge request swh-auth!45 (closed)
Some references in the commit message have been migrated:
- T2858 is now swh-deposit#2858 (closed)