Skip to content

Commit

Permalink
[ews] Implement Login with GitHub on EWS
Browse files Browse the repository at this point in the history
  • Loading branch information
aj062 committed Feb 20, 2023
1 parent ce09d02 commit a2a8bd0
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Tools/CISupport/ews-build/master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,20 @@ if not is_test_mode_enabled:
},
)

credentials = load_password('EWS_CREDENTIALS')
if not credentials:
print('EWS credentials not found. Please ensure EWS_CREDENTIALS is configured either in env variables or in passwords.json')
GITHUB_CLIENT_ID = load_password('GITHUB_CLIENT_ID')
GITHUB_CLIENT_SECRET = load_password('GITHUB_CLIENT_SECRET')
if (not GITHUB_CLIENT_ID) or (not GITHUB_CLIENT_SECRET):
print('EWS credentials not found. Please ensure GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET are configured either in env variables or in passwords.json')
sys.exit(1)

# See https://docs.buildbot.net/current/manual/configuration/www.html#example-configs
authz = util.Authz(
allowRules=[util.AnyControlEndpointMatcher(role="admin")],
roleMatchers=[util.RolesFromEmails(admin=list(credentials.keys()))]
allowRules=[util.AnyEndpointMatcher(role='Buildbot-Administrators', defaultDeny=False),
util.RebuildBuildEndpointMatcher(role='Contributors'),
util.AnyControlEndpointMatcher(role='Buildbot-Administrators')],
roleMatchers=[util.RolesFromGroups(groupPrefix='WebKit/')]
)
auth = util.UserPasswordAuth(credentials)
auth = util.GitHubAuth(GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, apiVersion=4, getTeamsMembership=True, debug=True)
c['www']['auth'] = auth
c['www']['authz'] = authz

Expand Down

0 comments on commit a2a8bd0

Please sign in to comment.