Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OIDC #168

Draft
wants to merge 97 commits into
base: main
Choose a base branch
from
Draft

OIDC #168

Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
ea7bc41
chore(oidc): generate migration
kloenk Aug 11, 2024
2d2a6b8
chore(oidc): implement backend routes for one oidc provider named oidc
kloenk Aug 12, 2024
4cb4d20
feat(oidc): Add OIDC authentication framework
kloenk Aug 12, 2024
b6c2650
Translated using Weblate (Swedish)
weblate Aug 12, 2024
695b6d6
Added translation using Weblate (Chinese (Traditional))
weblate Aug 13, 2024
fc95d2c
Translated using Weblate (Chinese (Traditional))
weblate Aug 13, 2024
639f795
[LANGUAGE UPDATE] Frontend translations for Italian and German (#170)
lukasitaly Aug 14, 2024
43676ab
Translated using Weblate (French)
weblate Aug 15, 2024
39163f3
Translated using Weblate (French)
weblate Aug 16, 2024
f0a3780
Added translation using Weblate (Spanish)
weblate Aug 22, 2024
0348da3
Translated using Weblate (Spanish)
weblate Aug 22, 2024
40cbccf
Translated using Weblate (Spanish)
weblate Aug 22, 2024
7891af3
Translated using Weblate (Spanish)
weblate Aug 22, 2024
050f22f
Translated using Weblate (Spanish)
weblate Aug 22, 2024
66882d6
Translated using Weblate (Spanish)
weblate Aug 22, 2024
cffe57b
Added translation using Weblate (Russian)
weblate Aug 24, 2024
fe880cc
Translated using Weblate (Russian)
weblate Aug 24, 2024
33ee208
Translated using Weblate (Russian)
weblate Aug 24, 2024
b56b5d2
Translated using Weblate (Russian)
weblate Aug 25, 2024
1688773
adding email validator (#178)
RomuloGatto Aug 25, 2024
f22bce7
Translated using Weblate (Russian)
weblate Aug 28, 2024
593da25
fix: CSV export not including item notes (#180)
LarssonOliver Aug 28, 2024
7647ea9
added the ability to add a photo in the item creation modal (#173)
cjmielke Aug 29, 2024
7114f26
Translated using Weblate (French)
weblate Aug 29, 2024
52a44da
Translated using Weblate (French)
weblate Aug 29, 2024
0dacc97
Translated using Weblate (French)
weblate Aug 30, 2024
9f7a119
Translated using Weblate (Russian)
weblate Aug 31, 2024
c2d0cce
Translated using Weblate (Turkish)
weblate Aug 31, 2024
ea57981
Translated using Weblate (Turkish)
weblate Aug 31, 2024
d72437d
Update config.mts
tankerkiller125 Sep 1, 2024
7baf58a
Translated using Weblate (Turkish)
weblate Sep 1, 2024
3e6f4b3
Added translation using Weblate (Chinese (Simplified))
weblate Sep 1, 2024
5497a10
Translated using Weblate (Chinese (Simplified))
weblate Sep 1, 2024
7b14694
Translated using Weblate (Chinese (Simplified))
weblate Sep 1, 2024
6051e1f
Translated using Weblate (Chinese (Simplified))
weblate Sep 1, 2024
760cc8e
Translated using Weblate (Chinese (Simplified))
weblate Sep 1, 2024
1601e52
Translated using Weblate (Chinese (Simplified))
weblate Sep 1, 2024
3a949ae
Translated using Weblate (Chinese (Simplified))
weblate Sep 1, 2024
343e56b
Translated using Weblate (Chinese (Simplified))
weblate Sep 1, 2024
3c273b3
Translated using Weblate (Chinese (Simplified))
weblate Sep 1, 2024
85e5c7e
Translated using Weblate (Chinese (Simplified))
weblate Sep 1, 2024
dbe77ea
Translated using Weblate (Chinese (Simplified))
weblate Sep 2, 2024
09358aa
Translated using Weblate (Chinese (Traditional))
weblate Sep 3, 2024
02c0453
Translated using Weblate (French)
weblate Sep 4, 2024
b06d670
Added translation using Weblate (Slovenian)
weblate Sep 5, 2024
4ef7529
Translated using Weblate (Slovenian)
weblate Sep 5, 2024
526799c
Added translation using Weblate (Catalan)
weblate Sep 5, 2024
c3628e3
Translated using Weblate (French)
weblate Sep 5, 2024
67c5006
fix: styles on home page (#193)
tonyaellie Sep 5, 2024
1e81b4b
feat: improve loading state for creation and fix types for adding ima…
tonyaellie Sep 5, 2024
0ab95fb
feat: compare filter values on a unique field instead of by reference…
tonyaellie Sep 5, 2024
7c855cf
fix: regional languages not matching correctly
tankerkiller125 Sep 5, 2024
0946310
Added translation using Weblate (Polish)
weblate Sep 5, 2024
80d5682
Translated using Weblate (German)
weblate Sep 5, 2024
d0b9f74
Translated using Weblate (Polish)
weblate Sep 5, 2024
c0e2aa5
Merge pull request #197
tonyaellie Sep 5, 2024
25c7652
Merge pull request #185
tonyaellie Sep 5, 2024
6b59838
Translated using Weblate (Polish)
weblate Sep 6, 2024
25d7204
Added translation using Weblate (Hungarian)
weblate Sep 6, 2024
15925de
feat: add eslint-plugin-tailwindcss (#199)
tonyaellie Sep 6, 2024
ffb538e
Translated using Weblate (Hungarian)
weblate Sep 7, 2024
a6aafeb
fix: compare all browser languages with available offerings.
tankerkiller125 Sep 7, 2024
ec9cdb3
Merge remote-tracking branch 'origin/main'
tankerkiller125 Sep 7, 2024
209bb29
refactor: cleaned up translation matching
tankerkiller125 Sep 7, 2024
42c01ad
feat: translate tools page
tankerkiller125 Sep 7, 2024
c428a22
docs: add screenshot of home screen
tankerkiller125 Sep 7, 2024
2fee607
feat: allow the hiding of the header (#202)
tankerkiller125 Sep 7, 2024
489deda
Update README.md
tankerkiller125 Sep 7, 2024
baf8912
Added translation using Weblate (Portuguese (Brazil))
weblate Sep 7, 2024
adb4b52
Fix Registration Disabled button in login page (#203)
edward-shen Sep 8, 2024
f113de1
docs: add demo link to doc site
tankerkiller125 Sep 8, 2024
cf2edc8
fix: Use region specific chinese (instead of simplified vs traditional)
tankerkiller125 Sep 8, 2024
b37cf24
feat: user selectable language
tankerkiller125 Sep 8, 2024
5de649d
feat: update PNPM dependencies
tankerkiller125 Sep 8, 2024
93f13b1
chore: update go dependencies
tankerkiller125 Sep 8, 2024
dafc6aa
update links (#206)
tonyaellie Sep 9, 2024
fb62f51
feat: refresh search on include archived change (#208)
tonyaellie Sep 9, 2024
b18f0c7
feat: make ItemViewTable headers customisable
tonyaellie Sep 9, 2024
19c6d4d
Translated using Weblate (Chinese (Simplified))
weblate Sep 10, 2024
9e3f82f
fix: action should run at midnight for nightly builds
tankerkiller125 Sep 10, 2024
784cc40
Translated using Weblate (German)
weblate Sep 11, 2024
073aade
feat: show item is archived in more places (#210)
tonyaellie Sep 11, 2024
404791a
Translated using Weblate (French)
weblate Sep 12, 2024
8ef1b8b
docs: add installation page
Gabrinator Sep 13, 2024
a6e4929
docs: update navigation
Gabrinator Sep 13, 2024
f8482b1
docs: fix typo in index.md
Gabrinator Sep 13, 2024
88dc943
docs: added Configure Homebox Page
Gabrinator Sep 13, 2024
5fc7b3e
docs: update quick-stard.md
Gabrinator Sep 13, 2024
6800c21
Merge pull request #221 from Gabrinator/update-docs
katosdev Sep 13, 2024
405d0c7
Merge pull request #212 from tonyaellie/make-ItemViewTable-headers-cu…
katosdev Sep 13, 2024
214b16a
chore: update go dependencies
tankerkiller125 Sep 14, 2024
4d93784
chore(oidc): generate migration
kloenk Aug 11, 2024
74172cc
chore(oidc): implement backend routes for one oidc provider named oidc
kloenk Aug 12, 2024
d03a3e1
feat(oidc): Add OIDC authentication framework
kloenk Aug 12, 2024
68bbddd
chore: update go dependencies
tankerkiller125 Sep 14, 2024
e1dd5ed
Merge remote-tracking branch 'kloenk/oidc' into fork/kloenk/oidc
tankerkiller125 Sep 14, 2024
62adbb0
fix: minor merge error
tankerkiller125 Sep 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions backend/app/api/providers/extractors.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package providers

import (
"errors"
"github.com/sysadminsmedia/homebox/backend/internal/core/services"
"net/http"

"github.com/hay-kot/httpkit/server"
Expand Down Expand Up @@ -53,3 +54,41 @@ func getLoginForm(r *http.Request) (LoginForm, error) {

return loginForm, nil
}

func getOAuthForm(r *http.Request) (services.OAuthValidate, error) {
var oauthForm services.OAuthValidate
switch r.Header.Get("Content-Type") {
case "application/x-www-form-urlencoded":
err := r.ParseForm()
if err != nil {
return oauthForm, errors.New("failed to parse form")
}

oauthForm.Issuer = r.PostFormValue("issuer")
oauthForm.Code = r.PostFormValue("code")
oauthForm.State = r.PostFormValue("state")
case "application/json":
err := server.Decode(r, &oauthForm)
if err != nil {
log.Err(err).Msg("failed to decode OAuth form")
return oauthForm, err
}
default:
return oauthForm, errors.New("invalid content type")
}

if oauthForm.Issuer == "" || oauthForm.Code == "" {
return oauthForm, validate.NewFieldErrors(
validate.FieldError{
Field: "iss",
Error: "Issuer is empty",
},
validate.FieldError{
Field: "code",
Error: "Code is missing",
},
)
}

return oauthForm, nil
}
67 changes: 67 additions & 0 deletions backend/app/api/providers/oauth.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package providers

import (
"context"
"errors"
"fmt"
"github.com/coreos/go-oidc/v3/oidc"
"github.com/rs/zerolog/log"
"github.com/sysadminsmedia/homebox/backend/internal/core/services"
"golang.org/x/oauth2"
"net/http"
"os"
"strings"
)

type OAuthProvider struct {
name string
service *services.OAuthService
config *services.OAuthConfig
}

func NewOAuthProvider(ctx context.Context, service *services.OAuthService, name string) (*OAuthProvider, error) {
upperName := strings.ToUpper(name)
clientId := os.Getenv(fmt.Sprintf("HBOX_OAUTH_%S_ID", upperName))
clientSecret := os.Getenv(fmt.Sprintf("HBOX_OAUTH_%s_SECRET", upperName))
redirectUri := os.Getenv(fmt.Sprintf("HBOX_OAUTH_%s_REDIRECT", upperName))

providerUrl := os.Getenv(fmt.Sprintf("HBOX_OAUTH_%s_URL", upperName))
// TODO: fallback for all variabnles if no well known is supported
if providerUrl == "" {
return nil, errors.New("Provider url not given")
}
provider, err := oidc.NewProvider(ctx, providerUrl)
if err != nil {
return nil, err
}
log.Debug().Str("AuthUrl", provider.Endpoint().AuthURL).Msg("discovered oauth provider")

return &OAuthProvider{
name: name,
service: service,
config: &services.OAuthConfig{
Config: &oauth2.Config{
ClientID: clientId,
ClientSecret: clientSecret,
Endpoint: provider.Endpoint(),
RedirectURL: redirectUri,
Scopes: []string{oidc.ScopeOpenID, "profile", "email"},
},
Provider: provider,
Verifier: provider.Verifier(&oidc.Config{ClientID: clientId}),
},
}, nil
}

func (p *OAuthProvider) Name() string {
return p.name
}

func (p *OAuthProvider) Authenticate(w http.ResponseWriter, r *http.Request) (services.UserAuthTokenDetail, error) {
oauthForm, err := getOAuthForm(r)
if err != nil {
return services.UserAuthTokenDetail{}, err
}

return p.service.Login(r.Context(), p.config, oauthForm)
}
13 changes: 11 additions & 2 deletions backend/app/api/routes.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"context"
"embed"
"errors"
"fmt"
Expand All @@ -16,6 +17,7 @@ import (
"io"
"mime"
"net/http"
"os"
"path"
"path/filepath"
)
Expand Down Expand Up @@ -66,12 +68,19 @@ func (a *app) mountRoutes(r *chi.Mux, chain *errchain.ErrChain, repos *repo.AllR

r.Get("/currencies", chain.ToHandlerFunc(v1Ctrl.HandleCurrency()))

providers := []v1.AuthProvider{
providerList := []v1.AuthProvider{
providers.NewLocalProvider(a.services.User),
}
if _, exist := os.LookupEnv("HBOX_OAUTH_OIDC_URL"); exist {
provider, err := providers.NewOAuthProvider(context.Background(), a.services.OAuth, "oidc")
if err != nil {
panic(err)
}
providerList = append(providerList, provider)
}

r.Post("/users/register", chain.ToHandlerFunc(v1Ctrl.HandleUserRegistration()))
r.Post("/users/login", chain.ToHandlerFunc(v1Ctrl.HandleAuthLogin(providers...)))
r.Post("/users/login", chain.ToHandlerFunc(v1Ctrl.HandleAuthLogin(providerList...)))

userMW := []errchain.Middleware{
a.mwAuthToken,
Expand Down
12 changes: 9 additions & 3 deletions backend/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require (
entgo.io/ent v0.12.5
github.com/ardanlabs/conf/v3 v3.1.7
github.com/containrrr/shoutrrr v0.8.0
github.com/coreos/go-oidc/v3 v3.11.0
github.com/go-chi/chi/v5 v5.0.12
github.com/go-playground/validator/v10 v10.18.0
github.com/gocarina/gocsv v0.0.0-20231116093920-b87c2d0e983a
Expand All @@ -24,7 +25,8 @@ require (
github.com/swaggo/swag v1.16.3
github.com/yeqown/go-qrcode/v2 v2.2.2
github.com/yeqown/go-qrcode/writer/standard v1.2.2
golang.org/x/crypto v0.23.0
golang.org/x/crypto v0.25.0
golang.org/x/oauth2 v0.21.0
modernc.org/sqlite v1.29.2
)

Expand All @@ -37,6 +39,7 @@ require (
github.com/fatih/color v1.16.0 // indirect
github.com/fogleman/gg v1.3.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/go-jose/go-jose/v4 v4.0.2 // indirect
github.com/go-openapi/inflect v0.19.0 // indirect
github.com/go-openapi/jsonpointer v0.20.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
Expand All @@ -45,6 +48,7 @@ require (
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
Expand All @@ -64,10 +68,12 @@ require (
github.com/zclconf/go-cty v1.14.1 // indirect
golang.org/x/image v0.18.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect
modernc.org/libc v1.41.0 // indirect
Expand Down
28 changes: 28 additions & 0 deletions backend/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ github.com/ardanlabs/conf/v3 v3.1.7 h1:p232cF68TafoA5U9ZlbxUIhGJtGNdKHBXF80Fdqb5
github.com/ardanlabs/conf/v3 v3.1.7/go.mod h1:zclexWKe0NVj6LHQ8NgDDZ7bQ1spE0KeKPFficdtAjU=
github.com/containrrr/shoutrrr v0.8.0 h1:mfG2ATzIS7NR2Ec6XL+xyoHzN97H8WPjir8aYzJUSec=
github.com/containrrr/shoutrrr v0.8.0/go.mod h1:ioyQAyu1LJY6sILuNyKaQaw+9Ttik5QePU8atnAdO2o=
github.com/coreos/go-oidc/v3 v3.11.0 h1:Ia3MxdwpSw702YW0xgfmP1GVCMA9aEFWu12XUZ3/OtI=
github.com/coreos/go-oidc/v3 v3.11.0/go.mod h1:gE3LgjOgFoHi9a4ce4/tJczr0Ai2/BoDhf0r5lltWI0=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand All @@ -29,6 +31,8 @@ github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uq
github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
github.com/go-chi/chi/v5 v5.0.12 h1:9euLV5sTrTNTRUU9POmDUvfxyj6LAABLUcEWO+JJb4s=
github.com/go-chi/chi/v5 v5.0.12/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-jose/go-jose/v4 v4.0.2 h1:R3l3kkBds16bO7ZFAEEcofK0MkrAJt3jlJznWZG0nvk=
github.com/go-jose/go-jose/v4 v4.0.2/go.mod h1:WVf9LFMHh/QVrmqrOfqun0C45tMe3RoiKJMPvgWwLfY=
github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4=
Expand Down Expand Up @@ -65,9 +69,12 @@ github.com/gocarina/gocsv v0.0.0-20231116093920-b87c2d0e983a/go.mod h1:5YoVOkjYA
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ=
Expand Down Expand Up @@ -161,25 +168,46 @@ github.com/yeqown/reedsolomon v1.0.0 h1:x1h/Ej/uJnNu8jaX7GLHBWmZKCAWjEJTetkqaabr
github.com/yeqown/reedsolomon v1.0.0/go.mod h1:P76zpcn2TCuL0ul1Fso373qHRc69LKwAw/Iy6g1WiiM=
github.com/zclconf/go-cty v1.14.1 h1:t9fyA35fwjjUMcmL5hLER+e/rEPqrbCK1/OSE4SI9KA=
github.com/zclconf/go-cty v1.14.1/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ=
golang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E=
golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw=
golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw=
golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs=
golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
6 changes: 5 additions & 1 deletion backend/internal/core/services/all.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

type AllServices struct {
User *UserService
OAuth *OAuthService
Group *GroupService
Items *ItemService
BackgroundService *BackgroundService
Expand Down Expand Up @@ -54,8 +55,11 @@ func New(repos *repo.AllRepos, opts ...OptionsFunc) *AllServices {
opt(options)
}

user := &UserService{repos}

return &AllServices{
User: &UserService{repos},
User: user,
OAuth: &OAuthService{repos: repos, user: user},
Group: &GroupService{repos},
Items: &ItemService{
repo: repos,
Expand Down
Loading