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

Unified Diff: dm/appengine/deps/auth.go

Issue 2575383002: Add server/cache support to gaeconfig. (Closed)
Patch Set: Un-collapse. Created 3 years, 11 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
« no previous file with comments | « dm/api/template/loader.go ('k') | dm/appengine/distributor/fake/fake.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/appengine/deps/auth.go
diff --git a/dm/appengine/deps/auth.go b/dm/appengine/deps/auth.go
index 04f6d5012dbccba7d11e229d1d9be68858038fa5..3dc9264c9d13bdd922ffa2678583d069285673b9 100644
--- a/dm/appengine/deps/auth.go
+++ b/dm/appengine/deps/auth.go
@@ -5,40 +5,27 @@
package deps
import (
- "fmt"
- "strings"
-
- "google.golang.org/grpc/codes"
-
- "github.com/golang/protobuf/proto"
- "github.com/luci/gae/service/info"
- "github.com/luci/luci-go/common/config"
"github.com/luci/luci-go/common/errors"
"github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/dm/api/acls"
"github.com/luci/luci-go/grpc/grpcutil"
+ "github.com/luci/luci-go/luci_config/server/cfgclient"
+ "github.com/luci/luci-go/luci_config/server/cfgclient/textproto"
"github.com/luci/luci-go/server/auth"
+
"golang.org/x/net/context"
+ "google.golang.org/grpc/codes"
)
-func getTrimmedAppID(c context.Context) string {
- // custom domains show up as "foo.com:appid"
- toks := strings.Split(info.AppID(c), ":")
- return toks[len(toks)-1]
-}
-
func loadAcls(c context.Context) (ret *acls.Acls, err error) {
- aid := getTrimmedAppID(c)
- cSet := fmt.Sprintf("services/%s", aid)
+ cSet := cfgclient.CurrentServiceConfigSet(c)
file := "acls.cfg"
- aclCfg, err := config.GetConfig(c, cSet, file, false)
- if err != nil {
+
+ ret = &acls.Acls{}
+ if err := cfgclient.Get(c, cfgclient.AsService, cSet, file, textproto.Message(ret), nil); err != nil {
return nil, errors.Annotate(err).Transient().
D("cSet", cSet).D("file", file).InternalReason("loading config").Err()
}
-
- ret = &acls.Acls{}
- err = proto.UnmarshalText(aclCfg.Content, ret)
return
}
« no previous file with comments | « dm/api/template/loader.go ('k') | dm/appengine/distributor/fake/fake.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698