travis-ci/travis-core — pull request #96 by svenfuchs (2012-08-25 22:07:08+00:00)
Title: [WIP] validate github admin on usage

Currently we detect a repository admin like this:

```ruby
class User
def admin
return owner if User === owner and owner.github_oauth_token
@admin ||= permissions.where(:admin => true).first.try(:user)
end
end
```

This will fail if whoever is returned as an admin

* either has revoked their token
* or was removed as an admin from the repository or organization

This change sketches out how we could validate potential admin users before using their token elsewhere.

What's the best way to validate a token against GitHub?