authenticator-client 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/authenticator-client.gemspec +3 -1
- data/lib/authenticator/client.rb +5 -0
- data/lib/authenticator/client/account.rb +3 -22
- data/lib/authenticator/client/authenticate_response.rb +1 -5
- data/lib/authenticator/client/base.rb +9 -3
- data/lib/authenticator/client/mock.rb +9 -3
- data/lib/authenticator/client/version.rb +1 -1
- data/spec/authenticator/client/base_spec.rb +33 -18
- data/spec/authenticator/client_spec.rb +2 -2
- data/spec/fixtures/vcr_cassettes/all_success.yml +7 -7
- data/spec/fixtures/vcr_cassettes/authenticate_success.yml +8 -8
- data/spec/fixtures/vcr_cassettes/create_success.yml +8 -8
- data/spec/fixtures/vcr_cassettes/destroy_success.yml +15 -15
- data/spec/fixtures/vcr_cassettes/show_success.yml +7 -7
- data/spec/fixtures/vcr_cassettes/update_success.yml +17 -17
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db3e9ad274be92aae1a7319d7f28af6d5b2cfacf
|
4
|
+
data.tar.gz: 895272dc7b3942b20d4f28c346a9ef18f144c9de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4228f81cec75d6680047431dc7dc6e068787d2569f4968711aaa1d01dad55340220fc57efd88765618a6f3d21f5837c38c21b25ba3fa2247a14f3615a92c0e9d
|
7
|
+
data.tar.gz: 62813179cc918dd588dc748f86478435885596be0631b4978d9ed6575aa84b92d451802dd706646652acde3a5e94699b46b434b5bc7fb83323f3acc90a3fdb0f
|
@@ -18,8 +18,10 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
+
|
22
|
+
spec.add_dependency 'attr_init', '~> 0.0.4'
|
21
23
|
spec.add_dependency 'rest-client', '~> 1.7.2'
|
22
|
-
spec.add_dependency 'json_client', '~> 0.
|
24
|
+
spec.add_dependency 'json_client', '~> 0.2.2'
|
23
25
|
|
24
26
|
spec.add_development_dependency "simplecov", "~> 0.8.0"
|
25
27
|
spec.add_development_dependency "coveralls", "~> 0.7.0"
|
data/lib/authenticator/client.rb
CHANGED
@@ -1,27 +1,8 @@
|
|
1
|
+
require 'attr_init'
|
1
2
|
module Authenticator
|
2
3
|
module Client
|
3
4
|
class Account
|
4
|
-
|
5
|
-
def initialize(params, password=nil)
|
6
|
-
if password.nil?
|
7
|
-
new_initialize(params)
|
8
|
-
else
|
9
|
-
old_initialize(params, password)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
def new_initialize(params)
|
14
|
-
@id = params[:id]
|
15
|
-
@username = params[:username]
|
16
|
-
@password = params[:password]
|
17
|
-
@created_at = params[:created_at]
|
18
|
-
@updated_at = params[:updated_at]
|
19
|
-
end
|
20
|
-
|
21
|
-
def old_initialize(username, password)
|
22
|
-
@username = username
|
23
|
-
@password = password
|
24
|
-
end
|
5
|
+
reader_struct :id, :password, :created_at, :updated_at
|
25
6
|
|
26
7
|
def self.from_json(json)
|
27
8
|
params = json.each_with_object({}) do |(key, value), hash|
|
@@ -33,7 +14,7 @@ module Authenticator
|
|
33
14
|
def to_params
|
34
15
|
{
|
35
16
|
account: {
|
36
|
-
|
17
|
+
id: id,
|
37
18
|
password: password
|
38
19
|
}
|
39
20
|
}
|
@@ -3,7 +3,7 @@ require 'json_client'
|
|
3
3
|
module Authenticator
|
4
4
|
module Client
|
5
5
|
class AuthenticateResponse < JsonClient::BaseResponses::Response
|
6
|
-
def initialize(
|
6
|
+
def initialize(response)
|
7
7
|
super
|
8
8
|
end
|
9
9
|
|
@@ -14,10 +14,6 @@ module Authenticator
|
|
14
14
|
def authenticated?
|
15
15
|
json['authenticated'] == true
|
16
16
|
end
|
17
|
-
|
18
|
-
def auth_success?
|
19
|
-
authenticated?
|
20
|
-
end
|
21
17
|
end
|
22
18
|
end
|
23
19
|
end
|
@@ -5,6 +5,12 @@ require_relative 'authenticate_response'
|
|
5
5
|
module Authenticator
|
6
6
|
module Client
|
7
7
|
class Base < JsonClient::Base
|
8
|
+
serializers do |s|
|
9
|
+
s.on :create, :update, :destroy,
|
10
|
+
use: JsonClient::ModelSerializer.new(model_name: 'account')
|
11
|
+
s.on :index, :show, use: JsonClient::EmptySerializer.new
|
12
|
+
end
|
13
|
+
|
8
14
|
def initialize(config, account)
|
9
15
|
super(
|
10
16
|
JsonClient::Pather.new(config[:host], 'api/v1', 'accounts'),
|
@@ -18,15 +24,15 @@ module Authenticator
|
|
18
24
|
|
19
25
|
protected
|
20
26
|
|
21
|
-
def request_authentication(
|
27
|
+
def request_authentication(params)
|
22
28
|
uri = authenticate_path
|
23
29
|
response = RestClient.post(
|
24
30
|
uri,
|
25
|
-
auth_params.merge(account
|
31
|
+
auth_params.merge(account: params).to_json,
|
26
32
|
content_type: :json,
|
27
33
|
accept: :json
|
28
34
|
)
|
29
|
-
AuthenticateResponse.new(response
|
35
|
+
AuthenticateResponse.new(response)
|
30
36
|
end
|
31
37
|
|
32
38
|
def authenticate_path
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'json'
|
2
|
+
require 'attr_init'
|
2
3
|
require_relative 'authenticate_response'
|
3
4
|
|
4
5
|
module Authenticator
|
@@ -16,11 +17,16 @@ module Authenticator
|
|
16
17
|
protected
|
17
18
|
|
18
19
|
def mock_response
|
19
|
-
|
20
|
-
params.merge({ authenticated: true }).to_json,
|
21
|
-
200
|
20
|
+
response_object = MockResponse.new(
|
21
|
+
body: params.merge({ authenticated: true }).to_json,
|
22
|
+
code: 200
|
22
23
|
)
|
24
|
+
AuthenticateResponse.new(response_object)
|
23
25
|
end
|
24
26
|
end
|
27
|
+
|
28
|
+
class MockResponse
|
29
|
+
reader_struct :body, :code
|
30
|
+
end
|
25
31
|
end
|
26
32
|
end
|
@@ -11,26 +11,45 @@ end
|
|
11
11
|
describe Authenticator::Client::Base do
|
12
12
|
let(:config) do
|
13
13
|
{
|
14
|
-
api_key: '
|
15
|
-
api_password: '
|
14
|
+
api_key: 'apptest',
|
15
|
+
api_password: 'password',
|
16
16
|
host: 'http://account-authenticator.herokuapp.com'
|
17
17
|
}
|
18
18
|
end
|
19
19
|
|
20
|
+
let(:account_params) do
|
21
|
+
{ id: 0, password: 'new_password' }
|
22
|
+
end
|
23
|
+
|
24
|
+
let(:new_account_params) do
|
25
|
+
|
26
|
+
{ id: 1, password: 'new_password_1' }
|
27
|
+
end
|
28
|
+
|
29
|
+
let(:destroy_account_params) do
|
30
|
+
|
31
|
+
{ id: 2, password: 'new_password_2' }
|
32
|
+
end
|
33
|
+
|
34
|
+
let(:updated_account_params) do
|
35
|
+
|
36
|
+
{ id: 3, password: 'new_password' }
|
37
|
+
end
|
38
|
+
|
20
39
|
let(:account) do
|
21
|
-
Authenticator::Client::Account.new(
|
40
|
+
Authenticator::Client::Account.new(account_params)
|
22
41
|
end
|
23
42
|
|
24
43
|
let(:new_account) do
|
25
|
-
Authenticator::Client::Account.new(
|
44
|
+
Authenticator::Client::Account.new(new_account_params)
|
26
45
|
end
|
27
46
|
|
28
47
|
let(:destroy_account) do
|
29
|
-
Authenticator::Client::Account.new(
|
48
|
+
Authenticator::Client::Account.new(destroy_account_params)
|
30
49
|
end
|
31
50
|
|
32
51
|
let(:updated_account) do
|
33
|
-
Authenticator::Client::Account.new(
|
52
|
+
Authenticator::Client::Account.new(updated_account_params)
|
34
53
|
end
|
35
54
|
|
36
55
|
subject do
|
@@ -38,7 +57,7 @@ describe Authenticator::Client::Base do
|
|
38
57
|
Authenticator::Client.new(:test)
|
39
58
|
end
|
40
59
|
|
41
|
-
describe '#
|
60
|
+
describe '#index' do
|
42
61
|
it 'fetches all the accounts' do
|
43
62
|
VCR.use_cassette('all_success') do
|
44
63
|
response = subject.index.json
|
@@ -51,17 +70,16 @@ describe Authenticator::Client::Base do
|
|
51
70
|
describe '#authenticate' do
|
52
71
|
it 'creates an account' do
|
53
72
|
VCR.use_cassette('authenticate_success') do
|
54
|
-
response = subject.authenticate(
|
73
|
+
response = subject.authenticate(id: 4, password: 'new_password')
|
55
74
|
|
56
75
|
expect(response.json['authenticated']).to eq true
|
57
|
-
expect(response.
|
76
|
+
expect(response.authenticated?).to eq true
|
58
77
|
|
59
78
|
account = response.account
|
60
79
|
|
61
|
-
expect(account.
|
62
|
-
expect(account.
|
63
|
-
expect(account.
|
64
|
-
expect(account.updated_at).to eq '2015-01-08T05:02:05.699Z'
|
80
|
+
expect(account.id).to be 4
|
81
|
+
expect(account.created_at).not_to be nil
|
82
|
+
expect(account.updated_at).not_to be nil
|
65
83
|
end
|
66
84
|
end
|
67
85
|
end
|
@@ -71,7 +89,6 @@ describe Authenticator::Client::Base do
|
|
71
89
|
VCR.use_cassette('create_success') do
|
72
90
|
response = subject.create(account).json
|
73
91
|
|
74
|
-
expect(response['username']).to eq 'new_username'
|
75
92
|
expect(response['id']).not_to be nil
|
76
93
|
expect(response['created_at']).not_to be nil
|
77
94
|
expect(response['updated_at']).not_to be nil
|
@@ -85,10 +102,9 @@ describe Authenticator::Client::Base do
|
|
85
102
|
response = subject.show(1)
|
86
103
|
json = response.json
|
87
104
|
|
88
|
-
expect(json['username']).to eq 'new_username'
|
89
105
|
expect(json['id']).to be 1
|
90
|
-
expect(
|
91
|
-
expect(
|
106
|
+
expect(response['created_at']).not_to be nil
|
107
|
+
expect(response['updated_at']).not_to be nil
|
92
108
|
end
|
93
109
|
end
|
94
110
|
end
|
@@ -99,7 +115,6 @@ describe Authenticator::Client::Base do
|
|
99
115
|
id = subject.create(new_account).json['id']
|
100
116
|
response = subject.update(id, updated_account).json
|
101
117
|
|
102
|
-
expect(response['username']).to eq updated_account.username
|
103
118
|
expect(response['id']).to eq id
|
104
119
|
end
|
105
120
|
end
|
@@ -33,11 +33,11 @@ describe Authenticator::Client do
|
|
33
33
|
|
34
34
|
describe '::authenticate_with!' do
|
35
35
|
it 'forces the authenticate client to return the param passed in' do
|
36
|
-
described_class.authenticate_with!(
|
36
|
+
described_class.authenticate_with!(id: 4)
|
37
37
|
client = described_class.new(:test)
|
38
38
|
|
39
39
|
expect(client.authenticate(nil).authenticated?).to be true
|
40
|
-
expect(client.authenticate(nil).account.
|
40
|
+
expect(client.authenticate(nil).account.id).to eq 4
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: http://account-authenticator.herokuapp.com/api/v1/accounts?api_key=
|
5
|
+
uri: http://account-authenticator.herokuapp.com/api/v1/accounts?api_key=apptest&api_password=password
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -21,7 +21,7 @@ http_interactions:
|
|
21
21
|
Server:
|
22
22
|
- Cowboy
|
23
23
|
Date:
|
24
|
-
-
|
24
|
+
- Sat, 17 Jan 2015 19:01:18 GMT
|
25
25
|
Connection:
|
26
26
|
- keep-alive
|
27
27
|
X-Frame-Options:
|
@@ -33,20 +33,20 @@ http_interactions:
|
|
33
33
|
Content-Type:
|
34
34
|
- application/json; charset=utf-8
|
35
35
|
Etag:
|
36
|
-
- '"
|
36
|
+
- '"de902d8e63b6f37967e6cb3baafea4e2"'
|
37
37
|
Cache-Control:
|
38
38
|
- max-age=0, private, must-revalidate
|
39
39
|
X-Request-Id:
|
40
|
-
-
|
40
|
+
- 4b9567ee-e1e8-45b9-a5a4-541078ce28dc
|
41
41
|
X-Runtime:
|
42
|
-
- '0.
|
42
|
+
- '0.109848'
|
43
43
|
Transfer-Encoding:
|
44
44
|
- chunked
|
45
45
|
Via:
|
46
46
|
- 1.1 vegur
|
47
47
|
body:
|
48
48
|
encoding: UTF-8
|
49
|
-
string: '{"accounts":[]}'
|
49
|
+
string: '{"accounts":[{"id":4,"created_at":"2015-01-16T05:22:11.463Z","updated_at":"2015-01-16T05:22:11.463Z"},{"id":2,"created_at":"2015-01-16T05:15:52.490Z","updated_at":"2015-01-16T05:15:52.971Z"},{"id":1,"created_at":"2015-01-16T05:15:51.536Z","updated_at":"2015-01-16T05:15:51.536Z"}]}'
|
50
50
|
http_version:
|
51
|
-
recorded_at:
|
51
|
+
recorded_at: Sat, 17 Jan 2015 19:01:19 GMT
|
52
52
|
recorded_with: VCR 2.9.3
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
5
5
|
uri: http://account-authenticator.herokuapp.com/api/v1/authentications/authenticate
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"api_key":"
|
8
|
+
string: '{"api_key":"apptest","api_password":"password","account":{"id":4,"password":"new_password"}}'
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
11
|
- application/json
|
@@ -14,7 +14,7 @@ http_interactions:
|
|
14
14
|
Content-Type:
|
15
15
|
- application/json
|
16
16
|
Content-Length:
|
17
|
-
- '
|
17
|
+
- '92'
|
18
18
|
User-Agent:
|
19
19
|
- Ruby
|
20
20
|
response:
|
@@ -25,7 +25,7 @@ http_interactions:
|
|
25
25
|
Server:
|
26
26
|
- Cowboy
|
27
27
|
Date:
|
28
|
-
-
|
28
|
+
- Sat, 17 Jan 2015 19:01:20 GMT
|
29
29
|
Connection:
|
30
30
|
- keep-alive
|
31
31
|
X-Frame-Options:
|
@@ -37,22 +37,22 @@ http_interactions:
|
|
37
37
|
Content-Type:
|
38
38
|
- application/json; charset=utf-8
|
39
39
|
Etag:
|
40
|
-
- '"
|
40
|
+
- '"9ca3bfb51108244556ed45db7bd3f63a"'
|
41
41
|
Cache-Control:
|
42
42
|
- max-age=0, private, must-revalidate
|
43
43
|
Set-Cookie:
|
44
44
|
- request_method=POST; path=/
|
45
45
|
X-Request-Id:
|
46
|
-
-
|
46
|
+
- 0158c273-2c7b-4191-b6ad-1eb65ddf8248
|
47
47
|
X-Runtime:
|
48
|
-
- '0.
|
48
|
+
- '0.204698'
|
49
49
|
Transfer-Encoding:
|
50
50
|
- chunked
|
51
51
|
Via:
|
52
52
|
- 1.1 vegur
|
53
53
|
body:
|
54
54
|
encoding: UTF-8
|
55
|
-
string: '{"authenticated":true,"id":
|
55
|
+
string: '{"authenticated":true,"id":4,"created_at":"2015-01-16T05:22:11.463Z","updated_at":"2015-01-16T05:22:11.463Z"}'
|
56
56
|
http_version:
|
57
|
-
recorded_at:
|
57
|
+
recorded_at: Sat, 17 Jan 2015 19:01:20 GMT
|
58
58
|
recorded_with: VCR 2.9.3
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
5
5
|
uri: http://account-authenticator.herokuapp.com/api/v1/accounts
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"api_key":"
|
8
|
+
string: '{"api_key":"apptest","api_password":"password","account":{"account":{"id":0,"password":"new_password"}}}'
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
11
|
- application/json
|
@@ -14,7 +14,7 @@ http_interactions:
|
|
14
14
|
Content-Type:
|
15
15
|
- application/json
|
16
16
|
Content-Length:
|
17
|
-
- '
|
17
|
+
- '104'
|
18
18
|
User-Agent:
|
19
19
|
- Ruby
|
20
20
|
response:
|
@@ -25,7 +25,7 @@ http_interactions:
|
|
25
25
|
Server:
|
26
26
|
- Cowboy
|
27
27
|
Date:
|
28
|
-
-
|
28
|
+
- Sat, 17 Jan 2015 19:01:21 GMT
|
29
29
|
Connection:
|
30
30
|
- keep-alive
|
31
31
|
X-Frame-Options:
|
@@ -37,22 +37,22 @@ http_interactions:
|
|
37
37
|
Content-Type:
|
38
38
|
- application/json; charset=utf-8
|
39
39
|
Etag:
|
40
|
-
- '"
|
40
|
+
- '"9f7be646c43a0fbdbbc878390290049e"'
|
41
41
|
Cache-Control:
|
42
42
|
- max-age=0, private, must-revalidate
|
43
43
|
Set-Cookie:
|
44
44
|
- request_method=POST; path=/
|
45
45
|
X-Request-Id:
|
46
|
-
-
|
46
|
+
- 60f1d65c-7f27-4d62-82ba-04bdcfd096c5
|
47
47
|
X-Runtime:
|
48
|
-
- '0.
|
48
|
+
- '0.796433'
|
49
49
|
Transfer-Encoding:
|
50
50
|
- chunked
|
51
51
|
Via:
|
52
52
|
- 1.1 vegur
|
53
53
|
body:
|
54
54
|
encoding: UTF-8
|
55
|
-
string: '{"id":
|
55
|
+
string: '{"id":6,"created_at":"2015-01-17T19:01:20.936Z","updated_at":"2015-01-17T19:01:20.936Z"}'
|
56
56
|
http_version:
|
57
|
-
recorded_at:
|
57
|
+
recorded_at: Sat, 17 Jan 2015 19:01:21 GMT
|
58
58
|
recorded_with: VCR 2.9.3
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
5
5
|
uri: http://account-authenticator.herokuapp.com/api/v1/accounts
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"api_key":"
|
8
|
+
string: '{"api_key":"apptest","api_password":"password","account":{"account":{"id":2,"password":"new_password_2"}}}'
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
11
|
- application/json
|
@@ -14,7 +14,7 @@ http_interactions:
|
|
14
14
|
Content-Type:
|
15
15
|
- application/json
|
16
16
|
Content-Length:
|
17
|
-
- '
|
17
|
+
- '106'
|
18
18
|
User-Agent:
|
19
19
|
- Ruby
|
20
20
|
response:
|
@@ -25,7 +25,7 @@ http_interactions:
|
|
25
25
|
Server:
|
26
26
|
- Cowboy
|
27
27
|
Date:
|
28
|
-
-
|
28
|
+
- Sat, 17 Jan 2015 19:01:21 GMT
|
29
29
|
Connection:
|
30
30
|
- keep-alive
|
31
31
|
X-Frame-Options:
|
@@ -37,27 +37,27 @@ http_interactions:
|
|
37
37
|
Content-Type:
|
38
38
|
- application/json; charset=utf-8
|
39
39
|
Etag:
|
40
|
-
- '"
|
40
|
+
- '"060a243d78ce0d2a5c20e96bdc7a701c"'
|
41
41
|
Cache-Control:
|
42
42
|
- max-age=0, private, must-revalidate
|
43
43
|
Set-Cookie:
|
44
44
|
- request_method=POST; path=/
|
45
45
|
X-Request-Id:
|
46
|
-
-
|
46
|
+
- 94958e43-f422-47ce-aad0-d77eaedf755a
|
47
47
|
X-Runtime:
|
48
|
-
- '0.
|
48
|
+
- '0.109178'
|
49
49
|
Transfer-Encoding:
|
50
50
|
- chunked
|
51
51
|
Via:
|
52
52
|
- 1.1 vegur
|
53
53
|
body:
|
54
54
|
encoding: UTF-8
|
55
|
-
string: '{"id":
|
55
|
+
string: '{"id":8,"created_at":"2015-01-17T19:01:22.837Z","updated_at":"2015-01-17T19:01:22.837Z"}'
|
56
56
|
http_version:
|
57
|
-
recorded_at:
|
57
|
+
recorded_at: Sat, 17 Jan 2015 19:01:22 GMT
|
58
58
|
- request:
|
59
59
|
method: delete
|
60
|
-
uri: http://account-authenticator.herokuapp.com/api/v1/accounts/
|
60
|
+
uri: http://account-authenticator.herokuapp.com/api/v1/accounts/8?api_key=apptest&api_password=password
|
61
61
|
body:
|
62
62
|
encoding: US-ASCII
|
63
63
|
string: ''
|
@@ -76,7 +76,7 @@ http_interactions:
|
|
76
76
|
Server:
|
77
77
|
- Cowboy
|
78
78
|
Date:
|
79
|
-
-
|
79
|
+
- Sat, 17 Jan 2015 19:01:25 GMT
|
80
80
|
Connection:
|
81
81
|
- keep-alive
|
82
82
|
X-Frame-Options:
|
@@ -88,22 +88,22 @@ http_interactions:
|
|
88
88
|
Content-Type:
|
89
89
|
- application/json; charset=utf-8
|
90
90
|
Etag:
|
91
|
-
- '"
|
91
|
+
- '"1fc83a09a651f5bf02e3e01064becce9"'
|
92
92
|
Cache-Control:
|
93
93
|
- max-age=0, private, must-revalidate
|
94
94
|
Set-Cookie:
|
95
95
|
- request_method=DELETE; path=/
|
96
96
|
X-Request-Id:
|
97
|
-
-
|
97
|
+
- beab8fbc-26d9-4298-abc7-37f31e21fd0d
|
98
98
|
X-Runtime:
|
99
|
-
- '
|
99
|
+
- '3.581902'
|
100
100
|
Transfer-Encoding:
|
101
101
|
- chunked
|
102
102
|
Via:
|
103
103
|
- 1.1 vegur
|
104
104
|
body:
|
105
105
|
encoding: UTF-8
|
106
|
-
string: '{"id":
|
106
|
+
string: '{"id":8}'
|
107
107
|
http_version:
|
108
|
-
recorded_at:
|
108
|
+
recorded_at: Sat, 17 Jan 2015 19:01:26 GMT
|
109
109
|
recorded_with: VCR 2.9.3
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: http://account-authenticator.herokuapp.com/api/v1/accounts/1?api_key=
|
5
|
+
uri: http://account-authenticator.herokuapp.com/api/v1/accounts/1?api_key=apptest&api_password=password
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -21,7 +21,7 @@ http_interactions:
|
|
21
21
|
Server:
|
22
22
|
- Cowboy
|
23
23
|
Date:
|
24
|
-
-
|
24
|
+
- Sat, 17 Jan 2015 19:01:21 GMT
|
25
25
|
Connection:
|
26
26
|
- keep-alive
|
27
27
|
X-Frame-Options:
|
@@ -33,20 +33,20 @@ http_interactions:
|
|
33
33
|
Content-Type:
|
34
34
|
- application/json; charset=utf-8
|
35
35
|
Etag:
|
36
|
-
- '"
|
36
|
+
- '"cb0b1c52612cec2d87437013ed195b56"'
|
37
37
|
Cache-Control:
|
38
38
|
- max-age=0, private, must-revalidate
|
39
39
|
X-Request-Id:
|
40
|
-
-
|
40
|
+
- 87f91951-ac31-4fa0-ae3b-0205849934ea
|
41
41
|
X-Runtime:
|
42
|
-
- '0.
|
42
|
+
- '0.107674'
|
43
43
|
Transfer-Encoding:
|
44
44
|
- chunked
|
45
45
|
Via:
|
46
46
|
- 1.1 vegur
|
47
47
|
body:
|
48
48
|
encoding: UTF-8
|
49
|
-
string: '{"id":1,"
|
49
|
+
string: '{"id":1,"created_at":"2015-01-16T05:15:51.536Z","updated_at":"2015-01-16T05:15:51.536Z"}'
|
50
50
|
http_version:
|
51
|
-
recorded_at:
|
51
|
+
recorded_at: Sat, 17 Jan 2015 19:01:21 GMT
|
52
52
|
recorded_with: VCR 2.9.3
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
5
5
|
uri: http://account-authenticator.herokuapp.com/api/v1/accounts
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: '{"api_key":"
|
8
|
+
string: '{"api_key":"apptest","api_password":"password","account":{"account":{"id":1,"password":"new_password_1"}}}'
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
11
|
- application/json
|
@@ -14,7 +14,7 @@ http_interactions:
|
|
14
14
|
Content-Type:
|
15
15
|
- application/json
|
16
16
|
Content-Length:
|
17
|
-
- '
|
17
|
+
- '106'
|
18
18
|
User-Agent:
|
19
19
|
- Ruby
|
20
20
|
response:
|
@@ -25,7 +25,7 @@ http_interactions:
|
|
25
25
|
Server:
|
26
26
|
- Cowboy
|
27
27
|
Date:
|
28
|
-
-
|
28
|
+
- Sat, 17 Jan 2015 19:01:21 GMT
|
29
29
|
Connection:
|
30
30
|
- keep-alive
|
31
31
|
X-Frame-Options:
|
@@ -37,30 +37,30 @@ http_interactions:
|
|
37
37
|
Content-Type:
|
38
38
|
- application/json; charset=utf-8
|
39
39
|
Etag:
|
40
|
-
- '"
|
40
|
+
- '"1ccb0b0be4d2ed5a20210324186f0027"'
|
41
41
|
Cache-Control:
|
42
42
|
- max-age=0, private, must-revalidate
|
43
43
|
Set-Cookie:
|
44
44
|
- request_method=POST; path=/
|
45
45
|
X-Request-Id:
|
46
|
-
-
|
46
|
+
- be33657a-b32e-4b94-a49d-5ac0de0353d3
|
47
47
|
X-Runtime:
|
48
|
-
- '0.
|
48
|
+
- '0.109104'
|
49
49
|
Transfer-Encoding:
|
50
50
|
- chunked
|
51
51
|
Via:
|
52
52
|
- 1.1 vegur
|
53
53
|
body:
|
54
54
|
encoding: UTF-8
|
55
|
-
string: '{"id":
|
55
|
+
string: '{"id":7,"created_at":"2015-01-17T19:01:22.134Z","updated_at":"2015-01-17T19:01:22.134Z"}'
|
56
56
|
http_version:
|
57
|
-
recorded_at:
|
57
|
+
recorded_at: Sat, 17 Jan 2015 19:01:22 GMT
|
58
58
|
- request:
|
59
59
|
method: put
|
60
|
-
uri: http://account-authenticator.herokuapp.com/api/v1/accounts/
|
60
|
+
uri: http://account-authenticator.herokuapp.com/api/v1/accounts/7
|
61
61
|
body:
|
62
62
|
encoding: UTF-8
|
63
|
-
string: '{"api_key":"
|
63
|
+
string: '{"api_key":"apptest","api_password":"password","account":{"account":{"id":3,"password":"new_password"}}}'
|
64
64
|
headers:
|
65
65
|
Accept:
|
66
66
|
- application/json
|
@@ -69,7 +69,7 @@ http_interactions:
|
|
69
69
|
Content-Type:
|
70
70
|
- application/json
|
71
71
|
Content-Length:
|
72
|
-
- '
|
72
|
+
- '104'
|
73
73
|
User-Agent:
|
74
74
|
- Ruby
|
75
75
|
response:
|
@@ -80,7 +80,7 @@ http_interactions:
|
|
80
80
|
Server:
|
81
81
|
- Cowboy
|
82
82
|
Date:
|
83
|
-
-
|
83
|
+
- Sat, 17 Jan 2015 19:01:22 GMT
|
84
84
|
Connection:
|
85
85
|
- keep-alive
|
86
86
|
X-Frame-Options:
|
@@ -92,22 +92,22 @@ http_interactions:
|
|
92
92
|
Content-Type:
|
93
93
|
- application/json; charset=utf-8
|
94
94
|
Etag:
|
95
|
-
- '"
|
95
|
+
- '"1ccb0b0be4d2ed5a20210324186f0027"'
|
96
96
|
Cache-Control:
|
97
97
|
- max-age=0, private, must-revalidate
|
98
98
|
Set-Cookie:
|
99
99
|
- request_method=PUT; path=/
|
100
100
|
X-Request-Id:
|
101
|
-
-
|
101
|
+
- d9ac75de-010f-4926-84ce-0807e593433c
|
102
102
|
X-Runtime:
|
103
|
-
- '0.
|
103
|
+
- '0.109540'
|
104
104
|
Transfer-Encoding:
|
105
105
|
- chunked
|
106
106
|
Via:
|
107
107
|
- 1.1 vegur
|
108
108
|
body:
|
109
109
|
encoding: UTF-8
|
110
|
-
string: '{"id":
|
110
|
+
string: '{"id":7,"created_at":"2015-01-17T19:01:22.134Z","updated_at":"2015-01-17T19:01:22.134Z"}'
|
111
111
|
http_version:
|
112
|
-
recorded_at:
|
112
|
+
recorded_at: Sat, 17 Jan 2015 19:01:22 GMT
|
113
113
|
recorded_with: VCR 2.9.3
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authenticator-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- johnmcconnell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: attr_init
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.0.4
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.0.4
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: rest-client
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -30,14 +44,14 @@ dependencies:
|
|
30
44
|
requirements:
|
31
45
|
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
47
|
+
version: 0.2.2
|
34
48
|
type: :runtime
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
54
|
+
version: 0.2.2
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: simplecov
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|