Skip to content

Commit

Permalink
Merge pull request #76 from plone/github-token
Browse files Browse the repository at this point in the history
feat: use github token authentication
  • Loading branch information
gforcada committed Jan 25, 2020
2 parents 575e14f + 60ab0aa commit 55911a1
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 30 deletions.
3 changes: 1 addition & 2 deletions development.ini.sample
Expand Up @@ -17,8 +17,7 @@ checkouts_file = checkouts.pickle

roboto_url = http://localhost:6543

github_user = X
github_password = X
github_token = X

collective_repos = collective.elephantvocabulary,icalendar,Products.DateRecurringIndex

Expand Down
4 changes: 1 addition & 3 deletions src/mr.roboto/src/mr/roboto/__init__.py
Expand Up @@ -57,9 +57,7 @@ def main(global_config, **settings):
config.registry.settings['checkouts_file'] = settings['checkouts_file']

# github object
config.registry.settings['github'] = Github(
settings['github_user'], settings['github_password']
)
config.registry.settings['github'] = Github(settings['github_token'])

config.add_static_view('static', 'static', cache_max_age=3600)

Expand Down
3 changes: 1 addition & 2 deletions src/mr.roboto/src/mr/roboto/tests/test_buildout.py
Expand Up @@ -57,8 +57,7 @@ def setUp(self):
'api_key': 'xyz1234mnop',
'sources_file': sources_pickle,
'checkouts_file': checkouts_pickle,
'github_user': 'x',
'github_password': 'x',
'github_token': 'x',
}
app = main({}, **self.settings)
self.roboto = TestApp(app)
Expand Down
7 changes: 2 additions & 5 deletions src/mr.roboto/src/mr/roboto/tests/test_comments.py
Expand Up @@ -96,9 +96,7 @@ def minimal_main(global_config, **settings):
'mister-roboto',
)
config.registry.settings['jenkins_user_token'] = settings['jenkins_user_token']
config.registry.settings['github'] = Github(
settings['github_user'], settings['github_password']
)
config.registry.settings['github'] = Github(settings['github_token'])
config.scan('mr.roboto.views.comments')
config.end()
return config.make_wsgi_app()
Expand Down Expand Up @@ -168,8 +166,7 @@ def setUp(self):
'api_key': 'xyz1234mnop',
'sources_file': 'sources_pickle',
'checkouts_file': 'checkouts_pickle',
'github_user': 'x',
'github_password': 'x',
'github_token': 'x',
'jenkins_user_id': 'jenkins-plone-org',
'jenkins_user_token': 'some-random-token',
}
Expand Down
6 changes: 2 additions & 4 deletions src/mr.roboto/src/mr/roboto/tests/test_config.py
Expand Up @@ -15,8 +15,7 @@ def setUp(self):
'api_key': '1234567890',
'sources_file': 'sources.pickle',
'checkouts_file': 'checkouts.pickle',
'github_user': 'gh_user',
'github_password': 'secret',
'github_token': 'secret',
'debug': 'True',
}
app = main({}, **settings)
Expand Down Expand Up @@ -58,8 +57,7 @@ def test_no_debug(self):
'api_key': 'x',
'sources_file': 'x',
'checkouts_file': 'x',
'github_user': 'x',
'github_password': 'x',
'github_token': 'x',
}
app = main({}, **settings)
roboto = TestApp(app)
Expand Down
7 changes: 2 additions & 5 deletions src/mr.roboto/src/mr/roboto/tests/test_pull_requests.py
Expand Up @@ -47,9 +47,7 @@ def minimal_main(global_config, **settings):
config.registry.settings['plone_versions'] = settings['plone_versions']
config.registry.settings['roboto_url'] = settings['roboto_url']
config.registry.settings['api_key'] = settings['api_key']
config.registry.settings['github'] = Github(
settings['github_user'], settings['github_password']
)
config.registry.settings['github'] = Github(settings['github_token'])
config.scan('mr.roboto.views.pull_requests')
config.end()
return config.make_wsgi_app()
Expand All @@ -63,8 +61,7 @@ def setUp(self):
'api_key': 'xyz1234mnop',
'sources_file': 'sources_pickle',
'checkouts_file': 'checkouts_pickle',
'github_user': 'x',
'github_password': 'x',
'github_token': 'x',
}
app = minimal_main({}, **self.settings)
self.roboto = TestApp(app)
Expand Down
7 changes: 2 additions & 5 deletions src/mr.roboto/src/mr/roboto/tests/test_runcorejob.py
Expand Up @@ -107,9 +107,7 @@ def minimal_main(global_config, **settings):
config.registry.settings['plone_versions'] = settings['plone_versions']
config.registry.settings['roboto_url'] = settings['roboto_url']
config.registry.settings['api_key'] = settings['api_key']
config.registry.settings['github'] = Github(
settings['github_user'], settings['github_password']
)
config.registry.settings['github'] = Github(settings['github_token'])
config.scan('mr.roboto.views.runcorejob')
return config.make_wsgi_app()

Expand All @@ -122,8 +120,7 @@ def setUp(self):
'api_key': 'xyz1234mnop',
'sources_file': 'sources_pickle',
'checkouts_file': 'checkouts_pickle',
'github_user': 'x',
'github_password': 'x',
'github_token': 'x',
}
app = minimal_main({}, **self.settings)
self.roboto = TestApp(app)
Expand Down
3 changes: 1 addition & 2 deletions src/mr.roboto/src/mr/roboto/tests/test_runhooks.py
Expand Up @@ -44,8 +44,7 @@ def setUp(self):
'api_key': 'xyz1234mnop',
'sources_file': 'sources_pickle',
'checkouts_file': 'checkouts_pickle',
'github_user': 'x',
'github_password': 'x',
'github_token': 'x',
'collective_repos': '',
'jenkins_url': 'https://jenkins.plone.org',
}
Expand Down
3 changes: 1 addition & 2 deletions src/mr.roboto/src/mr/roboto/tests/test_simple_views.py
Expand Up @@ -19,8 +19,7 @@ def setUp(self):
'api_key': 'z',
'sources_file': 'sources.pickle',
'checkouts_file': 'checkouts.pickle',
'github_user': 'x',
'github_password': 'x',
'github_token': 'x',
}
app = main({}, **self.settings)
self.roboto = TestApp(app)
Expand Down

0 comments on commit 55911a1

Please sign in to comment.