aboutsummaryrefslogtreecommitdiff
path: root/internal/authz/middleware.go
diff options
context:
space:
mode:
authorMax Resnick <max@ofmax.li>2023-04-02 08:52:52 -0700
committerMax Resnick <max@ofmax.li>2023-05-26 09:47:59 -0700
commit480ce38f8c01de00adf6de651b8c2c57cd2148be (patch)
tree85bd66986cb3f0ad501549e46e649073775e8077 /internal/authz/middleware.go
parent9e04be2ca3d8980ebc8ec791d005ba77382fb1fa (diff)
downloadgo-git-server-480ce38f8c01de00adf6de651b8c2c57cd2148be.tar.gz
Adds a lot of tests adds middleware hook
Diffstat (limited to '')
-rw-r--r--internal/authz/middleware.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/authz/middleware.go b/internal/authz/middleware.go
index f01f262..a35b6b4 100644
--- a/internal/authz/middleware.go
+++ b/internal/authz/middleware.go
@@ -43,7 +43,7 @@ func Authentication(authMap TokenMap, next http.Handler) http.Handler {
func Authorization(adminSvc *admin.Servicer, next http.Handler) http.Handler {
return http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
ctx := req.Context()
- urn := ctx.Value("urn")
+ urn := ctx.Value("urn").(string)
repo := req.URL.Path
action := req.Method
ok, err := adminSvc.Enforce(urn, repo, action)