Repository navigation
docs: describe the Members API operations and parameters - #31534
Closed
nickvigilante wants to merge 2 commits into
Closed
nickvigilante wants to merge 2 commits into
nickvigilante wants to merge 2 commits into
Conversation
The REST API reference renders these routes from swagger.json, and they had no description. Part of DOCS-1439. Assisted-by: AI
Part of DOCS-1439. Assisted-by: AI
Collaborator
Author
|
Combined into #31562, where this PR's changes are the commit Generated by Coder Agents on behalf of @nickvigilante. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This describes the eleven Members routes that had no
@Descriptionand improves the thin parameter text on them, so the REST API reference renders more than a title.The reference comes from
swagger.json, whichmake genbuilds from these annotations.Merge notes
This PR doesn't touch #31473's exemption lists.
If #31473 merges first,
TestEndpointsDocumentednames each route on this PR to remove from those lists.Existing text I corrected on routes in this list:
usersaid "User ID, name, or me".httpmw.ExtractUserParamtakes an ID, a username, orme, so it now uses the shared wording.organizationsaid "Organization ID", buthttpmw.ExtractOrganizationParamalso accepts a name anddefault.Verification
A JSON diff of
swagger.jsonagainstmainshows 33 changes, all adding or editingdescriptionvalues on these routes and their parameters, and nothing else.check_routes.pywas run against the fresh list for this branch, which matches the shared list except that it reflects these edits.doc-checkran in author self-check mode on the branch diff, persona by persona.The Fact Checker found one wrong claim, which the Skeptic confirmed:
GET /api/v2/users/rolessaid only the Owner and User Admin roles can read role assignments, but the Member role grantsassign_roleread to every user, so the text now says every user has it.The Continuity Editor raised one finding, that
docs/admin/users/groups-roles.mdlists "Change User roles" as Owner only whilePUT .../members/{user}/rolesnames User Admin, and the Skeptic rejected it because the code gives User Admin the assign permission and the docs table is about site roles.The Copy Editor found nothing.
The fix is in the follow-up commit, and the swagger tests,
check_routes.py, and theswagger.jsondiff were run again.Claims checked against the code
POST /api/v2/organizations/{organization}/members/roles,PUTsame path,DELETE .../roles/{roleName}enterprise/coderd/coderd.go:469(RequireFeatureMW(codersdk.FeatureCustomRoles))coderd/database/dbauthz/dbauthz.go:6602,:8166,:2426,coderd/rbac/roles.go:414(Owner),:587(Organization Admin, all permissions except the listed ones),:657(Organization User Admin has only assign, unassign, read)POST .../members/rolesenterprise/coderd/roles.go:304,:320to:343PUT .../members/rolesenterprise/coderd/roles.go:165to:167,:276PUT .../members/rolesenterprise/coderd/roles.go:154GET /api/v2/organizations/{organization}/members/rolesassignablecoderd/roles.go:73,coderd/rbac/roles.go:1188,coderd/roles.go:100to:118GET /api/v2/users/rolescoderd/roles.go:32,coderd/rbac/roles.go:446to:452(Member role)POST .../members/{user}coderd/coderd.go:1598(ExtractUserParam),coderd/database/dbauthz/dbauthz.go:5580,:6749,coderd/rbac/roles.go:547,:659POST .../members/{user}coderd/members.go:54,:626POST .../members/{user}coderd/members.go:63(Roles: []string{})DELETE .../members/{user}coderd/database/dbauthz/dbauthz.go:2668,coderd/rbac/roles.go:547,:659DELETE .../members/{user}coderd/members.go:134GET .../members/{user},GET .../memberscoderd/database/dbauthz/dbauthz.go:7578(fetchWithPostFilter)GET .../paginated-memberscoderd/database/dbauthz/dbauthz.go:7582,coderd/rbac/roles.go:492,:525,:547,:633,:659,:686GET .../paginated-membersafter_idis a user IDcoderd/database/queries/organizationmembers.sql:120,:231GET .../paginated-membersqkeyscoderd/searchquery/search.go:217to:231(searchquery.Users),coderd/members.go:297GET .../paginated-memberslimitandoffsetdefaults of0coderd/pagination.go:19to:23(ParsePagination),coderd/members.go:306PUT .../members/{user}/rolescoderd/members.go:451PUT .../members/{user}/rolescoderd/members.go:445,:494to:512PUT .../members/{user}/rolescoderd/database/dbauthz/dbauthz.go:8329,:1431(canAssignRoles),coderd/rbac/roles.go:538,:657{user}and{organization}path parameterscoderd/httpmw/userparam.go:51to:110,coderd/httpmw/organizationparam.go:54to:96Writing rules applied
dbauthzorAuthorizecalls andcoderd/rbac/roles.go.RequireFeatureMW.GET .../membersroute keeps@Deprecatedand names its replacement by full path.user,organization,limit, andoffset, copied exactly, and a specificafter_idbecause the handler pages by user ID.CI flakes unrelated to this change
test-go-pg (windows-2022)failedTestFailedRecoveryPreservesTranscript/unconfigured, a Coder Agents test that this PR doesn't touch: https://github.com/coder/coder/actions/runs/40926927636/job/123635080199Part of DOCS-1439.
Generated by Coder Agents on behalf of @nickvigilante.