package sparkles import ( "net/http" "github.com/xlgmokha/x/pkg/mapper" "github.com/xlgmokha/x/pkg/serde" "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/pls" ) func init() { mapper.Register[*http.Request, *domain.Sparkle](func(r *http.Request) *domain.Sparkle { sparkle, err := serde.FromHTTP[*domain.Sparkle](r) if err != nil { pls.LogError(r.Context(), err) } sparkle.Author = cfg.CurrentUser.From(r.Context()) return sparkle }) }