Skip to content
This repository was archived by the owner on Apr 2, 2020. It is now read-only.

Update to GitHub API v3 #8

Merged
merged 9 commits into from
Jan 2, 2015
Merged

Update to GitHub API v3 #8

merged 9 commits into from
Jan 2, 2015

Conversation

garethrees
Copy link
Collaborator

Fixes #6

Highlights:

  • Uses octokit to provide v3 compatibility
  • Improves repository listing (can now get private org repos if authenticated)

dush and others added 9 commits January 1, 2015 21:47
If a token is passed as an option, create a client authenticated by the
token, otherwise just create an unauthenticated client.

An unauthenticated client can only access public repositories for the
given username.

Also renames incorrect :oauth_token option to :access_token
Initial move to Octokit in 1d42d21 didn’t paginate through results so a
limited set of repositories was being returned.
Provides a wider range of backup capabilities, rather than only the
specified user’s public repositories.

1. Client is unauthenticated

   Backs up the specified user’s public repositories.

2. Client is authenticated and the login matches the username option

   The user specified by the username option is the authenticated user
   so both public and private repositories are backed up.

3. Client is authenticated but does not match the username option

   Backs up the specified user’s public repositories. Private
   repositories are accessed by using the same username as the login
   of an authenticated client (see above).

4. Client is unauthenticated and the username is an organisation

   Backs up the specified organisations’s public repositories.

5. Client is authenticated and the username is an organisation

   Backs up the specified organisations’s public repositories and the
   private repositories that the authenticated user has access to.
While octokit supports HTTP Basic auth (username/password),
github-backup never supported this. For now just remove support so that
only OAuth tokens are acceptable.
Copies and slightly improves #read_gitconfig from octopi. Only tries
to read the config if a token is not supplied on the command line.

[1] https://github.com/fcoury/octopi/blob/master/lib/octopi.rb
ddollar added a commit that referenced this pull request Jan 2, 2015
@ddollar ddollar merged commit 556efea into ddollar:master Jan 2, 2015
@ddollar
Copy link
Owner

ddollar commented Jan 2, 2015

Thank you!

@garethrees garethrees deleted the api_v3 branch January 4, 2015 23:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GitHub API Change
3 participants