Skip to content

Commit

Permalink
fix: add path param for acl api (#64)
Browse files Browse the repository at this point in the history
* fix: add path param for acl api

* fix: json typo

---------

Co-authored-by: liuyu <>
  • Loading branch information
eball authored Jan 15, 2025
1 parent 3187edd commit c4129d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/apis/settings/v1alpha1/handle_headscale.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type SshAcl struct {

type Acl struct {
Proto string `json:"proto"`
Dst []string `json:"Dst"`
Dst []string `json:"dst"`
}

// settings' acl
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/settings/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,13 +471,15 @@ func AddContainer(c *restful.Container) error {
Doc("get app's headscale acl").
Metadata(restfulspec.KeyOpenAPITags, []string{"headscale"}).
Param(ws.HeaderParameter(constants.AuthorizationTokenKey, "Auth token").Required(true)).
Param(ws.PathParameter(ParamAppName, "app name").DataType("string").Required(true)).
Returns(http.StatusOK, "", &response.Response{}))

ws.Route(ws.POST("/headscale/{"+ParamAppName+"}/acl").
To(handler.handleUpdateHeadscaleAppAcl).
Doc("set app's headscale acl").
Metadata(restfulspec.KeyOpenAPITags, []string{"headscale"}).
Param(ws.HeaderParameter(constants.AuthorizationTokenKey, "Auth token").Required(true)).
Param(ws.PathParameter(ParamAppName, "app name").DataType("string").Required(true)).
Returns(http.StatusOK, "", &response.Response{}))

c.Add(ws)
Expand Down

0 comments on commit c4129d3

Please sign in to comment.