blob: 4ff10c4c880536f1e2c3fe667cae4da02cf796bd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
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-id-jwt-claim-sub")),
Username: h.Get("x-id-jwt-claim-username"),
ProfileURL: h.Get("x-id-jwt-claim-profile-url"),
Picture: h.Get("x-id-jwt-claim-picture-url"),
}
})
}
|