Skip to content

Commit

Permalink
fix: CDR-1401 rename Keycloak realm and client
Browse files Browse the repository at this point in the history
  • Loading branch information
vladislavploaia committed Jun 6, 2024
1 parent 4f16c3b commit d73b4e4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Suite Setup Set Library Search Order For Tests

*** Variables ***
${SUT} ADMIN-TEST
&{TEMP_OAUTH_ACCESS_GRANT} client_id=HIP-CDR-EHRbase-Service
&{TEMP_OAUTH_ACCESS_GRANT} client_id=ehrbase
... grant_type=password client_secret=bT5T4oWn3xNdBytQsl2cfpBDi1pp15Va
... username=ehrbase-admin password=EvenMoreSecretPassword1!
## the same configuration as in sut_config.py, ADMIN_TEST_CONFIG
Expand All @@ -28,10 +28,10 @@ ${SUT} ADMIN-TEST
Should Be Equal As Strings ${resp.status_code} 200
Should Be Equal ${TEMP_OAUTH_ACCESS_GRANT['username']} ehrbase-admin

2. cdr-core-sanity-check realm exists - OAUTH Admin User
${resp} R.Get On Session keycloak /realms/cdr-core-sanity-check
2. ehrbase realm exists - OAUTH Admin User
${resp} R.Get On Session keycloak /realms/ehrbase
Status Should Be 200
Should Be Equal ${resp.json()["realm"]} cdr-core-sanity-check
Should Be Equal ${resp.json()["realm"]} ehrbase
Log Token service URL: ${resp.json()["token-service"]} console=yes

3. Test Get Token - OAUTH Admin User
Expand Down Expand Up @@ -100,7 +100,7 @@ Request Access Token
[Arguments] ${grant}
Create Session keycloak ${KEYCLOAK_URL} verify=${False} debug=3
&{headers}= Create Dictionary Content-Type=application/x-www-form-urlencoded
${resp}= R.POST On Session keycloak /realms/cdr-core-sanity-check/protocol/openid-connect/token
${resp}= R.POST On Session keycloak /realms/ehrbase/protocol/openid-connect/token
... expected_status=anything
... data=${grant} headers=${headers}
Set Test Variable ${resp} ${resp}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Suite Setup Set Library Search Order For Tests

*** Variables ***
${SUT} TEST
&{TEMP_OAUTH_ACCESS_GRANT} client_id=HIP-CDR-EHRbase-Service
&{TEMP_OAUTH_ACCESS_GRANT} client_id=ehrbase
... grant_type=password client_secret=bT5T4oWn3xNdBytQsl2cfpBDi1pp15Va
... username=ehrbase-admin password=EvenMoreSecretPassword1!
## the same configuration as in sut_config.py, ADMIN_TEST_CONFIG
Expand All @@ -28,10 +28,10 @@ ${SUT} TEST
Should Be Equal As Strings ${resp.status_code} 200
Should Be Equal ${OAUTH_ACCESS_GRANT['username']} ehrbase-user

2. cdr-core-sanity-check realm exists - OAUTH Normal User
${resp} R.Get On Session keycloak /realms/cdr-core-sanity-check
2. ehrbase realm exists - OAUTH Normal User
${resp} R.Get On Session keycloak /realms/ehrbase
Status Should Be 200
Should Be Equal ${resp.json()["realm"]} cdr-core-sanity-check
Should Be Equal ${resp.json()["realm"]} ehrbase
Log Token service URL: ${resp.json()["token-service"]} console=yes

3. Test Get Token - OAUTH Normal User
Expand Down Expand Up @@ -109,7 +109,7 @@ Request Access Token
[Arguments] ${grant}
Create Session keycloak ${KEYCLOAK_URL} verify=${False} debug=3
&{headers}= Create Dictionary Content-Type=application/x-www-form-urlencoded
${resp}= R.POST On Session keycloak /realms/cdr-core-sanity-check/protocol/openid-connect/token
${resp}= R.POST On Session keycloak /realms/ehrbase/protocol/openid-connect/token
... expected_status=anything
... data=${grant} headers=${headers}
Set Test Variable ${resp} ${resp}
Expand Down
10 changes: 5 additions & 5 deletions tests/robot/_resources/variables/sut_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
# KEYCLOAK SETTINGS
HEADER = {"Content-Type": "application/x-www-form-urlencoded"}
KEYCLOAK_URL = KEYCLOAK_URL_FROM_YAML
KC_AUTH_URL = KEYCLOAK_URL + "/realms/cdr-core-sanity-check/protocol/openid-connect/auth"
KC_ACCESS_TOKEN_URL = KEYCLOAK_URL + "/realms/cdr-core-sanity-check/protocol/openid-connect/token"
KC_JWT_ISSUERURI = KEYCLOAK_URL + "/realms/cdr-core-sanity-check"
KC_AUTH_URL = KEYCLOAK_URL + "/realms/ehrbase/protocol/openid-connect/auth"
KC_ACCESS_TOKEN_URL = KEYCLOAK_URL + "/realms/ehrbase/protocol/openid-connect/token"
KC_JWT_ISSUERURI = KEYCLOAK_URL + "/realms/ehrbase"


# SUT CONFIGURATIONS
Expand Down Expand Up @@ -146,7 +146,7 @@
"NODENAME": "local.ehrbase.org", # alias CREATING_SYSTEM_ID
"CONTROL_MODE": "docker",
"OAUTH_ACCESS_GRANT": {
"client_id": "HIP-CDR-EHRbase-Service",
"client_id": "ehrbase",
"grant_type": "password",
"client_secret": "bT5T4oWn3xNdBytQsl2cfpBDi1pp15Va",
"username": "ehrbase-user",
Expand Down Expand Up @@ -181,7 +181,7 @@
"NODENAME": "local.ehrbase.org", # alias CREATING_SYSTEM_ID
"CONTROL_MODE": "docker",
"OAUTH_ACCESS_GRANT": {
"client_id": "HIP-CDR-EHRbase-Service",
"client_id": "ehrbase",
"grant_type": "password",
"client_secret": "bT5T4oWn3xNdBytQsl2cfpBDi1pp15Va",
"username": "ehrbase-admin",
Expand Down

0 comments on commit d73b4e4

Please sign in to comment.