Possible bug in the keto go sdk

Hi everyone,

I’m currently working on a go micro-service and keto. My micro-service is supposed, when a certain method is called, to remove a user from a keto role. For this purpose I use the keto go sdk (https://github.com/ory/keto-client-go).

For removing the user from the role I use the method named: RemoveOryAccessControlPolicyRoleMembers.
The bug I have is that when I use this method (with the correct parameters) it returns me this error:
unknown error (status 200): {resp:0xc0000e8870}. The sdk interprets a http status code 200 as an error.

After searching a bit on my side, I found this function: https://github.com/ory/keto-client-go/blob/master/client/engines/remove_ory_access_control_policy_role_members_responses.go#L24.
The sdk is expecting a status code 201 when the call success (as it is written in the documentation https://www.ory.sh/docs/keto/sdk/api#remove-a-member-from-an-ory-access-control-policy-role) but in reality keto is returning a http status code 200.

Is it a bug from swagger beeing not up to date, or is it keto that returns the wrong status code ?

PS: I wasn’t able to find the category keto in discourse (is it missing ?)

Yeah, that should definitely include 200 as well - would you be open to create a PR? :slight_smile: The right LOC is here: https://github.com/ory/keto/blob/master/engine/ladon/handler.go#L286

Since it was just 1 LoC I went ahead: https://github.com/ory/keto/pull/161 :slight_smile:

Nice haha,

The sdk repositories doesn’t seem to be self updated

They are, but they require a release of Keto. We are currently planning a new release cycle but due to current circumstances we’re a overloaded with work.

Ok, no problem I can wait :grinning:

Thanks for your answers