/v1/groups/{group}#2455
Merged
Merged
Conversation
just-be-dev
approved these changes
Mar 2, 2023
just-be-dev
left a comment
Contributor
There was a problem hiding this comment.
Pretty straight forward. 👍
| #[endpoint { | ||
| method = GET, | ||
| path = "/v1/groups/{group}", | ||
| tags = ["silos"], |
Contributor
There was a problem hiding this comment.
I wonder about the tag here. Isn't anything to be changed in this PR, but should silo scoped resources be listed in the silos tag?
Contributor
Author
There was a problem hiding this comment.
I agree that it's weird. Perhaps even weirder: it seems to only be silo-scoped resources that get this tag. All the /system/silos/* endpoints for working with silos themselves are tagged system. We could probably stand to rework all the tags.
API operations found with tag "silos"
OPERATION ID URL PATH
group_list /groups
group_list_v1 /v1/groups
group_view /v1/groups/{group}
policy_update /policy
policy_update_v1 /v1/policy
policy_view /policy
policy_view_v1 /v1/policy
user_list /users
user_list_v1 /v1/user
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We need this endpoint to power a group detail page in the console where we fetch the group by ID and display its name and the list of users in it.
As mentioned in a comment, groups have an
external_idinstead of anameand therefore don't implementObjectIdentity, which makes doing a lookup by external ID a little less cute than lookup by name.external_idis unique per silo, so looking up by it with the silo implicit is perfectly possible in theory. However, unlike withName, we do not (and probably cannot) enforce that theexternal_idof a group is not a UUID, which means our usual technique of falling back to name only once the thing fails to parse as a UUID does not work. If an external ID was a UUID, there would be no way to fetch a group by it because we would always assume it was one of our DB UUIDs.One option would be to add a query param that allows the caller to specify that the given identifier is meant to be treated as the group external ID and not our DB ID. Another option, which we can do in a followup, is what @zephraph suggested in #2442 (comment): implement the
external_idfilter on the list endpoint instead. Becauseexternal_idis unique per silo, we know this will return either 1 or 0 results. It's a bit odd but it is conceptually consistent and requires no shenanigans.