summaryrefslogtreecommitdiff
path: root/app/middleware/user.go
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-04-25 15:36:04 -0600
committermo khan <mo@mokhan.ca>2025-04-25 15:36:04 -0600
commit786c4d2cd0860032e2624cadbbf54891d4269ae2 (patch)
tree3ad2aa0e298d97b431982183224c1e8c6a7ed817 /app/middleware/user.go
parent8836d0744aed44435e35af78d7533ff09db0c62e (diff)
refactor: move key pacakge to cfg
Diffstat (limited to 'app/middleware/user.go')
-rw-r--r--app/middleware/user.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/middleware/user.go b/app/middleware/user.go
index 194ded6..e2f1ce3 100644
--- a/app/middleware/user.go
+++ b/app/middleware/user.go
@@ -6,15 +6,15 @@ import (
"github.com/xlgmokha/x/pkg/log"
"github.com/xlgmokha/x/pkg/mapper"
"github.com/xlgmokha/x/pkg/x"
+ "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/cfg"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/domain"
- "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/key"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/oidc"
)
func User(db domain.Repository[*domain.User]) func(http.Handler) http.Handler {
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- idToken := key.IDToken.From(r.Context())
+ idToken := cfg.IDToken.From(r.Context())
if x.IsZero(idToken) {
next.ServeHTTP(w, r)
return
@@ -30,7 +30,7 @@ func User(db domain.Repository[*domain.User]) func(http.Handler) http.Handler {
}
}
- next.ServeHTTP(w, r.WithContext(key.CurrentUser.With(r.Context(), user)))
+ next.ServeHTTP(w, r.WithContext(cfg.CurrentUser.With(r.Context(), user)))
})
}
}