Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mistyped rgw adminops parameters #656

Open
sebastianriese opened this issue Feb 23, 2022 · 0 comments
Open

Mistyped rgw adminops parameters #656

sebastianriese opened this issue Feb 23, 2022 · 0 comments

Comments

@sebastianriese
Copy link
Contributor

If found the following typing errors/inconsistencies in the adminops interface:

  • The fields User.Supended and User.PurgeData are type *int while the API interprets them as booleans (other booleans are typed *bool).

  • The integer parameters QuotaSpec.MaxSizeKb and User.MaxBuckets are mistyped as *int, while they are int64 resp. int32 on the rgw side. The width *int in will depend on the architecture in go. (Note: It is unclear how this works when the values are returned as json – technically all numbers in json are double floats, so int64 can not be represented faithfully – unless the serializer/deserializer both ignore this when serializing/deserializing according to a schema).

Of course, fixing those issues would break any code referencing those fields (as their types would change). So it will have to decided what is more important – stability of the library or consistency with the RGW adminops API.

Independently of the decision this matter should be well documented.

Putting values other than 0 or 1 in the ints-as-booleans will result in the parameter being silently ignored (the return value of RESTargs::get_bool is ignored at all call sites): https://github.com/ceph/ceph/blob/193895ffba4245787a2f50bbd5b80132f0e76e74/src/rgw/rgw_rest.cc#L957

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant