spaceship 0.14.0 → 0.14.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 370ec337b82d693b4f075578ab84890ab2902e5f
4
- data.tar.gz: 5e2606ea51d5c94ef8ec6f4f965f30c33a791ef8
3
+ metadata.gz: efe34135bd4966d4a8efe7ac21b7d638db2c085c
4
+ data.tar.gz: 44056669198645eb1de17498a975a7e66e613a53
5
5
  SHA512:
6
- metadata.gz: df4dcbb65bea1cf44d5d67e2f07131970efef005f3467ea4d0311a1800496be35ba21478e10fb9fd6166670369ead31a2395163fef4db86f8f6523addb5fdd9f
7
- data.tar.gz: ebb2ecb1788a9c54a0613faf5d313c6ee12616c5373b66641c8deb7cabce6fa72690f3bdc3cf4be2cf3b271c50191da9e1306500617b1b83c814b5eaef18e069
6
+ metadata.gz: 9d8ab0e67421cd0e5a3b93529823458c4e30d34d8c723b4dde29af757b308f2a12358e6217a75704868e5f95dc600d2e70531162ac01f46cf0f229d6dc38ba2b
7
+ data.tar.gz: 5293d69bfe011f6877e7885e7ba92e734d2a540d8a7763fe7e7e6af36f1545dd415a288de87c0e4babb71e82a467974bda48155666e086e8ee90dc65383ccad8
@@ -287,10 +287,10 @@ module Spaceship
287
287
  type: type
288
288
  })
289
289
  a = parse_response(r)
290
- if a.include?("Apple Inc")
290
+ if r.success? && a.include?("Apple Inc")
291
291
  return a
292
292
  else
293
- raise "Couldn't download provisioning profile, got this instead: #{a}"
293
+ raise UnexpectedResponse.new, "Couldn't download provisioning profile, got this instead: #{a}"
294
294
  end
295
295
  end
296
296
 
@@ -338,10 +338,10 @@ module Spaceship
338
338
  displayId: profile_id
339
339
  })
340
340
  a = parse_response(r)
341
- if a.include?("DOCTYPE plist PUBLIC")
341
+ if r.success? && a.include?("DOCTYPE plist PUBLIC")
342
342
  return a
343
343
  else
344
- raise "Couldn't download provisioning profile, got this instead: #{a}"
344
+ raise UnexpectedResponse.new, "Couldn't download provisioning profile, got this instead: #{a}"
345
345
  end
346
346
  end
347
347
 
@@ -130,7 +130,7 @@ module Spaceship
130
130
  # if everything is alright, the result will be
131
131
  # `{"sectionErrorKeys"=>[], "sectionInfoKeys"=>[], "sectionWarningKeys"=>[], "replyConstraints"=>{"minLength"=>1, "maxLength"=>4000}, "appNotes"=>{"threads"=>[]}, "betaNotes"=>{"threads"=>[]}, "appMessages"=>{"threads"=>[]}}`
132
132
  def resolution_center
133
- client.get_resolution_center(apple_id)
133
+ client.get_resolution_center(apple_id, platform)
134
134
  end
135
135
 
136
136
  def details
@@ -54,11 +54,23 @@ module Spaceship
54
54
  req.url "https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa"
55
55
  req.headers["Cookie"] = cookies.collect { |k, v| "#{k}=#{v}; " }.join("")
56
56
  end
57
+
58
+ unless woa['Set-Cookie'].include?("itctx")
59
+ raise "Looks like your Apple ID is not enabled for iTunes Connect, make sure to be able to login online"
60
+ end
61
+
57
62
  cookies[:itctx] = woa['Set-Cookie'].match(/itctx=([^;]*)/)[1]
58
63
 
59
64
  return @login_overhead_cookies ||= cookies
60
65
  end
61
66
 
67
+ def service_key
68
+ return @service_key if @service_key
69
+ # We need a service key from a JS file to properly auth
70
+ js = request(:get, "https://itunesconnect.apple.com/itc/static-resources/controllers/login_cntrl.js")
71
+ @service_key ||= js.body.match(/itcServiceKey = '(.*)'/)[1]
72
+ end
73
+
62
74
  def send_login_request(user, password)
63
75
  data = {
64
76
  accountName: user,
@@ -67,7 +79,7 @@ module Spaceship
67
79
  }
68
80
 
69
81
  response = request(:post) do |req|
70
- req.url "https://idmsa.apple.com/appleauth/auth/signin"
82
+ req.url "https://idmsa.apple.com/appleauth/auth/signin?widgetKey=#{service_key}"
71
83
  req.body = data.to_json
72
84
  req.headers['Content-Type'] = 'application/json'
73
85
  end
@@ -90,7 +102,9 @@ module Spaceship
90
102
 
91
103
  return @client
92
104
  else
93
- if (response.body || "").include?("Your Apple ID or password was entered incorrectly")
105
+ if response["Location"] == "/auth" # redirect to 2 step auth page
106
+ raise "spaceship / fastlane doesn't support 2 step enabled accounts yet. Please temporary disable 2 step verification until spaceship was updated."
107
+ elsif (response.body || "").include?('invalid="true"')
94
108
  # User Credentials are wrong
95
109
  raise InvalidUserCredentialsError.new, "Invalid username and password combination. Used '#{user}' as the username."
96
110
  else
@@ -238,8 +252,8 @@ module Spaceship
238
252
  handle_itc_response(data)
239
253
  end
240
254
 
241
- def get_resolution_center(app_id)
242
- r = request(:get, "ra/apps/#{app_id}/resolutionCenter?v=latest")
255
+ def get_resolution_center(app_id, platform)
256
+ r = request(:get, "ra/apps/#{app_id}/platforms/#{platform}/resolutionCenter?v=latest")
243
257
  parse_response(r, 'data')
244
258
  end
245
259
 
@@ -1,3 +1,3 @@
1
1
  module Spaceship
2
- VERSION = "0.14.0"
2
+ VERSION = "0.14.1"
3
3
  end
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.14.0
4
+ version: 0.14.1
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-11-12 00:00:00.000000000 Z
12
+ date: 2015-11-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: credentials_manager