fastlane-plugin-firebase_app_distribution 0.3.2 → 0.3.3
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/firebase_app_distribution/actions/firebase_app_distribution_action.rb +4 -0
- data/lib/fastlane/plugin/firebase_app_distribution/helper/firebase_app_distribution_auth_client.rb +34 -8
- data/lib/fastlane/plugin/firebase_app_distribution/helper/firebase_app_distribution_error_message.rb +1 -1
- data/lib/fastlane/plugin/firebase_app_distribution/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a1fbbe97c9bb43345aa73b821b9a0f192bbd0f6820917923927377880f58b03
|
4
|
+
data.tar.gz: 40cf095bae9f86eb68015545991ccdcae9b2024851cb2e991d12c6f145cf68f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b1c43fd6f71064334580d10842a1e1b31904e769140124ea5bbca7f6111771c5611fc9e74e08e6b5039ee38e8a0996f020a0ae2abdccd2f0f9438273b2514b4
|
7
|
+
data.tar.gz: 32491201cbcc854397f498b7c7064d296fe4220396afdf46d3c9a600e58af1f0af8ba9a2b74a4127cc6d87639fb6e9320cf4173076f9bf9a03b9a675c83bdaa8
|
data/lib/fastlane/plugin/firebase_app_distribution/actions/firebase_app_distribution_action.rb
CHANGED
@@ -18,6 +18,10 @@ module Fastlane
|
|
18
18
|
def self.run(params)
|
19
19
|
params.values # to validate all inputs before looking for the ipa/apk/aab
|
20
20
|
|
21
|
+
if params[:debug]
|
22
|
+
UI.important("Warning: Debug logging enabled. Output may include sensitive information.")
|
23
|
+
end
|
24
|
+
|
21
25
|
app_id = app_id_from_params(params)
|
22
26
|
app_name = app_name_from_app_id(app_id)
|
23
27
|
platform = lane_platform || platform_from_app_id(app_id)
|
data/lib/fastlane/plugin/firebase_app_distribution/helper/firebase_app_distribution_auth_client.rb
CHANGED
@@ -4,6 +4,8 @@ module Fastlane
|
|
4
4
|
module Auth
|
5
5
|
module FirebaseAppDistributionAuthClient
|
6
6
|
TOKEN_CREDENTIAL_URI = "https://oauth2.googleapis.com/token"
|
7
|
+
REDACTION_EXPOSED_LENGTH = 5
|
8
|
+
REDACTION_CHARACTER = "X"
|
7
9
|
|
8
10
|
# Returns the auth token for any of the auth methods (Firebase CLI token,
|
9
11
|
# Google service account, firebase-tools). To ensure that a specific
|
@@ -73,8 +75,14 @@ module Fastlane
|
|
73
75
|
client.fetch_access_token!
|
74
76
|
client.access_token
|
75
77
|
rescue Signet::AuthorizationError => error
|
76
|
-
|
77
|
-
|
78
|
+
error_message = ErrorMessage::REFRESH_TOKEN_ERROR
|
79
|
+
if debug
|
80
|
+
error_message += "\nRefresh token used: #{format_token(refresh_token)}\n"
|
81
|
+
error_message += error_details(error)
|
82
|
+
else
|
83
|
+
error_message += " #{debug_instructions}"
|
84
|
+
end
|
85
|
+
UI.user_error!(error_message)
|
78
86
|
end
|
79
87
|
|
80
88
|
def service_account(google_service_path, debug)
|
@@ -86,14 +94,32 @@ module Fastlane
|
|
86
94
|
rescue Errno::ENOENT
|
87
95
|
UI.user_error!("#{ErrorMessage::SERVICE_CREDENTIALS_NOT_FOUND}: #{google_service_path}")
|
88
96
|
rescue Signet::AuthorizationError => error
|
89
|
-
|
90
|
-
|
97
|
+
error_message = "#{ErrorMessage::SERVICE_CREDENTIALS_ERROR}: \"#{google_service_path}\""
|
98
|
+
if debug
|
99
|
+
error_message += "\n#{error_details(error)}"
|
100
|
+
else
|
101
|
+
error_message += ". #{debug_instructions}"
|
102
|
+
end
|
103
|
+
UI.user_error!(error_message)
|
104
|
+
end
|
105
|
+
|
106
|
+
def error_details(error)
|
107
|
+
"#{error.message}\nResponse status: #{error.response.status}"
|
108
|
+
end
|
109
|
+
|
110
|
+
def debug_instructions
|
111
|
+
"For more information, try again with firebase_app_distribution's \"debug\" parameter set to \"true\"."
|
91
112
|
end
|
92
113
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
114
|
+
# Formats and redacts a token for printing out during debug logging. Examples:
|
115
|
+
# 'abcd' -> '"abcd"''
|
116
|
+
# 'abcdef1234' -> '"XXXXXf1234" (redacted)'
|
117
|
+
def format_token(str)
|
118
|
+
redaction_notice = str.length > REDACTION_EXPOSED_LENGTH ? " (redacted)" : ""
|
119
|
+
exposed_start_char = [str.length - REDACTION_EXPOSED_LENGTH, 0].max
|
120
|
+
exposed_characters = str[exposed_start_char, REDACTION_EXPOSED_LENGTH]
|
121
|
+
redacted_characters = REDACTION_CHARACTER * [str.length - REDACTION_EXPOSED_LENGTH, 0].max
|
122
|
+
"\"#{redacted_characters}#{exposed_characters}\"#{redaction_notice}"
|
97
123
|
end
|
98
124
|
end
|
99
125
|
end
|
data/lib/fastlane/plugin/firebase_app_distribution/helper/firebase_app_distribution_error_message.rb
CHANGED
@@ -13,7 +13,7 @@ module ErrorMessage
|
|
13
13
|
INVALID_PATH = "Could not read content from"
|
14
14
|
INVALID_TESTERS = "Could not enable access for testers. Check that the groups exist and the tester emails are formatted correctly"
|
15
15
|
INVALID_RELEASE_NOTES = "Failed to add release notes"
|
16
|
-
SERVICE_CREDENTIALS_ERROR = "App Distribution could not generate credentials from the service credentials file specified
|
16
|
+
SERVICE_CREDENTIALS_ERROR = "App Distribution could not generate credentials from the service credentials file specified"
|
17
17
|
PLAY_ACCOUNT_NOT_LINKED = "This project is not linked to a Google Play account."
|
18
18
|
APP_NOT_PUBLISHED = "This app is not published in the Google Play console."
|
19
19
|
NO_APP_WITH_GIVEN_BUNDLE_ID_IN_PLAY_ACCOUNT = "App with matching package name does not exist in Google Play."
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-firebase_app_distribution
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Natchev
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2022-03-22 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: pry
|