package middleware import ( "net/http" "github.com/xlgmokha/x/pkg/mapper" "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/domain" ) func init() { mapper.Register(func(h http.Header) *domain.User { return &domain.User{ ID: domain.ID(h.Get("x-jwt-claim-sub")), Username: h.Get("x-jwt-claim-username"), ProfileURL: h.Get("x-jwt-claim-profile-url"), Picture: h.Get("x-jwt-claim-picture-url"), } }) }