fastlane-plugin-json_auth 1.2.1 → 1.2.4

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
  SHA256:
3
- metadata.gz: 91c38fcdde0bd67232329e0f29d9d37893e0c233248e2ce95f24c2cd9d70dc89
4
- data.tar.gz: c0aea0900efb7cd4169ba38378123436fa0c4c2023acfe228b69fb825d0d4779
3
+ metadata.gz: f6469b9dfb73efec55fb738b52e312b328e7ce75bc7d1b46c8cc014e224416ef
4
+ data.tar.gz: 85b9216604000b2db974d569b6036427221842cbae7ec4eda0debf0fcb250a93
5
5
  SHA512:
6
- metadata.gz: f4b708fa05c25a1eeeb134c554567203470e142c8b4c03eb003113cdf57cbd690155863f3874651c308c1fe77d7c3dc7cc38a209570656e5fb57543965e8ba94
7
- data.tar.gz: b2cb866f1df76cb4867b4022b4759e7bf754d23f43e2fa9b1f73cc36beed297b6ff89c3294f440e82f3ed60e147fc13e1e235ac8d58b3c99c5f16501f4e0eb4e
6
+ metadata.gz: b523bc16b1470bc7e04ea82a5623f314800192d227c233fe7a0d434717654aaf9f07539567fc4f7e2b7ffeb3c992d5b924b6c72488c67d1bcb5ce3c5afd439c7
7
+ data.tar.gz: 628e664acaf12cc72fcd4588237ff65ff1e59857df06269a8a2ca1a399dd877d5c09651df13c1ff623ba92cad65778c7efb34e658e3ec78ba0cdb04f5cdefd36
@@ -9,17 +9,27 @@ module Fastlane
9
9
  def self.run(params)
10
10
  json_url = params[:json_url]
11
11
  @is_verbose = params[:verbose]
12
+ username = params[:username]
13
+ password = params[:password]
12
14
 
13
15
  uri = URI(json_url)
14
- request = Net::HTTP::Get.new uri.request_uri
15
- request.basic_auth params[:username], params[:password]
16
16
 
17
17
  print_params(params) if @is_verbose
18
18
  puts("Downloading json from #{uri}") if @is_verbose
19
19
 
20
20
  begin
21
- response = http.request request
22
- JSON.parse(response.body, symbolize_names: true)
21
+ Net::HTTP.start(uri.host, uri.port,
22
+ use_ssl: uri.scheme == 'https',
23
+ verify_mode: OpenSSL::SSL::VERIFY_NONE) do |http|
24
+
25
+ request = Net::HTTP::Get.new(uri.request_uri)
26
+ if !username.nil? && !username.empty? && !password.nil? && !password.empty?
27
+ request.basic_auth(params[:username], params[:password])
28
+ end
29
+
30
+ response = http.request(request)
31
+ JSON.parse(response.body, symbolize_names: true)
32
+ end
23
33
  rescue JSON::ParserError
24
34
  puts_error!("Downloaded json has invalid content ❌")
25
35
  rescue => exception
@@ -49,6 +59,16 @@ module Fastlane
49
59
  verify_block: proc do |value|
50
60
  UI.user_error!("You must set json_url pointing to a json file") unless value && !value.empty?
51
61
  end),
62
+ FastlaneCore::ConfigItem.new(key: :username,
63
+ description: "Basic auth username to download",
64
+ optional: true,
65
+ is_string: true,
66
+ default_value: nil),
67
+ FastlaneCore::ConfigItem.new(key: :password,
68
+ description: "Basic auth password to download",
69
+ optional: true,
70
+ is_string: true,
71
+ default_value: nil),
52
72
  FastlaneCore::ConfigItem.new(key: :verbose,
53
73
  description: "verbose",
54
74
  optional: true,
@@ -70,7 +90,7 @@ module Fastlane
70
90
  end
71
91
 
72
92
  def self.authors
73
- ["Martin Gonzalez"]
93
+ ["Martin Gonzalez", "Thang Nguyen"]
74
94
  end
75
95
 
76
96
  def self.is_supported?(_platform)
@@ -0,0 +1,5 @@
1
+ module Fastlane
2
+ module JsonAuth
3
+ VERSION = "1.2.4"
4
+ end
5
+ end
@@ -1,7 +1,7 @@
1
- require 'fastlane/plugin/json/version'
1
+ require 'fastlane/plugin/json_auth/version'
2
2
 
3
3
  module Fastlane
4
- module Json
4
+ module JsonAuth
5
5
  # Return all .rb files inside the "actions" and "helper" directory
6
6
  def self.all_classes
7
7
  Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
@@ -11,6 +11,6 @@ end
11
11
 
12
12
  # By default we want to import all available actions and helpers
13
13
  # A plugin can contain any number of actions and plugins
14
- Fastlane::Json.all_classes.each do |current|
14
+ Fastlane::JsonAuth.all_classes.each do |current|
15
15
  require current
16
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-json_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Gonzalez
@@ -147,13 +147,13 @@ extra_rdoc_files: []
147
147
  files:
148
148
  - LICENSE
149
149
  - README.md
150
- - lib/fastlane/plugin/json.rb
151
- - lib/fastlane/plugin/json/actions/download_json_action.rb
152
- - lib/fastlane/plugin/json/actions/merge_jsons_action.rb
153
- - lib/fastlane/plugin/json/actions/read_json_action.rb
154
- - lib/fastlane/plugin/json/actions/write_json_action.rb
155
- - lib/fastlane/plugin/json/helper/json_helper.rb
156
- - lib/fastlane/plugin/json/version.rb
150
+ - lib/fastlane/plugin/json_auth.rb
151
+ - lib/fastlane/plugin/json_auth/actions/download_json_action.rb
152
+ - lib/fastlane/plugin/json_auth/actions/merge_jsons_action.rb
153
+ - lib/fastlane/plugin/json_auth/actions/read_json_action.rb
154
+ - lib/fastlane/plugin/json_auth/actions/write_json_action.rb
155
+ - lib/fastlane/plugin/json_auth/helper/json_helper.rb
156
+ - lib/fastlane/plugin/json_auth/version.rb
157
157
  homepage: https://github.com/thangnc/fastlane-plugin-json_auth
158
158
  licenses:
159
159
  - MIT
@@ -1,5 +0,0 @@
1
- module Fastlane
2
- module Json
3
- VERSION = "1.2.1"
4
- end
5
- end