Skip to content

Commit

Permalink
squashme: minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
olevski committed Nov 21, 2023
1 parent 513e309 commit cff0800
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
4 changes: 3 additions & 1 deletion helm-chart/renku/templates/setup-job-keycloak-realms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ spec:
- name: CLI_KC_CLIENT_ATTRIBUTES
value: '{"access.token.lifespan": "86400", "oauth2.device.authorization.grant.enabled": true, "oauth2.device.polling.interval": "5"}'
- name: CLI_KC_CLIENT_OAUTH_FLOW
value: "device_code"
value: "device"
- name: UI_KC_CLIENT_ID
value: "renku-ui"
- name: UI_KC_CLIENT_SECRET
Expand All @@ -127,6 +127,8 @@ spec:
value: swagger
- name: SWAGGER_KC_CLIENT_PUBLIC
value: "true"
- name: SWAGGER_KC_CLIENT_OAUTH_FLOW
value: "authorization_code"
- name: SWAGGER_KC_CLIENT_ATTRIBUTES
value: '{"pkce.code.challenge.method": "S256"}'
- name: DATASERVICE_KC_CLIENT_ID
Expand Down
6 changes: 3 additions & 3 deletions scripts/init-realm/init-realm.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ def _check_and_create_client(keycloak_admin, new_client: OIDCClient, force: bool

else:
logging.info("not found")
logging.info("Creating {} client...".format(new_client["clientId"]))
keycloak_admin.create_client(new_client)
logging.info("Creating {} client...".format(new_client.id))
keycloak_admin.create_client(new_client.to_dict())
if new_client.oauth_flow == OAuthFlow.client_credentials and new_client.service_account_roles:
service_account_user = keycloak_admin.get_client_service_account_user(new_client.id)
logging.info(f"Assigning service account roles {new_client.service_account_roles}")
Expand Down Expand Up @@ -264,7 +264,7 @@ def _check_and_create_user(keycloak_admin, new_user):
keycloak_admin.connection.realm_name = args.realm


for client in OIDCClientsConfig.from_env():
for client in OIDCClientsConfig.from_env().to_list():
_check_and_create_client(keycloak_admin, client, args.force)

gitlab_oidc_client = OIDCGitlabClient.from_env()
Expand Down
14 changes: 7 additions & 7 deletions scripts/init-realm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,12 @@ def from_env(cls) -> "OIDCClientsConfig":
data_service=OIDCClient.from_env(prefix="DATASERVICE_KC_CLIENT_"),
)

def to_list(self) -> List[Dict[str, Any]]:
def to_list(self) -> List[OIDCClient]:
return [
self.renku.to_dict(),
self.cli.to_dict(),
self.ui.to_dict(),
self.notebooks.to_dict(),
self.swagger.to_dict(),
self.data_service.to_dict(),
self.renku,
self.cli,
self.ui,
self.notebooks,
self.swagger,
self.data_service,
]

0 comments on commit cff0800

Please sign in to comment.