First release of open core

This commit is contained in:
t
2026-04-02 10:57:36 -04:00
parent 1c94f12d1c
commit 084c1321fc
101 changed files with 8812 additions and 17 deletions

34
pkg/server/app.go Normal file
View File

@@ -0,0 +1,34 @@
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(),
}
}