support for 'patch' access (frontend) to update description (for bind address) (#834)

This commit is contained in:
Michael Quigley
2025-02-04 22:16:02 -05:00
parent c9c60b4dd1
commit 2a49705a48
26 changed files with 1545 additions and 0 deletions

View File

@ -166,6 +166,9 @@ func NewZrokAPI(spec *loads.Document) *ZrokAPI {
ShareUnshareHandler: share.UnshareHandlerFunc(func(params share.UnshareParams, principal *rest_model_zrok.Principal) middleware.Responder {
return middleware.NotImplemented("operation share.Unshare has not yet been implemented")
}),
ShareUpdateAccessHandler: share.UpdateAccessHandlerFunc(func(params share.UpdateAccessParams, principal *rest_model_zrok.Principal) middleware.Responder {
return middleware.NotImplemented("operation share.UpdateAccess has not yet been implemented")
}),
AdminUpdateFrontendHandler: admin.UpdateFrontendHandlerFunc(func(params admin.UpdateFrontendParams, principal *rest_model_zrok.Principal) middleware.Responder {
return middleware.NotImplemented("operation admin.UpdateFrontend has not yet been implemented")
}),
@ -306,6 +309,8 @@ type ZrokAPI struct {
ShareUnaccessHandler share.UnaccessHandler
// ShareUnshareHandler sets the operation handler for the unshare operation
ShareUnshareHandler share.UnshareHandler
// ShareUpdateAccessHandler sets the operation handler for the update access operation
ShareUpdateAccessHandler share.UpdateAccessHandler
// AdminUpdateFrontendHandler sets the operation handler for the update frontend operation
AdminUpdateFrontendHandler admin.UpdateFrontendHandler
// ShareUpdateShareHandler sets the operation handler for the update share operation
@ -512,6 +517,9 @@ func (o *ZrokAPI) Validate() error {
if o.ShareUnshareHandler == nil {
unregistered = append(unregistered, "share.UnshareHandler")
}
if o.ShareUpdateAccessHandler == nil {
unregistered = append(unregistered, "share.UpdateAccessHandler")
}
if o.AdminUpdateFrontendHandler == nil {
unregistered = append(unregistered, "admin.UpdateFrontendHandler")
}
@ -782,6 +790,10 @@ func (o *ZrokAPI) initHandlerCache() {
if o.handlers["PATCH"] == nil {
o.handlers["PATCH"] = make(map[string]http.Handler)
}
o.handlers["PATCH"]["/access"] = share.NewUpdateAccess(o.context, o.ShareUpdateAccessHandler)
if o.handlers["PATCH"] == nil {
o.handlers["PATCH"] = make(map[string]http.Handler)
}
o.handlers["PATCH"]["/frontend"] = admin.NewUpdateFrontend(o.context, o.AdminUpdateFrontendHandler)
if o.handlers["PATCH"] == nil {
o.handlers["PATCH"] = make(map[string]http.Handler)