MCPcopy Create free account
hub / github.com/ericls/imgdd / Middleware

Method Middleware

httpserver/identity.go:87–94  ·  view source on GitHub ↗
(next http.Handler)

Source from the content-addressed store, hash-verified

85}
86
87func (i *IdentityManager) Middleware(next http.Handler) http.Handler {
88 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
89 authentication_info := i.makeAuthenticationInfoFromRequest(r)
90 newContext := i.ContextUserManager.WithAuthenticationInfo(r.Context(), authentication_info)
91 r = r.WithContext(newContext)
92 next.ServeHTTP(w, r)
93 })
94}
95
96func (i *IdentityManager) Authenticate(w http.ResponseWriter, r *http.Request, userId string, organizationUserId string) {
97 i.Persister.Rotate(w, r)

Callers 1

newTestContextFunction · 0.95

Tested by 1

newTestContextFunction · 0.76