fastlane-plugin-sapfire 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1acba89a24594d75771baf331f21ee7edb48214dd46a7ac3d156a9cb69cb916d
4
- data.tar.gz: '083e0a2bf42c6b47e5cd25498fce324ca8f148ad8731488971fca1fd105ab3f7'
3
+ metadata.gz: b04c4cbeb06c2856f862f7d4410efeaf27cb92a9e0b7291280199be31046573c
4
+ data.tar.gz: e19d2776f46af1798b2a6ce9d9c512ae0eae5937fac8128876538d43df162095
5
5
  SHA512:
6
- metadata.gz: 0f6132a34df4a89c0e1d36e8a64c6fe51210741e762e9fa14f48d752e34823a2079f5a26fa1b8e77f9473bdb11c051f1d4023ed171dd5b6e64df7c35627c78ae
7
- data.tar.gz: ea7ec418dc4687a371f58b64edfbcbc72511e801bbb26836c3d1d3590802cc557110e3e365562110642613ec62c35a2d44f440014cdfce8210a3a187f9fc873d
6
+ metadata.gz: b7db36a7409104f795a328a2b0706e14e3a3f7ddf732d5f397ad57f6094bd894007a60d65897f5076d7add53a0abd8e0707fd1bc36c8cc0d80592861856df2b4
7
+ data.tar.gz: 78e224d53850151f10099fb430f276ed2dfcc1fb92fa6b5dd47f0217c3880c235f65de35722bae2d6e1438755c123c091a5ce5f8032af0cc3f4b79cd721b51a7
@@ -11,6 +11,9 @@ module Fastlane
11
11
  @vsapi_host = ""
12
12
  @vsapi_endpoint = ""
13
13
 
14
+ VS_API_FW_LINK = "2264307".freeze
15
+ DEV_CENTER_FW_LINK = "2263650".freeze
16
+ VS_CLIENT_ID = "04f0c124-f2bc-4f59-8241-bf6df9866bbd".freeze
14
17
  XML_NAME = "Package.StoreAssociation.xml".freeze
15
18
 
16
19
  def self.run(params)
@@ -19,8 +22,9 @@ module Fastlane
19
22
  begin
20
23
  UI.message("Creating #{XML_NAME}...")
21
24
 
22
- acquire_authorization_token
23
- acquire_vsapi_location
25
+ dev_center_url = acquire_dev_center_location
26
+ acquire_vs_api_location
27
+ acquire_authorization_token(dev_center_url)
24
28
  ms_developer_info = developer_info
25
29
  ms_app_info = app_info(params[:app_id])
26
30
  create_xml(params[:manifest], ms_developer_info, ms_app_info)
@@ -161,16 +165,14 @@ module Fastlane
161
165
  end
162
166
  end
163
167
 
164
- def self.acquire_authorization_token
168
+ def self.acquire_authorization_token(resource)
165
169
  UI.message("Acquiring authorization token ...")
166
170
 
167
171
  ms_credentials = Helper.ms_credentials
168
172
  body = {
169
- client_id: ms_credentials.client_id,
170
- client_secret: ms_credentials.client_secret,
171
- client_info: 1,
173
+ client_id: VS_CLIENT_ID,
172
174
  grant_type: "password",
173
- scope: "https://graph.windows.net/.default offline_access openid profile",
175
+ scope: "#{resource}/.default",
174
176
  username: ms_credentials.username,
175
177
  password: ms_credentials.password
176
178
  }
@@ -202,9 +204,25 @@ module Fastlane
202
204
  end
203
205
  end
204
206
 
205
- def self.acquire_vsapi_location
207
+ def self.acquire_dev_center_location
208
+ location = acquire_fw_url(DEV_CENTER_FW_LINK)
209
+ UI.message("Dev Center location: #{location}")
210
+
211
+ location
212
+ end
213
+
214
+ def self.acquire_vs_api_location
215
+ location = acquire_fw_url(VS_API_FW_LINK)
216
+ uri = URI(location)
217
+ @vsapi_host = "#{uri.scheme}://#{uri.host}"
218
+ @vsapi_endpoint = uri.path
219
+
220
+ UI.message("VS API location: #{location}")
221
+ end
222
+
223
+ def self.acquire_fw_url(link_id)
206
224
  query = {
207
- LinkId: "875315" # VS API constant
225
+ LinkId: link_id
208
226
  }
209
227
  connection = Faraday.new("https://go.microsoft.com")
210
228
 
@@ -214,14 +232,7 @@ module Fastlane
214
232
  if response.status == 302
215
233
  raise "'Location' header isn't presented" unless response.headers.include?("Location")
216
234
 
217
- location = response.headers["Location"]
218
- uri = URI(location)
219
- @vsapi_host = "#{uri.scheme}://#{uri.host}"
220
- @vsapi_endpoint = uri.path
221
-
222
- UI.message("VS API endpoint: #{location}")
223
-
224
- return
235
+ return response.headers["Location"]
225
236
  end
226
237
 
227
238
  UI.user_error!("Request returned the error: #{response.status}")
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Sapfire
3
- VERSION = "1.2.1"
3
+ VERSION = "1.2.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-sapfire
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - CheeryLee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-29 00:00:00.000000000 Z
11
+ date: 2024-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday