mirror of
https://github.com/coder/coder.git
synced 2025-07-18 14:17:22 +00:00
fix: don't allow "new" or "create" as url-friendly names (#13596)
This commit is contained in:
committed by
GitHub
parent
3a1fa04590
commit
e987ad1d89
@ -18,8 +18,8 @@ const (
|
||||
)
|
||||
|
||||
type CreateGroupRequest struct {
|
||||
Name string `json:"name"`
|
||||
DisplayName string `json:"display_name"`
|
||||
Name string `json:"name" validate:"required,group_name"`
|
||||
DisplayName string `json:"display_name" validate:"omitempty,group_display_name"`
|
||||
AvatarURL string `json:"avatar_url"`
|
||||
QuotaAllowance int `json:"quota_allowance"`
|
||||
}
|
||||
@ -111,8 +111,8 @@ func (c *Client) Group(ctx context.Context, group uuid.UUID) (Group, error) {
|
||||
type PatchGroupRequest struct {
|
||||
AddUsers []string `json:"add_users"`
|
||||
RemoveUsers []string `json:"remove_users"`
|
||||
Name string `json:"name"`
|
||||
DisplayName *string `json:"display_name"`
|
||||
Name string `json:"name" validate:"omitempty,group_name"`
|
||||
DisplayName *string `json:"display_name" validate:"omitempty,group_display_name"`
|
||||
AvatarURL *string `json:"avatar_url"`
|
||||
QuotaAllowance *int `json:"quota_allowance"`
|
||||
}
|
||||
|
@ -41,8 +41,8 @@ func ProvisionerTypeValid[T ProvisionerType | string](pt T) error {
|
||||
// Organization is the JSON representation of a Coder organization.
|
||||
type Organization struct {
|
||||
ID uuid.UUID `table:"id" json:"id" validate:"required" format:"uuid"`
|
||||
Name string `table:"name,default_sort" json:"name" validate:"required,username"`
|
||||
DisplayName string `table:"display_name" json:"display_name" validate:"required"`
|
||||
Name string `table:"name,default_sort" json:"name"`
|
||||
DisplayName string `table:"display_name" json:"display_name"`
|
||||
Description string `table:"description" json:"description"`
|
||||
CreatedAt time.Time `table:"created_at" json:"created_at" validate:"required" format:"date-time"`
|
||||
UpdatedAt time.Time `table:"updated_at" json:"updated_at" validate:"required" format:"date-time"`
|
||||
|
Reference in New Issue
Block a user