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

Unified Diff: milo/appengine/swarming/html_data.go

Issue 2818563002: Milo: ACLs for internal swarm jobs (Closed)
Patch Set: Review Created 3 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: milo/appengine/swarming/html_data.go
diff --git a/milo/appengine/swarming/html_data.go b/milo/appengine/swarming/html_data.go
index 741fdc3898600571468bea61bb4c02fce04c6e5e..9aac1107109f085a42c0a9cfea99ada2e66de595 100644
--- a/milo/appengine/swarming/html_data.go
+++ b/milo/appengine/swarming/html_data.go
@@ -20,13 +20,17 @@ import (
swarming "github.com/luci/luci-go/common/api/swarming/swarming/v1"
"github.com/luci/luci-go/common/clock/testclock"
+ memcfg "github.com/luci/luci-go/common/config/impl/memory"
"github.com/luci/luci-go/common/errors"
miloProto "github.com/luci/luci-go/common/proto/milo"
"github.com/luci/luci-go/logdog/api/endpoints/coordinator/logs/v1"
"github.com/luci/luci-go/logdog/api/logpb"
"github.com/luci/luci-go/logdog/client/coordinator"
+ "github.com/luci/luci-go/luci_config/server/cfgclient/backend/testconfig"
"github.com/luci/luci-go/milo/api/resp"
"github.com/luci/luci-go/milo/appengine/common"
+ "github.com/luci/luci-go/server/auth"
+ "github.com/luci/luci-go/server/auth/authtest"
"github.com/luci/luci-go/server/templates"
)
@@ -245,8 +249,13 @@ func BuildTestData() []common.TestBundle {
},
}
c := context.Background()
+ c = memory.UseWithAppID(c, "dev~luci-milo")
+ c = testconfig.WithCommonClient(c, memcfg.New(aclConfgs))
+ c = auth.WithState(c, &authtest.FakeState{
+ Identity: "user:alicebob@google.com",
+ IdentityGroups: []string{"all", "googlers"},
+ })
c, _ = testclock.UseTime(c, time.Date(2016, time.March, 14, 11, 0, 0, 0, time.UTC))
- c = memory.Use(c)
for _, tc := range getTestCases() {
svc := debugSwarmingService{tc}
@@ -265,3 +274,22 @@ func BuildTestData() []common.TestBundle {
}
return results
}
+
+var secretProjectCfg = `
+name: "secret"
+access: "group:googlers"
+`
+
+var publicProjectCfg = `
+name: "opensource"
+access: "group:all"
+`
+
+var aclConfgs = map[string]memcfg.ConfigSet{
+ "projects/secret": {
+ "project.cfg": secretProjectCfg,
+ },
+ "projects/opensource": {
+ "project.cfg": publicProjectCfg,
+ },
+}
« no previous file with comments | « milo/appengine/swarming/expectations/build-internal.json ('k') | milo/appengine/swarming/testdata/build-internal » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698