Formatting and linting fixes

This commit is contained in:
Bart van der Braak 2024-11-19 21:59:53 +01:00
parent 0a1454d250
commit d6bce1b39d
32 changed files with 675 additions and 268 deletions

View file

@ -32,12 +32,18 @@ def fetch_authorization(devops_env_id: str):
deploy_dev_usernames = auth_config.deploy_dev_usernames
trusted_dev_usernames = auth_config.trusted_dev_usernames
dev_usernames = list(set(deploy_dev_usernames + trusted_dev_usernames + admin_usernames))
dev_usernames = list(
set(deploy_dev_usernames + trusted_dev_usernames + admin_usernames)
)
deploy_usernames = list(set(deploy_dev_usernames + admin_usernames))
file_based_group_username_role_matchers = [
buildbot.plugins.util.RolesFromUsername(roles=["admin"], usernames=admin_usernames),
buildbot.plugins.util.RolesFromUsername(roles=["deploy"], usernames=deploy_usernames),
buildbot.plugins.util.RolesFromUsername(
roles=["admin"], usernames=admin_usernames
),
buildbot.plugins.util.RolesFromUsername(
roles=["deploy"], usernames=deploy_usernames
),
buildbot.plugins.util.RolesFromUsername(roles=["dev"], usernames=dev_usernames),
]
@ -52,9 +58,15 @@ def fetch_authorization(devops_env_id: str):
# buildbot.plugins.util.AnyEndpointMatcher(role='dev', defaultDeny=False),
# buildbot.plugins.util.AnyEndpointMatcher(role='coordinator', defaultDeny=False),
# buildbot.plugins.util.AnyEndpointMatcher(role='anonymous', defaultDeny=False),
buildbot.plugins.util.StopBuildEndpointMatcher(role="dev", defaultDeny=True),
buildbot.plugins.util.RebuildBuildEndpointMatcher(role="dev", defaultDeny=True),
buildbot.plugins.util.EnableSchedulerEndpointMatcher(role="admin", defaultDeny=True),
buildbot.plugins.util.StopBuildEndpointMatcher(
role="dev", defaultDeny=True
),
buildbot.plugins.util.RebuildBuildEndpointMatcher(
role="dev", defaultDeny=True
),
buildbot.plugins.util.EnableSchedulerEndpointMatcher(
role="admin", defaultDeny=True
),
# buildbot.plugins.util.AnyEndpointMatcher(role='any', defaultDeny=False),
# Force roles
buildbot.plugins.util.ForceBuildEndpointMatcher(
@ -95,10 +107,14 @@ def fetch_authorization(devops_env_id: str):
builder="*-doc-*", role="dev", defaultDeny=True
),
# This also affects starting jobs via force scheduler
buildbot.plugins.util.AnyControlEndpointMatcher(role="admin", defaultDeny=True),
buildbot.plugins.util.AnyControlEndpointMatcher(
role="admin", defaultDeny=True
),
# A default deny for any endpoint if not admin
# If this is missing at the end, any UNMATCHED group will get 'allow'...
buildbot.plugins.util.AnyControlEndpointMatcher(role="admin", defaultDeny=True),
buildbot.plugins.util.AnyControlEndpointMatcher(
role="admin", defaultDeny=True
),
],
roleMatchers=file_based_group_username_role_matchers,
)