Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: appengine/logdog/coordinator/auth.go

Issue 1863973002: LogDog: Update to archival V2. (Closed) Base URL: https://github.com/luci/luci-go@grpcutil-errors
Patch Set: Code review comments, use Pub/Sub, archival staging, quality of life. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/logdog/coordinator/auth.go
diff --git a/appengine/logdog/coordinator/config/auth.go b/appengine/logdog/coordinator/auth.go
similarity index 83%
rename from appengine/logdog/coordinator/config/auth.go
rename to appengine/logdog/coordinator/auth.go
index 058af2741c7c885e3a8d4130c587a34dd6ddbccc..ff6f0a3126fbda651464f09e1cdacfd79a10bfce 100644
--- a/appengine/logdog/coordinator/config/auth.go
+++ b/appengine/logdog/coordinator/auth.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-package config
+package coordinator
import (
"errors"
@@ -18,22 +18,22 @@ import (
// IsAdminUser tests whether the current user belongs to the administrative
// users group. It will return an error if the user does not.
-func IsAdminUser(c context.Context) error {
- return isMember(c, func(cfg *svcconfig.Coordinator) string {
+func IsAdminUser(c context.Context, svc Services) error {
+ return isMember(c, svc, func(cfg *svcconfig.Coordinator) string {
return cfg.AdminAuthGroup
})
}
// IsServiceUser tests whether the current user belongs to the backend services
// users group. It will return an error if the user does not.
-func IsServiceUser(c context.Context) error {
- return isMember(c, func(cfg *svcconfig.Coordinator) string {
+func IsServiceUser(c context.Context, svc Services) error {
+ return isMember(c, svc, func(cfg *svcconfig.Coordinator) string {
return cfg.ServiceAuthGroup
})
}
-func isMember(c context.Context, groupNameFunc func(*svcconfig.Coordinator) string) error {
- cfg, err := Load(c)
+func isMember(c context.Context, svc Services, groupNameFunc func(*svcconfig.Coordinator) string) error {
+ _, cfg, err := svc.Config(c)
if err != nil {
return err
}

Powered by Google App Engine
This is Rietveld 408576698