lastpass 1.2.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.ruby-version +1 -1
- data/.travis.yml +1 -0
- data/CHANGELOG.md +7 -0
- data/README.md +7 -1
- data/Rakefile +1 -1
- data/lastpass.gemspec +3 -2
- data/lib/lastpass.rb +1 -0
- data/lib/lastpass/fetcher.rb +11 -3
- data/lib/lastpass/http.rb +8 -0
- data/lib/lastpass/version.rb +1 -1
- data/spec/http_spec.rb +17 -0
- data/spec/spec_helper.rb +1 -0
- metadata +26 -7
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.9.3-
|
1
|
+
1.9.3-p551
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -33,7 +33,7 @@ end
|
|
33
33
|
```
|
34
34
|
|
35
35
|
|
36
|
-
A multifactor password (YubiKey, Google Authenticator) can optionally be appended to
|
36
|
+
A multifactor password (YubiKey, Google Authenticator) can optionally be appended to
|
37
37
|
the login credentials:
|
38
38
|
|
39
39
|
```ruby
|
@@ -61,6 +61,12 @@ Contribution in any form and shape is very welcome. Have comments,
|
|
61
61
|
suggestions, patches, pull requests? All of the above are welcome.
|
62
62
|
|
63
63
|
|
64
|
+
Thanks
|
65
|
+
------
|
66
|
+
|
67
|
+
- [Chris D'Ambrosio](https://github.com/chrisdambrosio) for adding proxy support
|
68
|
+
|
69
|
+
|
64
70
|
License
|
65
71
|
-------
|
66
72
|
|
data/Rakefile
CHANGED
data/lastpass.gemspec
CHANGED
@@ -19,8 +19,9 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.add_dependency "httparty", "~> 0.13.0"
|
20
20
|
s.add_dependency "pbkdf2-ruby", "~> 0.2.0"
|
21
21
|
|
22
|
-
s.add_development_dependency "rake", "~> 10.
|
23
|
-
s.add_development_dependency "rspec", "~>
|
22
|
+
s.add_development_dependency "rake", "~> 10.4.0"
|
23
|
+
s.add_development_dependency "rspec", "~> 3.1.0"
|
24
|
+
s.add_development_dependency "rspec-its", "~> 1.1.0"
|
24
25
|
s.add_development_dependency "coveralls", "~> 0.7.0"
|
25
26
|
|
26
27
|
s.files = `git ls-files`.split "\n"
|
data/lib/lastpass.rb
CHANGED
data/lib/lastpass/fetcher.rb
CHANGED
@@ -8,7 +8,7 @@ module LastPass
|
|
8
8
|
request_login username, password, key_iteration_count, multifactor_password
|
9
9
|
end
|
10
10
|
|
11
|
-
def self.fetch session, web_client =
|
11
|
+
def self.fetch session, web_client = http
|
12
12
|
response = web_client.get "https://lastpass.com/getaccts.php?mobile=1&b64=1&hash=0.0&hasplugin=3.0.23&requestsrc=android",
|
13
13
|
format: :plain,
|
14
14
|
cookies: {"PHPSESSID" => URI.encode(session.id)}
|
@@ -18,7 +18,7 @@ module LastPass
|
|
18
18
|
Blob.new decode_blob(response.parsed_response), session.key_iteration_count
|
19
19
|
end
|
20
20
|
|
21
|
-
def self.request_iteration_count username, web_client =
|
21
|
+
def self.request_iteration_count username, web_client = http
|
22
22
|
response = web_client.post "https://lastpass.com/iterations.php",
|
23
23
|
query: {email: username}
|
24
24
|
|
@@ -39,7 +39,7 @@ module LastPass
|
|
39
39
|
password,
|
40
40
|
key_iteration_count,
|
41
41
|
multifactor_password = nil,
|
42
|
-
web_client =
|
42
|
+
web_client = http
|
43
43
|
|
44
44
|
body = {
|
45
45
|
method: "mobile",
|
@@ -131,6 +131,14 @@ module LastPass
|
|
131
131
|
end
|
132
132
|
end
|
133
133
|
|
134
|
+
def self.http
|
135
|
+
@http ||= HTTP
|
136
|
+
end
|
137
|
+
|
138
|
+
def self.http= client
|
139
|
+
@http = client
|
140
|
+
end
|
141
|
+
|
134
142
|
# Can't instantiate Fetcher
|
135
143
|
private_class_method :new
|
136
144
|
end
|
data/lib/lastpass/version.rb
CHANGED
data/spec/http_spec.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Copyright (C) 2013 Dmitry Yakimenko (detunized@gmail.com).
|
2
|
+
# Licensed under the terms of the MIT license. See LICENCE for details.
|
3
|
+
|
4
|
+
require "spec_helper"
|
5
|
+
|
6
|
+
describe LastPass::HTTP do
|
7
|
+
let(:http) { LastPass::HTTP }
|
8
|
+
|
9
|
+
it 'can set the proxy options' do
|
10
|
+
http.http_proxy('proxy.fazbearentertainment.com', 1987, 'ffazbear', 'itsme')
|
11
|
+
options = http.instance_variable_get(:@default_options)
|
12
|
+
expect(options[:http_proxyaddr]).to eq('proxy.fazbearentertainment.com')
|
13
|
+
expect(options[:http_proxyport]).to eq(1987)
|
14
|
+
expect(options[:http_proxyuser]).to eq('ffazbear')
|
15
|
+
expect(options[:http_proxypass]).to eq('itsme')
|
16
|
+
end
|
17
|
+
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lastpass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-12-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ~>
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 10.
|
53
|
+
version: 10.4.0
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +58,7 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 10.
|
61
|
+
version: 10.4.0
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: rspec
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
requirements:
|
67
67
|
- - ~>
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
69
|
+
version: 3.1.0
|
70
70
|
type: :development
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -74,7 +74,23 @@ dependencies:
|
|
74
74
|
requirements:
|
75
75
|
- - ~>
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
77
|
+
version: 3.1.0
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rspec-its
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ~>
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 1.1.0
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 1.1.0
|
78
94
|
- !ruby/object:Gem::Dependency
|
79
95
|
name: coveralls
|
80
96
|
requirement: !ruby/object:Gem::Requirement
|
@@ -116,6 +132,7 @@ files:
|
|
116
132
|
- lib/lastpass/chunk.rb
|
117
133
|
- lib/lastpass/exceptions.rb
|
118
134
|
- lib/lastpass/fetcher.rb
|
135
|
+
- lib/lastpass/http.rb
|
119
136
|
- lib/lastpass/parser.rb
|
120
137
|
- lib/lastpass/session.rb
|
121
138
|
- lib/lastpass/vault.rb
|
@@ -124,6 +141,7 @@ files:
|
|
124
141
|
- spec/blob_spec.rb
|
125
142
|
- spec/chunk_spec.rb
|
126
143
|
- spec/fetcher_spec.rb
|
144
|
+
- spec/http_spec.rb
|
127
145
|
- spec/parser_spec.rb
|
128
146
|
- spec/session_spec.rb
|
129
147
|
- spec/spec_helper.rb
|
@@ -150,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
168
|
version: '0'
|
151
169
|
requirements: []
|
152
170
|
rubyforge_project:
|
153
|
-
rubygems_version: 1.8.23
|
171
|
+
rubygems_version: 1.8.23.2
|
154
172
|
signing_key:
|
155
173
|
specification_version: 3
|
156
174
|
summary: Unofficial LastPass API
|
@@ -159,6 +177,7 @@ test_files:
|
|
159
177
|
- spec/blob_spec.rb
|
160
178
|
- spec/chunk_spec.rb
|
161
179
|
- spec/fetcher_spec.rb
|
180
|
+
- spec/http_spec.rb
|
162
181
|
- spec/parser_spec.rb
|
163
182
|
- spec/session_spec.rb
|
164
183
|
- spec/spec_helper.rb
|