feat: add gateway bootstrap endpoint with token-based authentication
Add Bootstrap and AgentSyncBundle handlers to gateway package with X-Gateway-Bootstrap-Token header authentication. Implement UpsertByName repository method for idempotent gateway registration. Update gateway entrypoint script to auto-generate keys and bootstrap gateway on first run, persisting gateway ID to disk. Add GATEWAY_BOOTSTRAP_TOKEN config and update environment variables for gateway name, bootstrap URL, and sync URL.
This commit is contained in:
@@ -36,6 +36,8 @@ func NewRouter(jwtSecret string, handlers Handlers) http.Handler {
|
||||
r.Post("/auth/login", handlers.Auth.Login)
|
||||
r.Post("/auth/refresh", handlers.Auth.Refresh)
|
||||
r.Post("/auth/logout", handlers.Auth.Logout)
|
||||
r.Post("/gateway-agent/bootstrap", handlers.Gateway.Bootstrap)
|
||||
r.Get("/gateway-agent/{id}/sync", handlers.Gateway.AgentSyncBundle)
|
||||
|
||||
r.Group(func(r chi.Router) {
|
||||
r.Use(AuthMiddleware(jwtSecret))
|
||||
|
||||
Reference in New Issue
Block a user