octoauth 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b80d12c3505ddbe37c6237f2df7d01b56bdb75e7
4
- data.tar.gz: 82234ad8872138f5630f5c7b52ea273d16f6c685
3
+ metadata.gz: 27b2465bdc907163cb0003c07f71ef178e016ed2
4
+ data.tar.gz: c5182621b49bc520706ad71130891c78e5b5f12a
5
5
  SHA512:
6
- metadata.gz: 77de129784d3b6656dc153bec66542c246d96314d8ea9f5028d7fdaf610a9969b83330a2b063bec1ec7887257dc7de79c558f1cda7d73e9a979a5bb39ceab202
7
- data.tar.gz: bfc7c32f131c8049614783f9b73c4e1b1d5c0d9b86e4e65f5347bda3c38a1ec81768d219905d2578c69625482237fb4443b8240a9504f4fcd4167c2166782ef2
6
+ metadata.gz: 7148edd967b7efd2ad3b23f314f11bdd718bfc8ff313818a976b9a187ed457a0468fe17e2d57abab62bf4e29ec495ba740d5714f298c783ee1b69e3db2a2019c
7
+ data.tar.gz: c99fef10764304d056aa90d8433c61e7fca9be46ad98d85df9d4b40eb5d7389e384ed35000689987bc8a16929c62f6ee06087c7380d78ecba1ea39081b99ac4a
data/.gitignore CHANGED
@@ -3,7 +3,7 @@ coverage/
3
3
  .coveralls.yml
4
4
  .bundle
5
5
  Gemfile.lock
6
- spec/examples/tmp.yml
6
+ spec/examples/config_save_test.yml
7
7
  spec/examples/priv_test.yml
8
8
  spec/examples/autosave.yml
9
9
  spec/examples/nil.yml
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.4.0 / 2015-11-17
2
+
3
+ * [ENHANCEMENT] Update octokit to ~> 4.2.0
4
+
1
5
  # 1.3.0 / 2015-08-22
2
6
 
3
7
  * [ENHANCEMENT] Updated octokit to ~> 4.1.0
data/README.md CHANGED
@@ -3,9 +3,9 @@ octoauth
3
3
 
