Module: Fastlane::Auth::FirebaseAppDistributionAuthClient
- Included in:
- Fastlane::Actions::FirebaseAppDistributionAction, Fastlane::Actions::FirebaseAppDistributionAddTestersAction, Fastlane::Actions::FirebaseAppDistributionCreateGroupAction, Fastlane::Actions::FirebaseAppDistributionDeleteGroupAction, Fastlane::Actions::FirebaseAppDistributionGetLatestReleaseAction, Fastlane::Actions::FirebaseAppDistributionGetUdidsAction, Fastlane::Actions::FirebaseAppDistributionRemoveTestersAction
- Defined in:
- lib/fastlane/plugin/firebase_app_distribution/helper/firebase_app_distribution_auth_client.rb
Constant Summary collapse
- TOKEN_CREDENTIAL_URI =
"https://oauth2.googleapis.com/token"- REDACTION_EXPOSED_LENGTH =
5- REDACTION_CHARACTER =
"X"- SCOPE =
"https://www.googleapis.com/auth/cloud-platform"- CLIENT_ID =
In this type of application, the client secret is not treated as a secret. See: developers.google.com/identity/protocols/OAuth2InstalledApp
"563584335869-fgrhgmd47bqnekij5i8b5pr03ho849e6.apps.googleusercontent.com"- CLIENT_SECRET =
"j9iVZfS8kkCEFUPaAeJV0sAi"
Instance Method Summary collapse
-
#get_authorization(google_service_path, firebase_cli_token, debug = false) ⇒ Object
Returns an authorization object for any of the auth methods (Firebase CLI token, Application Default Credentials, firebase-tools).
Instance Method Details
#get_authorization(google_service_path, firebase_cli_token, debug = false) ⇒ Object
Returns an authorization object for any of the auth methods (Firebase CLI token, Application Default Credentials, firebase-tools). To ensure that a specific auth method is used, unset all other auth variables/parameters to nil/empty
args
google_service_path - Absolute path to the Google service account file
firebase_cli_token - Refresh token
debug - Whether to enable debug-level logging
env variables
FIREBASE_TOKEN - see firebase_cli_token
Crashes if given invalid or missing credentials
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/fastlane/plugin/firebase_app_distribution/helper/firebase_app_distribution_auth_client.rb', line 31 def (google_service_path, firebase_cli_token, debug = false) if !google_service_path.nil? && !google_service_path.empty? UI.("🔐 Authenticating with --service_credentials_file path parameter: #{google_service_path}") service_account(google_service_path, debug) elsif !firebase_cli_token.nil? && !firebase_cli_token.empty? UI.("🔐 Authenticating with --firebase_cli_token parameter") firebase_token(firebase_cli_token, debug) elsif !ENV["FIREBASE_TOKEN"].nil? && !ENV["FIREBASE_TOKEN"].empty? UI.("🔐 Authenticating with FIREBASE_TOKEN environment variable") firebase_token(ENV["FIREBASE_TOKEN"], debug) elsif !application_default_creds.nil? UI.("🔐 Authenticating with Application Default Credentials") application_default_creds elsif (refresh_token = refresh_token_from_firebase_tools) UI.("🔐 No authentication method found. Using cached Firebase CLI credentials.") firebase_token(refresh_token, debug) else UI.user_error!(ErrorMessage::MISSING_CREDENTIALS) nil end end |