feat(profile): persist candidate edits and enforce company access
This commit is contained in:
1 parent
3ab6bd91a3
commit
73c7caa225
67 files changed
+5286
-229
No files matched your search
@@ -0,0 +1,32 @@
|
||||
package bootstrap
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"net/netip"
|
||||
|
||||
httpadapter "lincodex/backend/internal/adapter/primary/http"
|
||||
apiadapter "lincodex/backend/internal/adapter/primary/http/api"
|
||||
httpmiddleware "lincodex/backend/internal/adapter/primary/http/middleware"
|
||||
"lincodex/backend/internal/adapter/primary/http/problem"
|
||||
v1 "lincodex/backend/internal/adapter/primary/http/v1"
|
||||
)
|
||||
|
||||
// newRouter installs company authorization even when its database is unavailable.
|
||||
func newRouter(
|
||||
health *v1.HealthHandler,
|
||||
apiHandler apiadapter.Handler,
|
||||
security apiadapter.SecurityHandler,
|
||||
problems *problem.Responder,
|
||||
collector httpmiddleware.RequestMetrics,
|
||||
logger *slog.Logger,
|
||||
trustedProxies []netip.Prefix,
|
||||
organizationHandler *v1.OrganizationHandler,
|
||||
) (http.Handler, error) {
|
||||
var authorizer httpadapter.CompanyAuthorizer
|
||||
if organizationHandler != nil {
|
||||
authorizer = organizationHandler
|
||||
}
|
||||
return httpadapter.NewRouter(health, apiHandler, security, problems,
|
||||
collector, logger, trustedProxies, httpadapter.NewCompanyContextMiddleware(authorizer))
|
||||
}
|
||||
Reference in new issue
Block a user