4
4
  [![Gem Version](https://img.shields.io/gem/v/octoauth.svg)](https://rubygems.org/gems/octoauth)
5
5
  [![Dependency Status](https://img.shields.io/gemnasium/akerl/octoauth.svg)](https://gemnasium.com/akerl/octoauth)
6
- [![Code Climate](https://img.shields.io/codeclimate/github/akerl/octoauth.svg)](https://codeclimate.com/github/akerl/octoauth)
7
- [![Coverage Status](https://img.shields.io/coveralls/akerl/octoauth.svg)](https://coveralls.io/r/akerl/octoauth)
8
- [![Build Status](https://img.shields.io/travis/akerl/octoauth.svg)](https://travis-ci.org/akerl/octoauth)
6
+ [![Build Status](https://img.shields.io/circleci/project/akerl/octoauth.svg)](https://circleci.com/gh/akerl/octoauth)
7
+ [![Coverage Status](https://img.shields.io/codecov/c/github/akerl/octoauth.svg)](https://codecov.io/github/akerl/octoauth)
8
+ [![Code Quality](https://img.shields.io/codacy/648fd8ebe3374dd4acc5449b8922f2e0.svg)](https://www.codacy.com/app/akerl/octoauth)
9
9
  [![MIT Licensed](https://img.shields.io/badge/license-MIT-green.svg)](https://tldrlegal.com/license/mit-license)
10
10
 
11
11
  Authentication wrapper for GitHub's API
data/circle.yml ADDED
@@ -0,0 +1,13 @@
1
+ dependencies:
2
+ override:
3
+ - 'rvm-exec 1.9.3-p551 bundle install'
4
+ - 'rvm-exec 2.0.0-p645 bundle install'
5
+ - 'rvm-exec 2.1.6 bundle install'
6
+ - 'rvm-exec 2.2.2 bundle install'
7
+ test:
8
+ override:
9
+ - 'rvm-exec 1.9.3-p551 bundle exec rake'
10
+ - 'rvm-exec 2.0.0-p645 bundle exec rake'
11
+ - 'rvm-exec 2.1.6 bundle exec rake'
12
+ - 'rvm-exec 2.2.2 bundle exec rake'
13
+
data/lib/octoauth/auth.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'octokit'
2
2
  require 'userinput'
3
+ require 'English'
3
4
 
4
5
  ##
5
6
  # Define Auth object and related info for Octoauth
@@ -61,21 +62,20 @@ module Octoauth
61
62
  "#{@options[:note]}--#{@options[:api_endpoint]}"
62
63
  end
63
64
 
64
- def fingerprint
65
- @fingerprint ||= "#{config_note}/#{hostname}"
65
+ def note
66
+ @note ||= "#{@options[:note]}/#{hostname}"
66
67
  end
67
68
 
68
69
  def hostname
69
70
  return @hostname if @hostname
70
71
  res = `hostname`.split.first
71
- @hostname = $?.exitstatus == 0 ? res : 'NULL'
72
+ @hostname = $CHILD_STATUS.exitstatus == 0 ? res : 'NULL'
72
73
  end
73
74
 
74
75
  def prompt!(needs2fa = false)
75
76
  @options[:login] ||= PROMPTS[:login].ask
76
77
  @options[:password] ||= PROMPTS[:password].ask
77
78
  @options[:scopes] ||= DEFAULT_SCOPES
78
- @options[:fingerprint] = fingerprint
79
79
  return unless needs2fa
80
80
  @options[:twofactor] ||= PROMPTS[:twofactor].ask
81
81
  @options[:headers] = { 'X-GitHub-OTP' => @options[:twofactor] }
@@ -84,25 +84,27 @@ module Octoauth
84
84
  def load_token(needs2fa = false)
85
85
  return config.token if config.token
86
86
  prompt!(needs2fa)
87
- authenticate
87
+ authenticate(needs2fa)
88
88
  end
89
89
 
90
- def authenticate
90
+ def authenticate(using2fa)
91
91
  client = Octokit::Client.new(
92
92
  @options.subset(:login, :password, :api_endpoint)
93
93
  )
94
+ delete_existing_token(client)
94
95
  client.create_authorization(
95
- @options.subset(:note, :scopes, :headers, :fingerprint)
96
+ { note: note }.merge(@options.subset(:scopes, :headers, :fingerprint))
96
97
  ).token
97
98
  rescue Octokit::OneTimePasswordRequired
99
+ raise('Invalid 2fa code') if using2fa
98
100
  load_token(true)
99
- rescue Octokit::UnprocessableEntity
100
- check_existing_token client
101
101
  end
102
102
 
103
- def check_existing_token(client)
104
- client.authorizations(@options.subset(:headers))
105
- .find { |x| x[:note] == @options[:note] }.token
103
+ def delete_existing_token(client)
104
+ headers = @options.subset(:headers)
105
+ client.authorizations(headers)
106
+ .select { |x| x[:note] == note }
107
+ .map { |x| client.delete_authorization(x[:id], headers) }
106
108
  end
107
109
  end
108
110
  end
data/octoauth.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'octoauth'
3
- s.version = '1.3.0'
3
+ s.version = '1.4.0'
4
4
  s.date = Time.now.strftime("%Y-%m-%d")
5
5
 
6
6
  s.summary = 'Auth token helper for GitHub API'
@@ -13,14 +13,14 @@ Gem::Specification.new do |s|
13
13
  s.files = `git ls-files`.split
14
14
  s.test_files = `git ls-files spec/*`.split
15
15
 
16
- s.add_dependency 'octokit', '~> 4.1.0'
16
+ s.add_dependency 'octokit', '~> 4.2.0'
17
17
  s.add_dependency 'userinput', '~> 1.0.0'
18
18
 
19
- s.add_development_dependency 'rubocop', '~> 0.33.0'
19
+ s.add_development_dependency 'rubocop', '~> 0.35.0'
20
20
  s.add_development_dependency 'rake', '~> 10.4.0'
21
- s.add_development_dependency 'coveralls', '~> 0.8.0'
22
- s.add_development_dependency 'rspec', '~> 3.3.0'
21
+ s.add_development_dependency 'codecov', '~> 0.1.1'
22
+ s.add_development_dependency 'rspec', '~> 3.4.0'
23
23
  s.add_development_dependency 'fuubar', '~> 2.0.0'
24
- s.add_development_dependency 'webmock', '~> 1.21.0'
25
- s.add_development_dependency 'vcr', '~> 2.9.2'
24
+ s.add_development_dependency 'webmock', '~> 1.22.0'
25
+ s.add_development_dependency 'vcr', '~> 3.0.0'
26
26
  end
@@ -0,0 +1,2 @@
1
+ ---
2
+ existing_token: an_existing_token
@@ -0,0 +1,2 @@
1
+ ---
2
+ write_first_test: write_first_test_token
@@ -0,0 +1,193 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://<USER>:<PASSWORD>@example.org/api/v3/authorizations
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/vnd.github.v3+json
12
+ User-Agent:
13
+ - Octokit Ruby Gem 4.1.1
14
+ Content-Type:
15
+ - application/json
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - GitHub.com
25
+ Date:
26
+ - Mon, 26 Oct 2015 02:45:39 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Status:
32
+ - 200 OK
33
+ X-Ratelimit-Limit:
34
+ - '5000'
35
+ X-Ratelimit-Remaining:
36
+ - '4972'
37
+ X-Ratelimit-Reset:
38
+ - '1445829724'
39
+ Cache-Control:
40
+ - private, max-age=60, s-maxage=60
41
+ Vary:
42
+ - Accept, Authorization, Cookie, X-GitHub-OTP
43
+ - Accept-Encoding
44
+ X-Github-Media-Type:
45
+ - github.v3; format=json
46
+ X-Xss-Protection:
47
+ - 1; mode=block
48
+ X-Frame-Options:
49
+ - deny
50
+ Content-Security-Policy:
51
+ - default-src 'none'
52
+ Access-Control-Allow-Credentials:
53
+ - 'true'
54
+ Access-Control-Expose-Headers:
55
+ - ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset,
56
+ X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
57
+ Access-Control-Allow-Origin:
58
+ - "*"
59
+ Strict-Transport-Security:
60
+ - max-age=31536000; includeSubdomains; preload
61
+ X-Content-Type-Options:
62
+ - nosniff
63
+ body:
64
+ encoding: ASCII-8BIT
65
+ string: '[{"id":23673464,"url":"https://example.org/api/v3/authorizations/23673464","app":{"name":"create_token/bean","url":"https://developer.github.com/v3/oauth_authorizations/","client_id":"00000000000000000000"},"token":"","hashed_token":"5296cd63dbc0add3fb40fd96e5c6bf2346464e15a6400183930c6765d8894899","token_last_eight":"f1c8d660","note":"create_token/bean","note_url":null,"created_at":"2015-10-26T02:23:06Z","updated_at":"2015-10-26T02:23:06Z","scopes":[],"fingerprint":null},{"id":23673465,"url":"https://example.org/api/v3/authorizations/23673465","app":{"name":"two_factor_token/bean","url":"https://developer.github.com/v3/oauth_authorizations/","client_id":"00000000000000000000"},"token":"","hashed_token":"cf1ef3274bbd1cb0f25cf3c0ae62bba97fb19d6d1278da37c87b60bbbbfd58e9","token_last_eight":"6f534ee7","note":"two_factor_token/bean","note_url":null,"created_at":"2015-10-26T02:23:06Z","updated_at":"2015-10-26T02:23:06Z","scopes":[],"fingerprint":null},{"id":23673471,"url":"https://example.org/api/v3/authorizations/23673471","app":{"name":"write_first_test/bean","url":"https://developer.github.com/v3/oauth_authorizations/","client_id":"00000000000000000000"},"token":"","hashed_token":"e1ffd7c1465879b3c776c7be6fe7777f64f2dddb6d09da06f264e563e7c49fa7","token_last_eight":"49a5dcbd","note":"write_first_test/bean","note_url":null,"created_at":"2015-10-26T02:23:24Z","updated_at":"2015-10-26T02:23:24Z","scopes":[],"fingerprint":null},{"id":23673992,"url":"https://example.org/api/v3/authorizations/23673992","app":{"name":"requesting_scopes/bean","url":"https://developer.github.com/v3/oauth_authorizations/","client_id":"00000000000000000000"},"token":"","hashed_token":"e41f77be9fe2994e5505437dce25574472b2d64f512305ccb25af6ec36cc9fc5","token_last_eight":"fc1217c4","note":"requesting_scopes/bean","note_url":null,"created_at":"2015-10-26T02:45:38Z","updated_at":"2015-10-26T02:45:38Z","scopes":["gist","delete_repo"],"fingerprint":null},{"id":23673993,"url":"https://example.org/api/v3/authorizations/23673993","app":{"name":"autosave_test/bean","url":"https://developer.github.com/v3/oauth_authorizations/","client_id":"00000000000000000000"},"token":"","hashed_token":"db9bfd126cdb10eca25a06df972099ef8f1ff85014a982755efc2f0ef07bc975","token_last_eight":"da02795d","note":"autosave_test/bean","note_url":null,"created_at":"2015-10-26T02:45:38Z","updated_at":"2015-10-26T02:45:38Z","scopes":[],"fingerprint":null},{"id":23673996,"url":"https://example.org/api/v3/authorizations/23673996","app":{"name":"existing_token/bean","url":"https://developer.github.com/v3/oauth_authorizations/","client_id":"00000000000000000000"},"token":"","hashed_token":"55a64a37a4d738582ec4d054ce00591588a04ee8ec55a4dda4d53aaf8057a98f","token_last_eight":"c1e9e2ec","note":"existing_token/bean","note_url":null,"created_at":"2015-10-26T02:45:39Z","updated_at":"2015-10-26T02:45:39Z","scopes":[],"fingerprint":null}]'
66
+ http_version:
67
+ recorded_at: Mon, 26 Oct 2015 02:45:39 GMT
68
+ - request:
69
+ method: delete
70
+ uri: https://<USER>:<PASSWORD>@example.org/api/v3/authorizations/23673464
71
+ body:
72
+ encoding: UTF-8
73
+ string: "{}"
74
+ headers:
75
+ Accept:
76
+ - application/vnd.github.v3+json
77
+ User-Agent:
78
+ - Octokit Ruby Gem 4.1.1
79
+ Content-Type:
80
+ - application/json
81
+ Accept-Encoding:
82
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
83
+ response:
84
+ status:
85
+ code: 204
86
+ message: No Content
87
+ headers:
88
+ Server:
89
+ - GitHub.com
90
+ Date:
91
+ - Mon, 26 Oct 2015 02:45:39 GMT
92
+ Status:
93
+ - 204 No Content
94
+ X-Ratelimit-Limit:
95
+ - '5000'
96
+ X-Ratelimit-Remaining:
97
+ - '4971'
98
+ X-Ratelimit-Reset:
99
+ - '1445829724'
100
+ X-Github-Media-Type:
101
+ - github.v3; format=json
102
+ X-Xss-Protection:
103
+ - 1; mode=block
104
+ X-Frame-Options:
105
+ - deny
106
+ Content-Security-Policy:
107
+ - default-src 'none'
108
+ Access-Control-Allow-Credentials:
109
+ - 'true'
110
+ Access-Control-Expose-Headers:
111
+ - ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset,
112
+ X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
113
+ Access-Control-Allow-Origin:
114
+ - "*"
115
+ Strict-Transport-Security:
116
+ - max-age=31536000; includeSubdomains; preload
117
+ X-Content-Type-Options:
118
+ - nosniff
119
+ Vary:
120
+ - Accept-Encoding
121
+ body:
122
+ encoding: UTF-8
123
+ string: ''
124
+ http_version:
125
+ recorded_at: Mon, 26 Oct 2015 02:45:40 GMT
126
+ - request:
127
+ method: post
128
+ uri: https://<USER>:<PASSWORD>@example.org/api/v3/authorizations
129
+ body:
130
+ encoding: UTF-8
131
+ string: '{"note":"create_token/bean","scopes":[]}'
132
+ headers:
133
+ Accept:
134
+ - application/vnd.github.v3+json
135
+ User-Agent:
136
+ - Octokit Ruby Gem 4.1.1
137
+ Content-Type:
138
+ - application/json
139
+ Accept-Encoding:
140
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
141
+ response:
142
+ status:
143
+ code: 201
144
+ message: Created
145
+ headers:
146
+ Server:
147
+ - GitHub.com
148
+ Date:
149
+ - Mon, 26 Oct 2015 02:45:40 GMT
150
+ Content-Type:
151
+ - application/json; charset=utf-8
152
+ Content-Length:
153
+ - '511'
154
+ Status:
155
+ - 201 Created
156
+ X-Ratelimit-Limit:
157
+ - '5000'
158
+ X-Ratelimit-Remaining:
159
+ - '4970'
160
+ X-Ratelimit-Reset:
161
+ - '1445829724'
162
+ Cache-Control:
163
+ - private, max-age=60, s-maxage=60
164
+ Location:
165
+ - https://example.org/api/v3/authorizations/23673997
166
+ Vary:
167
+ - Accept, Authorization, Cookie, X-GitHub-OTP
168
+ - Accept-Encoding
169
+ X-Github-Media-Type:
170
+ - github.v3; format=json
171
+ X-Xss-Protection:
172
+ - 1; mode=block
173
+ X-Frame-Options:
174
+ - deny
175
+ Content-Security-Policy:
176
+ - default-src 'none'
177
+ Access-Control-Allow-Credentials:
178
+ - 'true'
179
+ Access-Control-Expose-Headers:
180
+ - ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset,
181
+ X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
182
+ Access-Control-Allow-Origin:
183
+ - "*"
184
+ Strict-Transport-Security:
185
+ - max-age=31536000; includeSubdomains; preload
186
+ X-Content-Type-Options:
187
+ - nosniff
188
+ body:
189
+ encoding: UTF-8
190
+ string: '{"id":23673997,"url":"https://example.org/api/v3/authorizations/23673997","app":{"name":"create_token/bean","url":"https://developer.github.com/v3/oauth_authorizations/","client_id":"00000000000000000000"},"token":"created_token","hashed_token":"9be225308ddbc5da3152e399ca3937f5bd19c784dc85f9975015eb5e775c7a00","token_last_eight":"dde1fdd1","note":"create_token/bean","note_url":null,"created_at":"2015-10-26T02:45:40Z","updated_at":"2015-10-26T02:45:40Z","scopes":[],"fingerprint":null}'
191
+ http_version:
192
+ recorded_at: Mon, 26 Oct 2015 02:45:40 GMT
193
+ recorded_with: VCR 2.9.3
@@ -1,43 +1,173 @@
1
1
  ---
2
2
  http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://<USER>:<PASSWORD>@api.github.com/authorizations
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/vnd.github.v3+json
12
+ User-Agent:
13
+ - Octokit Ruby Gem 4.1.1
14
+ Content-Type:
15
+ - application/json
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - GitHub.com
25
+ Date:
26
+ - Mon, 26 Oct 2015 02:45:38 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Status:
32
+ - 200 OK
33
+ X-Ratelimit-Limit:
34
+ - '5000'
35
+ X-Ratelimit-Remaining:
36
+ - '4981'
37
+ X-Ratelimit-Reset:
38
+ - '1445829724'
39
+ Cache-Control:
40
+ - private, max-age=60, s-maxage=60
41
+ Vary:
42
+ - Accept, Authorization, Cookie, X-GitHub-OTP
43
+ - Accept-Encoding
44
+ X-Github-Media-Type:
45
+ - github.v3; format=json
46
+ X-Xss-Protection:
47
+ - 1; mode=block
48
+ X-Frame-Options:
49
+ - deny
50
+ Content-Security-Policy:
51
+ - default-src 'none'
52
+ Access-Control-Allow-Credentials:
53
+ - 'true'
54
+ Access-Control-Expose-Headers:
55
+ - ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset,
56
+ X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
57
+ Access-Control-Allow-Origin:
58
+ - "*"
59
+ Strict-Transport-Security:
60
+ - max-age=31536000; includeSubdomains; preload
61
+ X-Content-Type-Options:
62
+ - nosniff
63
+ body:
64
+ encoding: ASCII-8BIT
65
+ string: '[{"id":23673435,"url":"https://api.github.com/authorizations/23673435","app":{"name":"autosave_test/bean","url":"https://developer.github.com/v3/oauth_authorizations/","client_id":"00000000000000000000"},"token":"","hashed_token":"d04e11d46f3358c2ccc9ff61a10af5e4bc9de0c468404f6821e6ca3342c6477f","token_last_eight":"4c625306","note":"autosave_test/bean","note_url":null,"created_at":"2015-10-26T02:22:04Z","updated_at":"2015-10-26T02:22:04Z","scopes":[],"fingerprint":null},{"id":23673463,"url":"https://api.github.com/authorizations/23673463","app":{"name":"existing_token/bean","url":"https://developer.github.com/v3/oauth_authorizations/","client_id":"00000000000000000000"},"token":"","hashed_token":"81058c676b8a2de95487b5ad9ed1090f74efa8a581ba69487f274c4552b4716a","token_last_eight":"f9a2fcda","note":"existing_token/bean","note_url":null,"created_at":"2015-10-26T02:23:05Z","updated_at":"2015-10-26T02:23:05Z","scopes":[],"fingerprint":null},{"id":23673464,"url":"https://api.github.com/authorizations/23673464","app":{"name":"create_token/bean","url":"https://developer.github.com/v3/oauth_authorizations/","client_id":"00000000000000000000"},"token":"","hashed_token":"5296cd63dbc0add3fb40fd96e5c6bf2346464e15a6400183930c6765d8894899","token_last_eight":"f1c8d660","note":"create_token/bean","note_url":null,"created_at":"2015-10-26T02:23:06Z","updated_at":"2015-10-26T02:23:06Z","scopes":[],"fingerprint":null},{"id":23673465,"url":"https://api.github.com/authorizations/23673465","app":{"name":"two_factor_token/bean","url":"https://developer.github.com/v3/oauth_authorizations/","client_id":"00000000000000000000"},"token":"","hashed_token":"cf1ef3274bbd1cb0f25cf3c0ae62bba97fb19d6d1278da37c87b60bbbbfd58e9","token_last_eight":"6f534ee7","note":"two_factor_token/bean","note_url":null,"created_at":"2015-10-26T02:23:06Z","updated_at":"2015-10-26T02:23:06Z","scopes":[],"fingerprint":null},{"id":23673471,"url":"https://api.github.com/authorizations/23673471","app":{"name":"write_first_test/bean","url":"https://developer.github.com/v3/oauth_authorizations/","client_id":"00000000000000000000"},"token":"","hashed_token":"e1ffd7c1465879b3c776c7be6fe7777f64f2dddb6d09da06f264e563e7c49fa7","token_last_eight":"49a5dcbd","note":"write_first_test/bean","note_url":null,"created_at":"2015-10-26T02:23:24Z","updated_at":"2015-10-26T02:23:24Z","scopes":[],"fingerprint":null},{"id":23673992,"url":"https://api.github.com/authorizations/23673992","app":{"name":"requesting_scopes/bean","url":"https://developer.github.com/v3/oauth_authorizations/","client_id":"00000000000000000000"},"token":"","hashed_token":"e41f77be9fe2994e5505437dce25574472b2d64f512305ccb25af6ec36cc9fc5","token_last_eight":"fc1217c4","note":"requesting_scopes/bean","note_url":null,"created_at":"2015-10-26T02:45:38Z","updated_at":"2015-10-26T02:45:38Z","scopes":["gist","delete_repo"],"fingerprint":null}]'
66
+ http_version:
67
+ recorded_at: Mon, 26 Oct 2015 02:45:38 GMT
68
+ - request:
69
+ method: delete
70
+ uri: https://<USER>:<PASSWORD>@api.github.com/authorizations/23673435
71
+ body:
72
+ encoding: UTF-8
73
+ string: "{}"
74
+ headers:
75
+ Accept:
76
+ - application/vnd.github.v3+json
77
+ User-Agent:
78
+ - Octokit Ruby Gem 4.1.1
79
+ Content-Type:
80
+ - application/json
81
+ Accept-Encoding:
82
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
83
+ response:
84
+ status:
85
+ code: 204
86
+ message: No Content
87
+ headers:
88
+ Server:
89
+ - GitHub.com
90
+ Date:
91
+ - Mon, 26 Oct 2015 02:45:38 GMT
92
+ Status:
93
+ - 204 No Content
94
+ X-Ratelimit-Limit:
95
+ - '5000'
96
+ X-Ratelimit-Remaining:
97
+ - '4980'
98
+ X-Ratelimit-Reset:
99
+ - '1445829724'
100
+ X-Github-Media-Type:
101
+ - github.v3; format=json
102
+ X-Xss-Protection:
103
+ - 1; mode=block
104
+ X-Frame-Options:
105
+ - deny
106
+ Content-Security-Policy:
107
+ - default-src 'none'
108
+ Access-Control-Allow-Credentials:
109
+ - 'true'
110
+ Access-Control-Expose-Headers:
111
+ - ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset,
112
+ X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval
113
+ Access-Control-Allow-Origin:
114
+ - "*"
115
+ Strict-Transport-Security:
116
+ - max-age=31536000; includeSubdomains; preload
117
+ X-Content-Type-Options:
118
+ - nosniff
119
+ Vary:
120
+ - Accept-Encoding
121
+ body:
122
+ encoding: UTF-8
123
+ string: ''
124
+ http_version:
125
+ recorded_at: Mon, 26 Oct 2015 02:45:38 GMT
3
126
  - request:
4
127
  method: post
5
- uri: https://user:pw@api.github.com/authorizations
128
+ uri: https://<USER>:<PASSWORD>@api.github.com/authorizations
6
129
  body:
7
130
  encoding: UTF-8
8
- string: '{"note":"autosave_test","scopes":[],"fingerprint":"autosave_test/bean"}'
131
+ string: '{"note":"autosave_test/bean","scopes":[]}'
9
132
  headers:
10
133
  Accept:
11
134
  - application/vnd.github.v3+json
12
135
  User-Agent:
13
- - Octokit Ruby Gem 4.0.1
136
+ - Octokit Ruby Gem 4.1.1
14
137
  Content-Type:
15
138
  - application/json
16
139
  Accept-Encoding:
17
140
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
141
  response:
19
142
  status:
20
- code: 401
21
- message: Unauthorized
143
+ code: 201
144
+ message: Created
22
145
  headers:
23
146
  Server:
24
147
  - GitHub.com
25
148
  Date:
26
- - Sat, 25 Jul 2015 01:56:58 GMT
149
+ - Mon, 26 Oct 2015 02:45:38 GMT
27
150
  Content-Type:
28
151
  - application/json; charset=utf-8
29
152
  Content-Length:
30
- - '83'
153
+ - '513'
31
154
  Status:
32
- - 401 Unauthorized
33
- X-Github-Media-Type:
34
- - github.v3; format=json
155
+ - 201 Created
35
156
  X-Ratelimit-Limit:
36
- - '60'
157
+ - '5000'
37
158
  X-Ratelimit-Remaining:
38
- - '58'
159
+ - '4979'
39
160
  X-Ratelimit-Reset:
40
- - '1437793018'
161
+ - '1445829724'
162
+ Cache-Control:
163
+ - private, max-age=60, s-maxage=60
164
+ Location:
165
+ - https://api.github.com/authorizations/23673993
166
+ Vary:
167
+ - Accept, Authorization, Cookie, X-GitHub-OTP
168
+ - Accept-Encoding
169
+ X-Github-Media-Type:
170
+ - github.v3; format=json
41
171
  X-Xss-Protection:
42
172
  - 1; mode=block
43
173
  X-Frame-Options:
@@ -57,7 +187,7 @@ http_interactions:
57
187
  - nosniff
58
188
  body:
59
189
  encoding: UTF-8
60
- string: '{"message":"Bad credentials","documentation_url":"https://developer.github.com/v3"}'
190
+ string: '{"id":23673993,"url":"https://api.github.com/authorizations/23673993","app":{"name":"autosave_test/bean","url":"https://developer.github.com/v3/oauth_authorizations/","client_id":"00000000000000000000"},"token":"autosaved_token","hashed_token":"db9bfd126cdb10eca25a06df972099ef8f1ff85014a982755efc2f0ef07bc975","token_last_eight":"da02795d","note":"autosave_test/bean","note_url":null,"created_at":"2015-10-26T02:45:38Z","updated_at":"2015-10-26T02:45:38Z","scopes":[],"fingerprint":null}'
61
191
  http_version:
62
- recorded_at: Sat, 25 Jul 2015 01:56:58 GMT
192
+ recorded_at: Mon, 26 Oct 2015 02:45:38 GMT
63
193
  recorded_with: VCR 2.9.3