-
Notifications
You must be signed in to change notification settings - Fork 43
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
Allow requesting specific attributes #102
Allow requesting specific attributes #102
Conversation
def record_to_scim(record) | ||
record.to_scim(location: url_for(action: :show, id: record.send(@id_column))) | ||
record.to_scim( | ||
location: url_for(action: :show, id: record.send(@id_column)), | ||
attributes: params.fetch(:attributes, "").split(",") | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this method could be pushed up to ResourcesController
, and let the specializations like ActiveRecordBackedResourcesController
be responsible for supplying objects that respond to to_scim
.
2a1d6ed
to
2a2e126
Compare
Please, let me know if there's anything that I'm missing or could be better. |
Hello, @pond 😄 ! We're looking forward to having this feature in our SCIM endpoint. Do you think we could move forward with this PR? |
I'm really sorry to bother you with PR's, but we're looking to incorporate this feature in our SCIM server, and we might not be able to wait much longer. We're looking for feedback on this and perhaps move this work forward. Thank you |
Can I get a review on this PR? |
Hi @pond we would really love to use this feature in our SCIM implementation. How can we move forward with this PR? |
I've been too busy to get to this, but looking at it today. Please do remember that anyone at any time can fork a gem with their own additions, to incorporate something that they have as a PR but is waiting on a maintainer. Your Gemfile just references the fork.
...so you don't need to wait on me to use a gem modification; you can in the short term use a fork or PR branch directly. |
The other option is, of course, to fork meanwhile as you suggested. We were trying to avoid the overhead of doing it as much as we could hold. |
Well I can't be held to external third party unspecified deadlines, obviously. I misread this as being related to #109 originally - I'm juggling a great many things at the mo., sorry for the confusion if you saw the pre-edit version of this comment via a notification or similar. I might be able to get to it - if we can clear #109, I can get this as next-cab-off-rank. (That said I really don't see how getting a full JSON set back vs a small number of fields is particularly a deal-breaker, and always considered this a feature that's as likely to use enough CPU / RAM on the server side to be more expensive than bandwidth saved, assuming enough requests are coming in to make the bandwidth savings worthwhile). |
@xjunior OK, so this now has a lot of conflicts (as expected) after #109 went in. I can't fix these as your new ...so, first thing, since you've added a new parameter to an already parameter-heavy back end method, please do take care to follow the existing commentary and indentation style to document your new parameter. Then we're in a position to assess how flexible that is, and how it should be applied to the heavily updated from-SCIM backend code. (NB As is often said, the two hardest problems in computing are cache expiry, naming things and off-by-one errors. The parameter name EDITED TO ADD: Yes, I see from reading tests and the reference to #89 that we're talking about https://datatracker.ietf.org/doc/html/rfc7644#section-3.10 representation here, but that needs documenting, String-vs-Symbol needs clarifying in the methods with the new parameter and I'm not sure if you handle schema prefixes in this patch. A good name by the way could be |
@pond I'll work on fixing these conflicts and following your suggestions, thank you! |
@xjunior Thanks. I don't mind this PR being a smaller implementation where e.g. it only handles non-schema prefix attributes etc., it's fine to take baby steps, but yeah defo please do the docs & have a think about parameter names with an eye to potential future changes. I'll try to expedite a review, timezones permitting, once you give me a shout that it's ready for another look. |
I did not. It seems by that prefixes are not required, but recommended:
This implementation supports extension attributes, and the nature of the attribute mapping today doesn't allow a name conflict, but it does not support prefixing extension attributes with their schemas. Would that hold shipping this initial implementation? |
Merging this into a feature branch for further experimentation and hopefully inclusion in a release. |
Allow requesting specific attributes (derived from #102)
Closes #89