heroku-api 0.3.21 → 0.3.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/changelog.txt +4 -1
- data/lib/heroku/api.rb +7 -0
- data/lib/heroku/api/version.rb +1 -1
- data/test/test_second_factor.rb +13 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 434482948bc8d5f809db1048dcbef21771504659
|
4
|
+
data.tar.gz: e15ea53a53442eb11ffe0e63f1c049eed185c716
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 680285bd3768719b2881e531bbd3a7a640be161d1df08ebf3ddb75e002634642e70ac35a107af1dbdec76b054b57119f4f0274cff4c251efd7b7c26c114726b7
|
7
|
+
data.tar.gz: d8a95ce1310a015615023bfeef901b12130c0aa46e0d4be85dcb6b63655612599d1a2589cbe677cf3a6202265937841053e855b6a92dce29addb4adaebb3530d
|
data/.travis.yml
CHANGED
data/changelog.txt
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
0.3.22 12/17/2014
|
2
|
+
=================
|
3
|
+
add two factor capabilities
|
4
|
+
|
1
5
|
0.3.21 12/03/2014
|
2
6
|
=================
|
3
7
|
fix tests/mocks to match new cached data
|
@@ -6,7 +10,6 @@ fix tests/mocks to match new cached data
|
|
6
10
|
=================
|
7
11
|
update mock data cache
|
8
12
|
|
9
|
-
|
10
13
|
0.3.18 03/20/2014
|
11
14
|
=================
|
12
15
|
|
data/lib/heroku/api.rb
CHANGED
@@ -52,6 +52,8 @@ module Heroku
|
|
52
52
|
:scheme => 'https'
|
53
53
|
}
|
54
54
|
|
55
|
+
attr_accessor :second_factor
|
56
|
+
|
55
57
|
def initialize(options={})
|
56
58
|
options = OPTIONS.merge(options)
|
57
59
|
|
@@ -73,6 +75,11 @@ module Heroku
|
|
73
75
|
|
74
76
|
def request(params, &block)
|
75
77
|
begin
|
78
|
+
if @second_factor
|
79
|
+
params[:headers] ||= {}
|
80
|
+
params[:headers]['Heroku-Two-Factor-Code'] = @second_factor
|
81
|
+
@second_factor = nil # don't use the token again
|
82
|
+
end
|
76
83
|
response = @connection.request(params, &block)
|
77
84
|
rescue Excon::Errors::HTTPStatusError => error
|
78
85
|
klass = case error.response.status
|
data/lib/heroku/api/version.rb
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
require File.expand_path("#{File.dirname(__FILE__)}/test_helper")
|
2
|
+
|
3
|
+
class TestSecondFactor < Minitest::Test
|
4
|
+
|
5
|
+
def test_second_factor_cleared
|
6
|
+
# this test just checks to see if the token is cleared
|
7
|
+
_heroku_ = heroku
|
8
|
+
_heroku_.second_factor = 'ccccccdhtnjniifelbvgblltgeigleglenfbvnkgvtlb'
|
9
|
+
_heroku_.get_user
|
10
|
+
|
11
|
+
assert_nil(_heroku_.second_factor)
|
12
|
+
end
|
13
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heroku-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- geemus (Wesley Beary)
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-12-
|
12
|
+
date: 2014-12-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: excon
|
@@ -135,6 +135,7 @@ files:
|
|
135
135
|
- test/test_logs.rb
|
136
136
|
- test/test_processes.rb
|
137
137
|
- test/test_releases.rb
|
138
|
+
- test/test_second_factor.rb
|
138
139
|
- test/test_ssl_endpoints.rb
|
139
140
|
- test/test_stacks.rb
|
140
141
|
- test/test_user.rb
|
@@ -179,6 +180,7 @@ test_files:
|
|
179
180
|
- test/test_logs.rb
|
180
181
|
- test/test_processes.rb
|
181
182
|
- test/test_releases.rb
|
183
|
+
- test/test_second_factor.rb
|
182
184
|
- test/test_ssl_endpoints.rb
|
183
185
|
- test/test_stacks.rb
|
184
186
|
- test/test_user.rb
|