obfuscurity / descartes

Introspective dashboard for Graphite
MIT License
502 stars 65 forks source link

WIP - Update GitHub OAuth support #83

Open obfuscurity opened 11 years ago

obfuscurity commented 11 years ago

Need to update our GitHub OAuth code to support the newest stuff in https://github.com/atmos/sinatra_auth_github. I've bumped the gem to 0.13.3 but I think there's some configuration stuff and possibly scopes changes that we need to consider.

I know that @atmos has pointed me in the right direction wrt Teams authentication but I'm an idiot when it comes to OAuth. I'm not sure whether we need to support Teams for everyone, just for internal GH use, or what. @brntbeer - you're the project guru when it comes to this, do you mind taking a look at this?

P.S. Here is some logging output from this branch. Note the deprecation warnings.

21:54:24 web.1  | 127.0.0.1 - - [11/Mar/2013 21:54:24] "GET /auth/unauthorized HTTP/1.1" 302 - 0.0014
21:54:24 web.1  | [warden-github] Deprecated configuration github_client_id used. Please refer to the README for updated configuration instructions.
21:54:24 web.1  | [warden-github] Deprecated configuration github_secret used. Please refer to the README for updated configuration instructions.
21:54:24 web.1  | [warden-github] Deprecated configuration github_callback_url used. Please refer to the README for updated configuration instructions.
21:54:24 web.1  | [warden-github] Deprecated configuration github_scopes used. Please refer to the README for updated configuration instructions.
21:54:24 web.1  | 127.0.0.1 - - [11/Mar/2013 21:54:24] "GET /auth/github HTTP/1.1" 302 216 0.0059
atmos commented 11 years ago

You don't need team support but it's pretty easy to enable it. Check for a team id in the environment and fall back to an organization otherwise. The deprecation warnings are related to key changes in the github_options has you set in the sinatra app.

Oscil8 commented 11 years ago

It looks like this is a bug in the sinatra_auth_github gem? https://github.com/atmos/sinatra_auth_github/blob/master/lib/sinatra/auth/github.rb#L156