Files
core/pkg/server/app.go

35 lines
762 B
Go
Raw Normal View History

2026-04-02 10:57:36 -04:00
package server
import (
"net/http"
"epigas.gitea.cloud/RiskRancher/core/pkg/domain"
"epigas.gitea.cloud/RiskRancher/core/pkg/sla"
)
type App struct {
Store domain.Store
Router *http.ServeMux
Auth domain.Authenticator
SLA domain.SLACalculator
}
type FreeAuth struct{}
func (f *FreeAuth) Middleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// In the OSS version, we just pass the request to the next handler for now.
next.ServeHTTP(w, r)
})
}
// NewApp creates a Risk Rancher Core application with OSS defaults.
func NewApp(store domain.Store) *App {
return &App{
Store: store,
Router: http.NewServeMux(),
Auth: &FreeAuth{},
SLA: sla.NewSLACalculator(),
}
}