summaryrefslogtreecommitdiff
path: root/pkg/web/middleware/init.go
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-04-25 11:08:58 -0600
committermo khan <mo@mokhan.ca>2025-04-25 11:08:58 -0600
commit2b1e14690ea6426a67c0faaaddcfb8aa7360dce7 (patch)
tree7f764225e3e3a26bbd7532e72ab99a54e465be92 /pkg/web/middleware/init.go
parent0053db0d265af313dd281db5cf1e73236cde30c6 (diff)
refactor: move db and mountable to app
Diffstat (limited to 'pkg/web/middleware/init.go')
-rw-r--r--pkg/web/middleware/init.go24
1 files changed, 0 insertions, 24 deletions
diff --git a/pkg/web/middleware/init.go b/pkg/web/middleware/init.go
deleted file mode 100644
index f1a693d..0000000
--- a/pkg/web/middleware/init.go
+++ /dev/null
@@ -1,24 +0,0 @@
-package middleware
-
-import (
- "github.com/xlgmokha/x/pkg/mapper"
- "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/domain"
- "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/oidc"
-)
-
-func init() {
- mapper.Register(func(idToken *oidc.IDToken) *domain.User {
- customClaims := &oidc.CustomClaims{}
- if err := idToken.Claims(customClaims); err != nil {
- return &domain.User{ID: domain.ID(idToken.Subject)}
- }
-
- return &domain.User{
- ID: domain.ID(idToken.Subject),
- Username: customClaims.Nickname,
- Email: customClaims.Email,
- ProfileURL: customClaims.ProfileURL,
- Picture: customClaims.Picture,
- }
- })
-}