chore(api): reorganize web assets and codegen types+handlers

This commit is contained in:
Gabe Kangas
2024-07-01 20:12:08 -07:00
parent 2ccd3aad87
commit 5cb4850fce
29 changed files with 4352 additions and 6710 deletions

View File

@@ -0,0 +1,34 @@
package handlers
import (
"net/http"
"github.com/owncast/owncast/controllers/auth/fediverse"
"github.com/owncast/owncast/controllers/auth/indieauth"
"github.com/owncast/owncast/webserver/handlers/generated"
"github.com/owncast/owncast/webserver/router/middleware"
)
func (*ServerInterfaceImpl) StartIndieAuthFlow(w http.ResponseWriter, r *http.Request, params generated.StartIndieAuthFlowParams) {
middleware.RequireUserAccessToken(indieauth.StartAuthFlow)(w, r)
}
func (*ServerInterfaceImpl) HandleIndieAuthRedirect(w http.ResponseWriter, r *http.Request, params generated.HandleIndieAuthRedirectParams) {
indieauth.HandleRedirect(w, r)
}
func (*ServerInterfaceImpl) HandleIndieAuthEndpointGet(w http.ResponseWriter, r *http.Request, params generated.HandleIndieAuthEndpointGetParams) {
middleware.RequireAdminAuth(indieauth.HandleAuthEndpointGet)(w, r)
}
func (*ServerInterfaceImpl) HandleIndieAuthEndpointPost(w http.ResponseWriter, r *http.Request) {
indieauth.HandleAuthEndpointPost(w, r)
}
func (*ServerInterfaceImpl) RegisterFediverseOTPRequest(w http.ResponseWriter, r *http.Request, params generated.RegisterFediverseOTPRequestParams) {
middleware.RequireUserAccessToken(fediverse.RegisterFediverseOTPRequest)(w, r)
}
func (*ServerInterfaceImpl) VerifyFediverseOTPRequest(w http.ResponseWriter, r *http.Request) {
fediverse.VerifyFediverseOTPRequest(w, r)
}