Backported changes to allow github authentication with Bugzilla#84
Backported changes to allow github authentication with Bugzilla#84quanah wants to merge 1 commit intobugzilla:5.2from
Conversation
|
Looking at the commit, the code looks ok. I do have issue with the fact that you're renaming the error message "invalid_login_or_password" to "invalid_username_or_password" but still leaving a call to the former name in Bugzilla/Auth.pm (line 188). When I try to use the feature, I'm sent to github.cgi which displays the following error: DBD::Pg::db do failed: ERREUR: erreur de syntaxe sur ou près de « DUPLICATE » (Sorry for the french but that's the way my system is set up.) |
|
The first bit (Auth.pm line 188) is something I missed when reworking it against 5.2, I'll fix shortly. For the second, are you using Postgres? If so, try: |
2c7b42e to
81b982d
Compare
81b982d to
13ab292
Compare
|
The DB error appears to be from a mysql-ism that crept into BMO: http://www.mysqltutorial.org/mysql-insert-or-update-on-duplicate-key-update/ |
|
In fact, this looks like a divergence between the two implementations. Is there something that can be keyed off of to indicate mysql/mariadb vs postgres? https://en.wikipedia.org/wiki/Merge_(SQL)#Other_non-standard_implementations |
|
In fact, how does this look to you? |
|
FTR, I'm using Bugzilla on CentOS using the shipped version of PostgreSQL. I'm not a huge fan of mysql-isms (other than in Bugzilla::DB::MySQL) so I would prefer having one SQL statement that works everywhere but I'll defer to @dylanwh here. |
|
@dylanwh says on IRC: so my suggestion since there are competing syntaxes is that we add a bz_upsert() method to Bugzilla::DB which returns the proper upsert syntax for MySQL (REPLACE INTO), PostgreSQL (the chat above), etc. |
|
Work in progress in #90 |
|
There is a small change also needed in the near future - changing how we use the oauth token. I've tested this patch and it seems to work: Where is the BMO codebase so it can be merged there? |
|
@mistotebe Well, BMO is an internal bugzilla version for Mozilla. We just want this patched in mainline Bugzilla. ;) |
This change allows for Github authentication to be used for users.
After setting this up, need to create an OAUTH application on github at:
https://github.com/settings/developers
Then go to the BZ admin page, Parameters, "GitHubAuth" and add the secret key and ID.
Then go to the BZ "User Authentication" section, and in "user_verify_class", enable GitHubAuth. In "user_info_class", change it to "GitHubAuth,CGI"
Or modify data/params.json so that: