spaceship 0.11.4 → 0.11.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/spaceship/client.rb +15 -4
- data/lib/spaceship/portal/portal_client.rb +8 -2
- data/lib/spaceship/tunes/tunes_client.rb +1 -1
- data/lib/spaceship/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7892cbc5a93927bef1d796eb45fc84c1017dc1dc
|
4
|
+
data.tar.gz: df314307a70c527c622414cdcde805c0ab3c273f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 347d01092e1fcd5c0f5ac9de94bb2da604224fb022a7840ff8f7c0549ac547f75a6e07b7a85dc9bcfe0a6ba9fcdbba8c2e10e73a7933df3e0d4080ba80c6e9d2
|
7
|
+
data.tar.gz: e545770c5d1e129f3b85ebf6240ffa2b1730c106b4143a0700ce4f4828d5ee9e59fc5dd0e261e720edc5a9e6584f68eee8d735fc1ae44b43456d522fd657bfba
|
data/lib/spaceship/client.rb
CHANGED
@@ -142,9 +142,9 @@ module Spaceship
|
|
142
142
|
if user.to_s.empty? or password.to_s.empty?
|
143
143
|
require 'credentials_manager'
|
144
144
|
|
145
|
-
|
146
|
-
user ||=
|
147
|
-
password =
|
145
|
+
keychain_entry = CredentialsManager::AccountManager.new(user: user, password: password)
|
146
|
+
user ||= keychain_entry.user
|
147
|
+
password = keychain_entry.password
|
148
148
|
end
|
149
149
|
|
150
150
|
if user.to_s.strip.empty? or password.to_s.strip.empty?
|
@@ -152,7 +152,18 @@ module Spaceship
|
|
152
152
|
end
|
153
153
|
|
154
154
|
self.user = user
|
155
|
-
|
155
|
+
|
156
|
+
begin
|
157
|
+
send_login_request(user, password) # different in subclasses
|
158
|
+
rescue InvalidUserCredentialsError => ex
|
159
|
+
raise ex unless keychain_entry
|
160
|
+
|
161
|
+
if keychain_entry.invalid_credentials
|
162
|
+
login(user)
|
163
|
+
else
|
164
|
+
puts "Please run this tool again to apply the new password"
|
165
|
+
end
|
166
|
+
end
|
156
167
|
end
|
157
168
|
|
158
169
|
# @return (Bool) Do we have a valid session?
|
@@ -41,8 +41,14 @@ module Spaceship
|
|
41
41
|
@cookie = "myacinfo=#{$1};"
|
42
42
|
return @client
|
43
43
|
else
|
44
|
-
#
|
45
|
-
|
44
|
+
# Something went wrong. Was it invalid credentials or server issue
|
45
|
+
if (response.body || "").include?("Your Apple ID or password was entered incorrectly")
|
46
|
+
# User Credentials are wrong
|
47
|
+
raise InvalidUserCredentialsError.new, "Invalid username and password combination. Used '#{user}' as the username."
|
48
|
+
else
|
49
|
+
info = [response.body, response['Set-Cookie']]
|
50
|
+
raise UnexpectedResponse.new, info.join("\n")
|
51
|
+
end
|
46
52
|
end
|
47
53
|
end
|
48
54
|
|
@@ -88,7 +88,7 @@ module Spaceship
|
|
88
88
|
|
89
89
|
return @client
|
90
90
|
else
|
91
|
-
if (response.body || "").include?("
|
91
|
+
if (response.body || "").include?("Your Apple ID or password was entered incorrectly")
|
92
92
|
# User Credentials are wrong
|
93
93
|
raise InvalidUserCredentialsError.new, "Invalid username and password combination. Used '#{user}' as the username."
|
94
94
|
else
|
data/lib/spaceship/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spaceship
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felix Krause
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-10-
|
12
|
+
date: 2015-10-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: credentials_manager
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.
|
20
|
+
version: 0.9.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.
|
27
|
+
version: 0.9.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: multi_xml
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|