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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc1248f0ff34d8d0f74cafde4a839963d6d38bd73921bd7c5e8b02bd8b3fafeb
4
- data.tar.gz: 7a890cb66dbff3157e3e7a490e5cfd7b994a3b7d6dfbee860afa8adc61038da0
3
+ metadata.gz: 8a1fbbe97c9bb43345aa73b821b9a0f192bbd0f6820917923927377880f58b03
4
+ data.tar.gz: 40cf095bae9f86eb68015545991ccdcae9b2024851cb2e991d12c6f145cf68f8
5
5
  SHA512:
6
- metadata.gz: 2e97c2cc4f08ef9d3930305116c828e7b8fffb6a627958e502b1b9423e1cbe1b9505c06ec49d49d771cca353b371ee2aa4aa0f219f29c0cb90e41a028415f48f
7
- data.tar.gz: dc8b9b8cfdce10575df9bb157c5a464967e7082a18f71c30ddd2e7bbffcfda2f2265c091f1c65e4faf0683888c93f87078fb8e720cd2339d970c06c85c4302b5
6
+ metadata.gz: 6b1c43fd6f71064334580d10842a1e1b31904e769140124ea5bbca7f6111771c5611fc9e74e08e6b5039ee38e8a0996f020a0ae2abdccd2f0f9438273b2514b4
7
+ data.tar.gz: 32491201cbcc854397f498b7c7064d296fe4220396afdf46d3c9a600e58af1f0af8ba9a2b74a4127cc6d87639fb6e9320cf4173076f9bf9a03b9a675c83bdaa8
@@ -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)
@@ -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
- log_authorization_error_details(error) if debug
77
- UI.user_error!(ErrorMessage::REFRESH_TOKEN_ERROR)
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
- log_authorization_error_details(error) if debug
90
- UI.user_error!("#{ErrorMessage::SERVICE_CREDENTIALS_ERROR}: #{google_service_path}")
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
- def log_authorization_error_details(error)
94
- UI.error("Error fetching access token:")
95
- UI.error(error.message)
96
- UI.error("Response status: #{error.response.status}")
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
@@ -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. Service Account Path"
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."
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module FirebaseAppDistribution
3
- VERSION = "0.3.2"
3
+ VERSION = "0.3.3"
4
4
  end
5
5
  end
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.2
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: 2021-12-15 00:00:00.000000000 Z
13
+ date: 2022-03-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: pry