From 208cb166e3497fca2b7531249c64c7bc6e887ec5 Mon Sep 17 00:00:00 2001 From: Patrick Uiterwijk Date: Aug 07 2017 20:36:40 +0000 Subject: Simplifiy ACLs This will deny people from creating new branches on the main repos, and to push to them. The advantage of this is that the ACLs become a lot simpler: - Fast-forward push to f* and epel* branches - Wild west on all forks Signed-off-by: Patrick Uiterwijk --- diff --git a/dist_git_auth.py b/dist_git_auth.py index 428a955..31d2b67 100644 --- a/dist_git_auth.py +++ b/dist_git_auth.py @@ -35,12 +35,6 @@ cache = dogpile.cache.make_region().configure( ) -_blacklist = ''' - f[0-9][0-9] = @all - - epel[0-9] = @all - - epel[0-9][0-9] = @all - - el[0-9] = @all - - olpc[0-9] = @all''' - namespace2pdctype = { 'rpms': 'rpm', 'modules': 'module', @@ -99,7 +93,7 @@ class DistGitoliteAuth(Gitolite3Auth): if repos not in ['tickets/', 'requests/']: config.append(' R = @all') - access = 'RWC' + access = 'RW' if project.is_fork: access = 'RW+' @@ -111,9 +105,6 @@ class DistGitoliteAuth(Gitolite3Auth): if user != project.user: config.append(' %s %s = %s' % (access, branch, user.user)) - # Then, blacklist a pattern over that (after). - config.append(_blacklist) - if project.committer_groups: config.append(' %s+ = @%s' % (access, ' @'.join( [ @@ -122,11 +113,6 @@ class DistGitoliteAuth(Gitolite3Auth): ] ))) - config.append(' %s = %s' % (access, project.user.user)) - for user in project.committers: - if user != project.user: - config.append(' %s = %s' % (access, user.user)) - for deploykey in project.deploykeys: access = 'R' if deploykey.pushaccess: diff --git a/dist_git_auth_tests.py b/dist_git_auth_tests.py index 25e9dfe..eff6acb 100644 --- a/dist_git_auth_tests.py +++ b/dist_git_auth_tests.py @@ -16,45 +16,27 @@ import dist_git_auth expected = """ repo test R = @all - RWC master = pingou - RWC f9000 = pingou - - f[0-9][0-9] = @all - - epel[0-9] = @all - - epel[0-9][0-9] = @all - - el[0-9] = @all - - olpc[0-9] = @all - RWC = pingou + RW master = pingou + RW f9000 = pingou repo requests/test - RWC = pingou + RW = pingou repo test2 R = @all - RWC master = pingou - RWC f9000 = pingou - - f[0-9][0-9] = @all - - epel[0-9] = @all - - epel[0-9][0-9] = @all - - el[0-9] = @all - - olpc[0-9] = @all - RWC = pingou + RW master = pingou + RW f9000 = pingou repo requests/test2 - RWC = pingou + RW = pingou repo somenamespace/test3 R = @all - RWC master = pingou - RWC f9000 = pingou - - f[0-9][0-9] = @all - - epel[0-9] = @all - - epel[0-9][0-9] = @all - - el[0-9] = @all - - olpc[0-9] = @all - RWC = pingou + RW master = pingou + RW f9000 = pingou repo requests/somenamespace/test3 - RWC = pingou + RW = pingou """ @@ -160,49 +142,30 @@ class DistGitoliteAuthTestCase(tests.Modeltests): expected = '''repo test2 R = @all - RWC master = pingou - RWC f9000 = pingou - - f[0-9][0-9] = @all - - epel[0-9] = @all - - epel[0-9][0-9] = @all - - el[0-9] = @all - - olpc[0-9] = @all - RWC = pingou + RW master = pingou + RW f9000 = pingou repo requests/test2 - RWC = pingou + RW = pingou repo somenamespace/test3 R = @all - RWC master = pingou - RWC f9000 = pingou - - f[0-9][0-9] = @all - - epel[0-9] = @all - - epel[0-9][0-9] = @all - - el[0-9] = @all - - olpc[0-9] = @all - RWC = pingou + RW master = pingou + RW f9000 = pingou repo requests/somenamespace/test3 - RWC = pingou + RW = pingou repo test R = @all - RWC master = foo - RWC master = pingou - RWC f9000 = foo - RWC f9000 = pingou - - f[0-9][0-9] = @all - - epel[0-9] = @all - - epel[0-9][0-9] = @all - - el[0-9] = @all - - olpc[0-9] = @all - RWC = foo - RWC = pingou + RW master = foo + RW master = pingou + RW f9000 = foo + RW f9000 = pingou repo requests/test - RWC = foo - RWC = pingou''' + RW = foo + RW = pingou''' self.assertMultiLineEqual(contents.strip(), expected) def test_get_supported_branches(self):