fix: replace bare type assertions in API clients with proper error handling
Describe the bug
here both microcks_client.go and keycloak_client.go are unmarshalling into map[string]interface{} and then doing direct type assertions… which can get a bit risky
like configResp["enabled"].(bool) or openIDResp["access_token"].(string) etc (few spots across both files)
if the response shape is off then missing field, wrong type, or even an HTML error page and this will just panic and crash the CLI instead of returning a proper error.. better to switch to typed structs and let json.Unmarshal handle validation, also gets rid of all those assertions.
happy to open a PR if that works!!!!
That works for sure! Please check what the scope covered by #272 is. From what I understand, it only covers the Keycloak connector but you'd better check
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
It will be closed in 30 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. Microcks is a Cloud Native Computing Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience :heart: