lastpass 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- 1.9.3-p484
1
+ 1.9.3-p551
@@ -2,3 +2,4 @@ language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
4
  - 2.0.0
5
+ - 2.1.5
@@ -1,8 +1,15 @@
1
+ Version 1.3.0
2
+ -------------
3
+
4
+ - Added proxy support
5
+
6
+
1
7
  Version 1.2.1
2
8
  -------------
3
9
 
4
10
  - Fixed the decryption bug on long shared folder names.
5
11
 
12
+
6
13
  Version 1.2.0
7
14
  -------------
8
15
 
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
@@ -7,7 +7,7 @@ task :default => :spec
7
7
 
8
8
  # Spec
9
9
  RSpec::Core::RakeTask.new :spec do |task|
10
- task.rspec_opts = "--format nested --color"
10
+ task.rspec_opts = "--format documentation --color"
11
11
  end
12
12
 
13
13
  # Example
@@ -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.3.0"
23
- s.add_development_dependency "rspec", "~> 2.14.0"
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"
@@ -11,6 +11,7 @@ require "lastpass/account"
11
11
  require "lastpass/blob"
12
12
  require "lastpass/chunk"
13
13
  require "lastpass/exceptions"
14
+ require "lastpass/http"
14
15
  require "lastpass/fetcher"
15
16
  require "lastpass/parser"
16
17
  require "lastpass/session"
@@ -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 = HTTParty
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 = HTTParty
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 = HTTParty
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
@@ -0,0 +1,8 @@
1
+ # Copyright (C) 2013 Dmitry Yakimenko (detunized@gmail.com).
2
+ # Licensed under the terms of the MIT license. See LICENCE for details.
3
+
4
+ module LastPass
5
+ class HTTP
6
+ include HTTParty
7
+ end
8
+ end
@@ -2,5 +2,5 @@
2
2
  # Licensed under the terms of the MIT license. See LICENCE for details.
3
3
 
4
4
  module LastPass
5
- VERSION = "1.2.1"
5
+ VERSION = "1.3.0"
6
6
  end
@@ -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
@@ -9,6 +9,7 @@ end
9
9
 
10
10
  require "base64"
11
11
  require "lastpass"
12
+ require "rspec/its"
12
13
 
13
14
  class String
14
15
  def decode64
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.2.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-06-21 00:00:00.000000000 Z
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.3.0
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.3.0
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: 2.14.0
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: 2.14.0
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