Skip to content

Commit de7a6b5

Browse files
committed
chore: Remove url and wildcard url from moon create
It happens on moon register
1 parent 9abfe97 commit de7a6b5

File tree

11 files changed

+24
-86
lines changed

11 files changed

+24
-86
lines changed

coderd/apidoc/docs.go

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/dbfake/databasefake.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5191,8 +5191,6 @@ func (q *fakeQuerier) InsertWorkspaceProxy(_ context.Context, arg database.Inser
51915191
Name: arg.Name,
51925192
DisplayName: arg.DisplayName,
51935193
Icon: arg.Icon,
5194-
Url: arg.Url,
5195-
WildcardHostname: arg.WildcardHostname,
51965194
TokenHashedSecret: arg.TokenHashedSecret,
51975195
CreatedAt: arg.CreatedAt,
51985196
UpdatedAt: arg.UpdatedAt,

coderd/database/queries.sql.go

Lines changed: 3 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/proxies.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
INSERT INTO
33
workspace_proxies (
44
id,
5+
url,
6+
wildcard_hostname,
57
name,
68
display_name,
79
icon,
8-
url,
9-
wildcard_hostname,
1010
token_hashed_secret,
1111
created_at,
1212
updated_at,
1313
deleted
1414
)
1515
VALUES
16-
($1, $2, $3, $4, $5, $6, $7, $8, $9, false) RETURNING *;
16+
($1, '', '', $2, $3, $4, $5, $6, $7, false) RETURNING *;
1717

1818
-- name: RegisterWorkspaceProxy :one
1919
UPDATE

codersdk/workspaceproxy.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ type WorkspaceProxy struct {
2626
}
2727

2828
type CreateWorkspaceProxyRequest struct {
29-
Name string `json:"name"`
30-
DisplayName string `json:"display_name"`
31-
Icon string `json:"icon"`
32-
URL string `json:"url"`
33-
WildcardHostname string `json:"wildcard_hostname"`
29+
Name string `json:"name"`
30+
DisplayName string `json:"display_name"`
31+
Icon string `json:"icon"`
3432
}
3533

3634
type CreateWorkspaceProxyResponse struct {

docs/api/enterprise.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,9 +1236,7 @@ curl -X POST http://coder-server:8080/api/v2/workspaceproxies \
12361236
{
12371237
"display_name": "string",
12381238
"icon": "string",
1239-
"name": "string",
1240-
"url": "string",
1241-
"wildcard_hostname": "string"
1239+
"name": "string"
12421240
}
12431241
```
12441242

docs/api/schemas.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,21 +1557,17 @@ CreateParameterRequest is a structure used to create a new parameter value for a
15571557
{
15581558
"display_name": "string",
15591559
"icon": "string",
1560-
"name": "string",
1561-
"url": "string",
1562-
"wildcard_hostname": "string"
1560+
"name": "string"
15631561
}
15641562
```
15651563

15661564
### Properties
15671565

1568-
| Name | Type | Required | Restrictions | Description |
1569-
| ------------------- | ------ | -------- | ------------ | ----------- |
1570-
| `display_name` | string | false | | |
1571-
| `icon` | string | false | | |
1572-
| `name` | string | false | | |
1573-
| `url` | string | false | | |
1574-
| `wildcard_hostname` | string | false | | |
1566+
| Name | Type | Required | Restrictions | Description |
1567+
| -------------- | ------ | -------- | ------------ | ----------- |
1568+
| `display_name` | string | false | | |
1569+
| `icon` | string | false | | |
1570+
| `name` | string | false | | |
15751571

15761572
## codersdk.CreateWorkspaceRequest
15771573

enterprise/cli/workspaceproxy.go

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,11 @@ func (r *RootCmd) deleteProxy() *clibase.Cmd {
5555

5656
func (r *RootCmd) createProxy() *clibase.Cmd {
5757
var (
58-
proxyName string
59-
displayName string
60-
proxyIcon string
61-
proxyURL string
62-
proxyWildcardHostname string
63-
onlyToken bool
64-
formatter = cliui.NewOutputFormatter(
58+
proxyName string
59+
displayName string
60+
proxyIcon string
61+
onlyToken bool
62+
formatter = cliui.NewOutputFormatter(
6563
// Text formatter should be human readable.
6664
cliui.ChangeFormatterData(cliui.TextFormat(), func(data any) (any, error) {
6765
response, ok := data.(codersdk.CreateWorkspaceProxyResponse)
@@ -94,11 +92,9 @@ func (r *RootCmd) createProxy() *clibase.Cmd {
9492
Handler: func(inv *clibase.Invocation) error {
9593
ctx := inv.Context()
9694
resp, err := client.CreateWorkspaceProxy(ctx, codersdk.CreateWorkspaceProxyRequest{
97-
Name: proxyName,
98-
DisplayName: displayName,
99-
Icon: proxyIcon,
100-
URL: proxyURL,
101-
WildcardHostname: proxyWildcardHostname,
95+
Name: proxyName,
96+
DisplayName: displayName,
97+
Icon: proxyIcon,
10298
})
10399
if err != nil {
104100
return xerrors.Errorf("create workspace proxy: %w", err)
@@ -136,16 +132,6 @@ func (r *RootCmd) createProxy() *clibase.Cmd {
136132
Description: "Display icon of the proxy.",
137133
Value: clibase.StringOf(&proxyIcon),
138134
},
139-
clibase.Option{
140-
Flag: "access-url",
141-
Description: "Access URL of the proxy.",
142-
Value: clibase.StringOf(&proxyURL),
143-
},
144-
clibase.Option{
145-
Flag: "wildcard-access-url",
146-
Description: "(Optional) Access url of the proxy for subdomain based apps.",
147-
Value: clibase.StringOf(&proxyWildcardHostname),
148-
},
149135
clibase.Option{
150136
Flag: "only-token",
151137
Description: "Only print the token. This is useful for scripting.",

enterprise/coderd/workspaceproxy.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -89,24 +89,6 @@ func (api *API) postWorkspaceProxy(rw http.ResponseWriter, r *http.Request) {
8989
return
9090
}
9191

92-
if err := validateProxyURL(req.URL); err != nil {
93-
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
94-
Message: "URL is invalid.",
95-
Detail: err.Error(),
96-
})
97-
return
98-
}
99-
100-
if req.WildcardHostname != "" {
101-
if _, err := httpapi.CompileHostnamePattern(req.WildcardHostname); err != nil {
102-
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
103-
Message: "Wildcard URL is invalid.",
104-
Detail: err.Error(),
105-
})
106-
return
107-
}
108-
}
109-
11092
id := uuid.New()
11193
secret, err := cryptorand.HexString(64)
11294
if err != nil {
@@ -121,8 +103,6 @@ func (api *API) postWorkspaceProxy(rw http.ResponseWriter, r *http.Request) {
121103
Name: req.Name,
122104
DisplayName: req.DisplayName,
123105
Icon: req.Icon,
124-
Url: req.URL,
125-
WildcardHostname: req.WildcardHostname,
126106
TokenHashedSecret: hashedSecret[:],
127107
CreatedAt: database.Now(),
128108
UpdatedAt: database.Now(),

site/src/api/typesGenerated.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,6 @@ export interface CreateWorkspaceProxyRequest {
260260
readonly name: string
261261
readonly display_name: string
262262
readonly icon: string
263-
readonly url: string
264-
readonly wildcard_hostname: string
265263
}
266264

267265
// From codersdk/workspaceproxy.go

0 commit comments

Comments
 (0)