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

Unified Diff: appengine/logdog/coordinator/endpoints/services/service.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/endpoints/services/service.go
diff --git a/appengine/logdog/coordinator/endpoints/services/service.go b/appengine/logdog/coordinator/endpoints/services/service.go
index 14e9a805531121e471bfc560ecbe59a9cd08c9d4..02a37b25dc10f5d8bdbdf29be9eb887fb3ecf042 100644
--- a/appengine/logdog/coordinator/endpoints/services/service.go
+++ b/appengine/logdog/coordinator/endpoints/services/service.go
@@ -5,21 +5,30 @@
package services
import (
- "github.com/luci/luci-go/appengine/logdog/coordinator/config"
+ "github.com/luci/luci-go/appengine/logdog/coordinator"
"github.com/luci/luci-go/common/api/logdog_coordinator/services/v1"
"github.com/luci/luci-go/common/grpcutil"
log "github.com/luci/luci-go/common/logging"
"golang.org/x/net/context"
)
+// Server is a Cloud Endpoint service supporting privileged support services.
+//
+// This endpoint is restricted to LogDog support service accounts.
+type Server struct {
+ coordinator.ServiceBase
+}
+
+var _ logdog.ServicesServer = (*Server)(nil)
+
// Auth is endpoint middleware that asserts that the current user is a member of
// the configured group.
-func Auth(c context.Context) error {
- if err := config.IsServiceUser(c); err != nil {
+func Auth(c context.Context, svc coordinator.Services) error {
+ if err := coordinator.IsServiceUser(c, svc); err != nil {
log.Fields{
log.ErrorKey: err,
}.Errorf(c, "Failed to authenticate user as a service.")
- if !config.IsMembershipError(err) {
+ if !coordinator.IsMembershipError(err) {
// Not a membership error. Something went wrong on the server's end.
return grpcutil.Internal
}
@@ -27,10 +36,3 @@ func Auth(c context.Context) error {
}
return nil
}
-
-// Server is a Cloud Endpoint service supporting privileged support services.
-//
-// This endpoint is restricted to LogDog support service accounts.
-type Server struct{}
-
-var _ logdog.ServicesServer = (*Server)(nil)

Powered by Google App Engine
This is Rietveld 408576698