Add better security and setup for incoming Google Code web hooks.
Review Request #6316 — Created Sept. 12, 2014 and submitted
The Google Code close-submitted webhook now requires a hooks_uuid value,
which will be validated against the repository, returning a 404 if it
doesn't match.There's some instructions for configuring the hook now as well, which
will direct the user to the proper page and provide them the URL to
configure.To make this work, I had to fix a bug in our repository configuration
support, which didn't associate a HostingServiceAccount unless that
account required authorization. It attempted to build the account, but
never saved it. This was a simple fix.
Unit tests pass.
Edited a repository previously configured with Google Code. Selected
Google Code again (since it hadn't saved that previously) and saved. It then
associated the Google Code account, and I was able to see the Hooks link in
the repository list.Repeated that for a new repository as well.
Verified that the links in the instructions worked.
- Change Summary:
-
Removed some bad comments from copy/pastes.
- Commit:
-
a3c0e724d0912cb8f104189198facb729d2ae6c954771032f6e11298384724bc9b8c359744842558
-
Tool: Pyflakes Processed Files: reviewboard/scmtools/forms.py reviewboard/hostingsvcs/tests.py reviewboard/hostingsvcs/googlecode.py Ignored Files: reviewboard/templates/hostingsvcs/googlecode/repo_hook_instructions.html reviewboard/static/rb/css/admin.less Tool: PEP8 Style Checker Processed Files: reviewboard/scmtools/forms.py reviewboard/hostingsvcs/tests.py reviewboard/hostingsvcs/googlecode.py Ignored Files: reviewboard/templates/hostingsvcs/googlecode/repo_hook_instructions.html reviewboard/static/rb/css/admin.less