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!!!!
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!!!!