feat: deployment flags (#4426)

This commit is contained in:
Garrett Delfosse
2022-10-10 15:04:15 -04:00
committed by GitHub
parent b50bb99fe7
commit b1faaef482
11 changed files with 949 additions and 284 deletions
+18
View File
@@ -0,0 +1,18 @@
package coderd
import (
"net/http"
"github.com/coder/coder/cli/deployment"
"github.com/coder/coder/coderd/httpapi"
"github.com/coder/coder/coderd/rbac"
)
func (api *API) deploymentFlags(rw http.ResponseWriter, r *http.Request) {
if !api.Authorize(r, rbac.ActionRead, rbac.ResourceDeploymentFlags) {
httpapi.Forbidden(rw)
return
}
httpapi.Write(r.Context(), rw, http.StatusOK, deployment.RemoveSensitiveValues(*api.DeploymentFlags))
}