Skip to content
Snippets Groups Projects

keycloak: Install users to keycloak instance

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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)

  • Merge request was accepted

  • Antoine Lambert approved this merge request

    approved this merge request

    • Adapt according to suggestion
    • Add logs
  • Fix wrong password value

  • Merge request was merged

  • Please register or sign in to reply
    Loading