| OLD | NEW |
| 1 // Copyright 2016 The LUCI Authors. | 1 // Copyright 2016 The LUCI Authors. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 func TestACL(t *testing.T) { | 32 func TestACL(t *testing.T) { |
| 33 t.Parallel() | 33 t.Parallel() |
| 34 | 34 |
| 35 Convey("Test Environment", t, func() { | 35 Convey("Test Environment", t, func() { |
| 36 c := memory.UseWithAppID(context.Background(), "dev~luci-milo") | 36 c := memory.UseWithAppID(context.Background(), "dev~luci-milo") |
| 37 c = gologger.StdConfig.Use(c) | 37 c = gologger.StdConfig.Use(c) |
| 38 | 38 |
| 39 Convey("Set up projects", func() { | 39 Convey("Set up projects", func() { |
| 40 c = testconfig.WithCommonClient(c, memcfg.New(aclConfgs)
) | 40 c = testconfig.WithCommonClient(c, memcfg.New(aclConfgs)
) |
| 41 » » » err := UpdateProjectConfigs(c) | 41 » » » err := UpdateConsoles(c) |
| 42 So(err, ShouldBeNil) | 42 So(err, ShouldBeNil) |
| 43 | 43 |
| 44 Convey("Anon wants to...", func() { | 44 Convey("Anon wants to...", func() { |
| 45 c = auth.WithState(c, &authtest.FakeState{ | 45 c = auth.WithState(c, &authtest.FakeState{ |
| 46 Identity: identity.AnonymousIdenti
ty, | 46 Identity: identity.AnonymousIdenti
ty, |
| 47 IdentityGroups: []string{"all"}, | 47 IdentityGroups: []string{"all"}, |
| 48 }) | 48 }) |
| 49 Convey("Read public project", func() { | 49 Convey("Read public project", func() { |
| 50 ok, err := IsAllowed(c, "opensource") | 50 ok, err := IsAllowed(c, "opensource") |
| 51 So(ok, ShouldEqual, true) | 51 So(ok, ShouldEqual, true) |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 ` | 101 ` |
| 102 | 102 |
| 103 var aclConfgs = map[string]memcfg.ConfigSet{ | 103 var aclConfgs = map[string]memcfg.ConfigSet{ |
| 104 "projects/secret": { | 104 "projects/secret": { |
| 105 "project.cfg": secretProjectCfg, | 105 "project.cfg": secretProjectCfg, |
| 106 }, | 106 }, |
| 107 "projects/opensource": { | 107 "projects/opensource": { |
| 108 "project.cfg": publicProjectCfg, | 108 "project.cfg": publicProjectCfg, |
| 109 }, | 109 }, |
| 110 } | 110 } |
| OLD | NEW |