Implement Support for RGW Subusers #641
Replies: 2 comments 3 replies
-
Cool, that's good to hear. @leseb for awareness.
I'm personally not as familiar with these APIs as I would like to be, so I could be talking nonsense, but I wonder if extending the User type with embedding would help here?
How are these field selectors supposed to work? Examples might help.
I think its really great that you wanted to check in with the team on the design first. However, I do find some of the prose a little abstract and that makes it difficult for me to follow. It might help if you posted some inline code examples to help illustrate your points. Alternatively, or in supplement to the discussion, feel free to create draft PR(s) to solicit feedback on a design early but before you personally feel that it is "done". Hope that helps a bit :-) |
Beta Was this translation helpful? Give feedback.
-
BTW while I am at it, the reflection based URL serialization may an overhaul in other places as well. E.g. there is recursion into structs and slices, but only if the struct is tagged with a parameter name, however, that parameter name does not end up in the encoded data (basically because URL parameters are flat). I agree that recursing into the structs without them being tagged is wasteful, but a special purpose tag like (Also, recursing into slices may not be what you want.) Further, the field tag is split at Currently, none of this advanced behaviour is used, all |
Beta Was this translation helpful? Give feedback.
-
The feature has already been requested in #521. I need this functionality for implementing a new feature for rook. So I am about to implement it.
However, there are issues regarding the design of the required code.
The parameters of the API calls are serialized from the
User
object via reflection, the serialization API has no feature to select certain parts of the structure, so if I add the annotations to the relevant subuser fields, I will likely break existing code (since then subuser-fields will be serialized to other API calls where they are invalid when someone reuses a retrieved user object for API calls).I'd propose to extend the serialization tooling and allow to specify fields should be included in the call and which not. This can be done by tagging groups of parameters in the field tags, or by just including plainly which url parameters are acceptable at each specific API call – this would lead to some duplication but then the data can be directly mirrored from the API documentation.
So
valueToURLParams
would gain a second argument (eitherallowedParams []string
ortag string
) and only select matching fields when serializing.Any thoughts on the preferred solution?
Beta Was this translation helpful? Give feedback.
All reactions