Skip to content

Commit 71f0335

Browse files
committed
Change to explain scopes in reference to issue piotrmurach#219
1 parent e8b5756 commit 71f0335

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ To create an access token through the GitHub Authorizations API, you are require
412412

413413
```ruby
414414
github = Github.new basic_auth: 'login:password'
415-
github.oauth.create scopes: ['repo'], note: 'admin script'
415+
github.auth.create scopes: ['repo'], note: 'admin script'
416416
```
417417

418418
You can add more than one scope from the `user`, `public_repo`, `repo`, `gist` or leave the scopes parameter out, in which case, the default read-only access will be assumed (includes public user profile info, public repo info, and gists).
@@ -423,20 +423,20 @@ Furthermore, to create auth token for an application you need to pass `:app` arg
423423

424424
```ruby
425425
github = Github.new basic_auth: 'login:password'
426-
github.oauth.app.create 'client-id', scopes: ['repo']
426+
github.auth.app.create 'client-id', scopes: ['repo']
427427
```
428428

429429
In order to revoke auth token(s) for an application you must use basic authentication with `client_id` as login and `client_secret` as password.
430430

431431
```ruby
432432
github = Github.new basic_auth: "client_id:client_secret"
433-
github.oauth.app.delete 'client-id'
433+
github.auth.app.delete 'client-id'
434434
```
435435

436436
Revoke a specific app token.
437437

438438
```ruby
439-
github.oauth.app.delete 'client-id', 'access-token'
439+
github.auth.app.delete 'client-id', 'access-token'
440440
```
441441

442442
### 3.3 Scopes
@@ -448,6 +448,13 @@ github = Github.new oauth_token: 'token'
448448
github.scopes.list # => ['repo']
449449
```
450450

451+
or inidividually for a given user:
452+
453+
```ruby
454+
github = Github.new
455+
github.scopes.list 'token'
456+
```
457+
451458
To list the scopes that the particular GitHub API action checks for do:
452459

453460
```ruby

0 commit comments

Comments
 (0)