API endpoints initial models (#42881)

**Related issue:** Resolves #42881

- Added user_api_endpoints table to track per user API endpoint
permissions.
- Added service/api_endpoints, used to handle service/api_endpoints.yml
artifact.
- Added check on server start that makes sure that
service/apin_endpoints.yml is a subset of router routes.
This commit is contained in:
Juan Fernandez
2026-04-07 10:40:39 -04:00
committed by GitHub
parent 07df99daa7
commit 3df6449426
7 changed files with 304 additions and 2 deletions
+4
View File
@@ -1483,6 +1483,10 @@ func runServeCmd(cmd *cobra.Command, configManager configpkg.Manager, debug, dev
apiHandler = service.MakeHandler(svc, config, httpLogger, limiterStore, redisPool, carveStore,
[]endpointer.HandlerRoutesFunc{android_service.GetRoutes(svc, androidSvc), activityRoutes, acmeRoutes}, extra...)
if err := service.ValidateAPIEndpoints(apiHandler); err != nil {
panic(fmt.Sprintf("invalid api_endpoints.yml: %v", err))
}
if serveCSP {
// Only injecting this if CSP is turned on since the default security headers add some overhead to each request
apiHandler = endpointer.BrowserSecurityHeadersHandler(serveCSP, apiHandler)