|
|
Chromium Code Reviews|
Created:
4 years, 4 months ago by Ryan Tseng Modified:
4 years, 4 months ago CC:
chromium-reviews, infra-reviews+luci-go_chromium.org, andrew.wang, todd, tandrii+luci-go_chromium.org, M-A Ruel Base URL:
https://chromium.googlesource.com/external/github.com/luci/luci-go@lucicfg Target Ref:
refs/heads/master Project:
luci-go Visibility:
Public. |
DescriptionMilo: ACL support
This just includes a IsAllowed() helper function, that gets called by each
module (buildbot, buildbucket, etc)
BUG=637375
Committed: https://github.com/luci/luci-go/commit/c6255395674c45b38e0cebd6c391169125745a89
Patch Set 1 #Patch Set 2 : Remove debugging #
Total comments: 6
Patch Set 3 : Removed write, other review #Patch Set 4 : Simplified #
Total comments: 2
Patch Set 5 : Use authtest #Patch Set 6 : rebase #
Messages
Total messages: 35 (24 generated)
The CQ bit was checked by hinoka@google.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Remove debugging
The CQ bit was checked by hinoka@google.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
hinoka@google.com changed reviewers: + nodir@chromium.org, vadimsh@chromium.org
ptal, this will be used later to add acls to build views, console views, etc
Description was changed from ========== Milo: Acl support This just includes a IsAllowed() helper function, that gets called by each module (buildbot, buildbucket, etc) BUG=637375 ========== to ========== Milo: ACL support This just includes a IsAllowed() helper function, that gets called by each module (buildbot, buildbucket, etc) BUG=637375 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2241853002/diff/20001/milo/appengine/settings... File milo/appengine/settings/acl.go (right): https://codereview.chromium.org/2241853002/diff/20001/milo/appengine/settings... milo/appengine/settings/acl.go:19: func IsAllowed(c context.Context, project string, write bool) bool { is 'write' used anywhere currently (or going to be used very soon)? If not, let's keep it out for now. I have a feeling it may end up as a dead code. https://codereview.chromium.org/2241853002/diff/20001/milo/appengine/settings... milo/appengine/settings/acl.go:24: return false the function should return (bool, error) tuple and return (false, error) in this case. "No access" is not the same as "failed to check access". When access check fails, the user should see HTTP 500 (not HTTP 403 as in the case of "no access"). https://codereview.chromium.org/2241853002/diff/20001/milo/appengine/settings... milo/appengine/settings/acl.go:46: if _, ok := users["public"]; ok { no need for this: 1) We have group "all", that includes anonymous users. Here's logdog using it: https://chromium.googlesource.com/infra/infra/+/infra/config/luci-logdog.cfg#9 2) The check, as it is now, will prevent logged in users to view public entries. (Because they won't pass check on line 45).
The CQ bit was checked by hinoka@google.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Simplified
The CQ bit was checked by hinoka@google.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Removed write ACLs, using chrome-infra-auth for public read acls, it's a lot shorter now https://codereview.chromium.org/2241853002/diff/20001/milo/appengine/settings... File milo/appengine/settings/acl.go (right): https://codereview.chromium.org/2241853002/diff/20001/milo/appengine/settings... milo/appengine/settings/acl.go:19: func IsAllowed(c context.Context, project string, write bool) bool { On 2016/08/15 22:04:52, Vadim Sh. wrote: > is 'write' used anywhere currently (or going to be used very soon)? If not, > let's keep it out for now. I have a feeling it may end up as a dead code. Removing for now. It's not currently used anywhere. Will add back in if it's required somehow. https://codereview.chromium.org/2241853002/diff/20001/milo/appengine/settings... milo/appengine/settings/acl.go:24: return false On 2016/08/15 22:04:52, Vadim Sh. wrote: > the function should return (bool, error) tuple and return (false, error) in this > case. > > "No access" is not the same as "failed to check access". When access check > fails, the user should see HTTP 500 (not HTTP 403 as in the case of "no > access"). Done. https://codereview.chromium.org/2241853002/diff/20001/milo/appengine/settings... milo/appengine/settings/acl.go:46: if _, ok := users["public"]; ok { On 2016/08/15 22:04:52, Vadim Sh. wrote: > no need for this: > 1) We have group "all", that includes anonymous users. Here's logdog using it: > https://chromium.googlesource.com/infra/infra/+/infra/config/luci-logdog.cfg#9 > 2) The check, as it is now, will prevent logged in users to view public entries. > (Because they won't pass check on line 45). Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2241853002/diff/60001/milo/appengine/settings... File milo/appengine/settings/acl_test.go (right): https://codereview.chromium.org/2241853002/diff/60001/milo/appengine/settings... milo/appengine/settings/acl_test.go:77: type testingAuthDB struct{} you can probably avoid most of this mocks if you use stuff from https://godoc.org/github.com/luci/luci-go/server/auth/authtest in particular, https://godoc.org/github.com/luci/luci-go/server/auth/authtest#FakeDB and https://godoc.org/github.com/luci/luci-go/server/auth/authtest#FakeState
The CQ bit was checked by hinoka@google.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2241853002/diff/60001/milo/appengine/settings... File milo/appengine/settings/acl_test.go (right): https://codereview.chromium.org/2241853002/diff/60001/milo/appengine/settings... milo/appengine/settings/acl_test.go:77: type testingAuthDB struct{} On 2016/08/16 00:21:22, Vadim Sh. wrote: > you can probably avoid most of this mocks if you use stuff from > https://godoc.org/github.com/luci/luci-go/server/auth/authtest > > in particular, > https://godoc.org/github.com/luci/luci-go/server/auth/authtest#FakeDB and > https://godoc.org/github.com/luci/luci-go/server/auth/authtest#FakeState Done.
lgtm
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
rebase
The CQ bit was checked by hinoka@google.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by hinoka@google.com
The CQ bit was checked by hinoka@google.com
The patchset sent to the CQ was uploaded after l-g-t-m from vadimsh@chromium.org Link to the patchset: https://codereview.chromium.org/2241853002/#ps90001 (title: "rebase")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== Milo: ACL support This just includes a IsAllowed() helper function, that gets called by each module (buildbot, buildbucket, etc) BUG=637375 ========== to ========== Milo: ACL support This just includes a IsAllowed() helper function, that gets called by each module (buildbot, buildbucket, etc) BUG=637375 Committed: https://github.com/luci/luci-go/commit/c6255395674c45b38e0cebd6c391169125745a89 ==========
Message was sent while issue was closed.
Committed patchset #6 (id:90001) as https://github.com/luci/luci-go/commit/c6255395674c45b38e0cebd6c391169125745a89 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
