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 +4 -4
- data/lib/fastlane/plugin/{json → json_auth}/actions/download_json_action.rb +25 -5
- data/lib/fastlane/plugin/{json → json_auth}/actions/merge_jsons_action.rb +0 -0
- data/lib/fastlane/plugin/{json → json_auth}/actions/read_json_action.rb +0 -0
- data/lib/fastlane/plugin/{json → json_auth}/actions/write_json_action.rb +0 -0
- data/lib/fastlane/plugin/{json → json_auth}/helper/json_helper.rb +0 -0
- data/lib/fastlane/plugin/json_auth/version.rb +5 -0
- data/lib/fastlane/plugin/{json.rb → json_auth.rb} +3 -3
- metadata +8 -8
- data/lib/fastlane/plugin/json/version.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6469b9dfb73efec55fb738b52e312b328e7ce75bc7d1b46c8cc014e224416ef
|
4
|
+
data.tar.gz: 85b9216604000b2db974d569b6036427221842cbae7ec4eda0debf0fcb250a93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
22
|
-
|
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)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,7 +1,7 @@
|
|
1
|
-
require 'fastlane/plugin/
|
1
|
+
require 'fastlane/plugin/json_auth/version'
|
2
2
|
|
3
3
|
module Fastlane
|
4
|
-
module
|
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::
|
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.
|
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/
|
151
|
-
- lib/fastlane/plugin/
|
152
|
-
- lib/fastlane/plugin/
|
153
|
-
- lib/fastlane/plugin/
|
154
|
-
- lib/fastlane/plugin/
|
155
|
-
- lib/fastlane/plugin/
|
156
|
-
- lib/fastlane/plugin/
|
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
|