Chore: Use cache for all signed in user lookups (#88133)

* GetSignedInUser unexported (renamed to getSignedInUser)
* GetSignedInUserWithCacheCtx renamed to GetSignedInUser
* added a check for a nil cacheservice (as defensive programming / test convenience)
This commit is contained in:
Kristin Laemmert
2024-05-22 08:58:16 -04:00
committed by GitHub
parent a5414020f8
commit 16b1e285ea
7 changed files with 23 additions and 23 deletions
+1 -1
View File
@@ -99,7 +99,7 @@ func (a *authenticator) getSignedInUser(ctx context.Context, token string) (*use
}
querySignedInUser := user.GetSignedInUserQuery{UserID: *apikey.ServiceAccountId, OrgID: apikey.OrgID}
signedInUser, err := a.UserService.GetSignedInUserWithCacheCtx(ctx, &querySignedInUser)
signedInUser, err := a.UserService.GetSignedInUser(ctx, &querySignedInUser)
if err != nil {
return nil, err
}
@@ -140,7 +140,7 @@ type fakeUserService struct {
OrgRole org.RoleType
}
func (f *fakeUserService) GetSignedInUserWithCacheCtx(ctx context.Context, query *user.GetSignedInUserQuery) (*user.SignedInUser, error) {
func (f *fakeUserService) GetSignedInUser(ctx context.Context, query *user.GetSignedInUserQuery) (*user.SignedInUser, error) {
return &user.SignedInUser{
UserID: 1,
OrgID: 1,