Repository navigation
docs: describe the Authorization API operations and parameters - #31529
Closed
nickvigilante wants to merge 1 commit into
Closed
nickvigilante wants to merge 1 commit into
nickvigilante wants to merge 1 commit into
Conversation
The REST API reference renders these routes from swagger.json, and they had no description. This adds a description to each of the 7 Authorization routes and rewrites the thin or non-standard parameter text on them. 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.
The REST API reference renders each route from
swagger.json, and the 7 Authorization routes had no description.This adds a
@Descriptionto each of them and rewrites the body and path parameter text on them, so each endpoint page says what the call does and what to know before calling it.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.Verification
A JSON diff of
swagger.jsonagainstmainchanges onlydescriptionvalues: 7 added to operations and 7 rewritten on parameters, all on the 7 routes in scope.Claims checked against the code
GET /api/v2/auth/scopescoderd/coderd.go:1475(registered outsideapiKeyMiddleware),coderd/coderdtest/swaggerparser.go:368GET /api/v2/auth/scopesall,application_connect, thecoder:*composite scopes, and theresource:actionscopescoderd/rbac/scopes_catalog.go:90,coderd/rbac/scopes_catalog.go:198POST /api/v2/authcheckcoderd/coderd.go:1953,coderd/authorize.go:198POST /api/v2/authcheckresource_id, each check needsresource_typecoderd/authorize.go:219,coderd/authorize.go:226,coderd/authorize.go:246POST /api/v2/users/logincoderd/coderd.go:1711,coderd/coderdtest/swaggerparser.go:369POST /api/v2/users/login403when password authentication is turned offcoderd/userauth.go:614,coderd/userauth.go:621POST /api/v2/users/loginsession_tokenand sets the session cookiecoderd/userauth.go:566,coderd/userauth.go:569POST /api/v2/users/otp/request403when password authentication is turned offcoderd/coderd.go:1712,coderd/userauth.go:249POST /api/v2/users/otp/request204whether or not the account existscoderd/userauth.go:264POST /api/v2/users/otp/requestcoderd/coderd.go:525,coderd/userauth.go:280,coderd/userauth.go:316POST /api/v2/users/otp/change-passwordcoderd/coderd.go:1714,coderd/coderdtest/swaggerparser.go:371POST /api/v2/users/otp/change-password400for a wrong or expired passcode, or a new password that matches the old onecoderd/userauth.go:407,coderd/userauth.go:420POST /api/v2/users/otp/change-passwordcoderd/userauth.go:443,coderd/userauth.go:371POST /api/v2/users/validate-passwordcoderd/coderd.go:1713, registered in the rate-limited group withoutapiKeyMiddlewarePOST /api/v2/users/validate-passwordvalidanddetailscoderd/userauth.go:494POST /api/v2/users/{user}/convert-logincoderd/userauth.go:130,coderd/userauth.go:139POST /api/v2/users/{user}/convert-logingithuboroidccoderd/userauth.go:113POST /api/v2/users/{user}/convert-logincoderd/userauth.go:176,coderd/userauth.go:204,coderd/userauth.go:2121Writing rules applied
userpath parameter uses the shared wording, because the route usesExtractUserParam.Annotation issues noticed and not changed
These are outside this PR's scope.
POST /api/v2/users/validate-passwordhas@Security CoderSessionToken, but the router serves it withoutapiKeyMiddleware(coderd/coderd.go:1713), andassertSecurityDefineddoesn't list it.POST /api/v2/users/{user}/convert-logintakesuserthroughExtractUserParam, but the handler signs in with the path user's own email and thepasswordin the body, so it needs that user's password and doesn't compare the path user to the session user.Part of DOCS-1439.
Generated by Coder Agents on behalf of @nickvigilante.