mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
fix: show user-auth provisioners for all organizations (#16350)
This commit is contained in:
@ -137,6 +137,20 @@ func (api *API) provisionerKeyDaemons(rw http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
sdkKeys := convertProvisionerKeys(pks)
|
||||
|
||||
// For the default organization, we insert three rows for the special
|
||||
// provisioner key types (built-in, user-auth, and psk). We _don't_ insert
|
||||
// those into the database for any other org, but we still need to include the
|
||||
// user-auth key in this list, so we just insert it manually.
|
||||
if !slices.ContainsFunc(sdkKeys, func(key codersdk.ProvisionerKey) bool {
|
||||
return key.ID == codersdk.ProvisionerKeyUUIDUserAuth
|
||||
}) {
|
||||
sdkKeys = append(sdkKeys, codersdk.ProvisionerKey{
|
||||
ID: codersdk.ProvisionerKeyUUIDUserAuth,
|
||||
Name: codersdk.ProvisionerKeyNameUserAuth,
|
||||
Tags: map[string]string{},
|
||||
})
|
||||
}
|
||||
|
||||
daemons, err := api.Database.GetProvisionerDaemonsByOrganization(ctx, database.GetProvisionerDaemonsByOrganizationParams{OrganizationID: organization.ID})
|
||||
if err != nil {
|
||||
httpapi.InternalServerError(rw, err)
|
||||
|
Reference in New Issue
Block a user