Skip to content

feat(coderd): add endpoint to fetch provisioner key details #15505

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

Merged
merged 13 commits into from
Nov 20, 2024
Prev Previous commit
Next Next commit
generate doc
  • Loading branch information
defelmnq committed Nov 14, 2024
commit 1a019bb254016c1bf79fbb22b392dcf4156e5357
46 changes: 25 additions & 21 deletions coderd/apidoc/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 24 additions & 20 deletions coderd/apidoc/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 35 additions & 32 deletions docs/reference/api/enterprise.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions enterprise/coderd/provisionerkeys.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,13 @@ func (api *API) deleteProvisionerKey(rw http.ResponseWriter, r *http.Request) {

// @Summary Get provisioner key tags by ID
// @ID get-provisioner-key-tags-by-id
// @Security CoderSessionToken
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment should actually be updated as a session token here isn't sufficient auth. Sorry I didn't catch this sooner!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the definition of the /provisionerdaemons/serve endpoint and it looks like it also specifies @Security CoderSessionToken. It looks like that's the only value we allow there currently -- swaggerparser.go enforces this with some special cases for certain endpoints.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed , there's currently some extra logic to change in swaggerparser.go -> https://github.com/coder/coder/blob/main/coderd/coderdtest/swaggerparser.go#L302

I can either keep it like that and create the follow-up issue / PR quickly or add this endpoint to the ignore list for now - as you prefer.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep it as-is for the moment and create a follow-up PR to address this.

// @Produce json
// @Tags Enterprise
// @Param organization path string true "Organization ID"
// @Param provisionerkeyid path string true "Provisioner Key ID" format(uuid)
// @Param provisionerkey path string true "Provisioner Key"
// @Success 200 {object} codersdk.ProvisionerKeyTags
// @Router /organizations/{organization}/provisionerkeys/{provisionerkeyid}/tags [get]
// @Router /organizations/{organization}/provisionerkeys/{provisionerkey}/tags [get]
func (*API) fetchProvisionerKeyTags(rw http.ResponseWriter, r *http.Request) {
var (
ctx = r.Context()
Expand Down
Loading