aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
Diffstat (limited to 'internal')
-rw-r--r--internal/admin/service.go1
-rw-r--r--internal/authz/middleware.go2
2 files changed, 3 insertions, 0 deletions
diff --git a/internal/admin/service.go b/internal/admin/service.go
index 4f955da..d60a072 100644
--- a/internal/admin/service.go
+++ b/internal/admin/service.go
@@ -65,6 +65,7 @@ func (s *Servicer) InitServer() error {
return fmt.Errorf("cloudn't load policy %w", err)
}
slog.Info("policy loaded")
+ slog.Debug("init server", "repoDir", s.reposDir)
if err := s.Conf.ConfigureRepos(); err != nil {
return fmt.Errorf("couldn't configure repos %w", err)
}
diff --git a/internal/authz/middleware.go b/internal/authz/middleware.go
index 3ba95ad..31f7bf3 100644
--- a/internal/authz/middleware.go
+++ b/internal/authz/middleware.go
@@ -27,6 +27,7 @@ func Authentication(authMap TokenMap, next http.Handler) http.Handler {
u = "anon"
ctx := context.WithValue(req.Context(), AuthzUrnKey, u)
next.ServeHTTP(rw, req.WithContext(ctx))
+ return
}
urn := fmt.Sprintf("uid:%s", u)
hash, ok := authMap[urn]
@@ -76,6 +77,7 @@ func Authorization(adminSvc *admin.Servicer, next http.Handler) http.Handler {
slog.Info("Not Authorized", "urn", urn, "repo", repo)
http.Error(rw, "Access denied", http.StatusForbidden)
return
+
}
slog.Debug("Access Attempt", "action", action, "repo", repo)
next.ServeHTTP(rw, req.WithContext(ctx))