fix: improve provisioner key cli usability (#14834)

What this changes:
- Unhides the `--key` flag on provisioner start
- Deprecates and hides `provisionerd` command group in favor of
`provisioner(s)`
- Removes org id from `coder provisioner keys list`
This commit is contained in:
Garrett Delfosse
2024-09-27 10:34:41 -05:00
committed by GitHub
parent 62047e5f68
commit 5cc5bbea04
30 changed files with 329 additions and 131 deletions
+16 -5
View File
@@ -7,6 +7,7 @@ import (
"io"
"net/http"
"net/http/cookiejar"
"strings"
"time"
"github.com/google/uuid"
@@ -274,12 +275,22 @@ func (c *Client) ServeProvisionerDaemon(ctx context.Context, req ServeProvisione
return proto.NewDRPCProvisionerDaemonClient(drpc.MultiplexedConn(session)), nil
}
type ProvisionerKeyTags map[string]string
func (p ProvisionerKeyTags) String() string {
tags := []string{}
for key, value := range p {
tags = append(tags, fmt.Sprintf("%s=%s", key, value))
}
return strings.Join(tags, " ")
}
type ProvisionerKey struct {
ID uuid.UUID `json:"id" table:"-" format:"uuid"`
CreatedAt time.Time `json:"created_at" table:"created at" format:"date-time"`
OrganizationID uuid.UUID `json:"organization" table:"organization id" format:"uuid"`
Name string `json:"name" table:"name,default_sort"`
Tags map[string]string `json:"tags" table:"tags"`
ID uuid.UUID `json:"id" table:"-" format:"uuid"`
CreatedAt time.Time `json:"created_at" table:"created at" format:"date-time"`
OrganizationID uuid.UUID `json:"organization" table:"-" format:"uuid"`
Name string `json:"name" table:"name,default_sort"`
Tags ProvisionerKeyTags `json:"tags" table:"tags"`
// HashedSecret - never include the access token in the API response
}