Class: Fastlane::Actions::RustoreGetAuthTokenAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::RustoreGetAuthTokenAction
- Defined in:
- lib/fastlane/plugin/rustore_sdk/actions/rustore_get_auth_token_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .output ⇒ Object
- .return_value ⇒ Object
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
41 42 43 |
# File 'lib/fastlane/plugin/rustore_sdk/actions/rustore_get_auth_token_action.rb', line 41 def self. ["apohodun"] end |
.available_options ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/fastlane/plugin/rustore_sdk/actions/rustore_get_auth_token_action.rb', line 49 def self. [ FastlaneCore::ConfigItem.new(key: :key_id, env_name: "RUSTORE_KEY_ID", description: "The ID of the private key from RuStore Console", default_value: ENV['RUSTORE_KEY_ID'] || CredentialsManager::AppfileConfig.try_fetch_value(:rustore_key_id), optional: false, type: String), FastlaneCore::ConfigItem.new(key: :private_key_path, env_name: "RUSTORE_PRIVATE_KEY_PATH", description: "Path to the RSA private key (.pem) file", default_value: ENV['RUSTORE_PRIVATE_KEY_PATH'] || CredentialsManager::AppfileConfig.try_fetch_value(:rustore_private_key_path), optional: true, type: String, conflicting_options: [:private_key_data]), FastlaneCore::ConfigItem.new(key: :private_key_data, env_name: "RUSTORE_PRIVATE_KEY_DATA", description: "The content of the RSA private key (.pem)", optional: true, type: String, sensitive: true, conflicting_options: [:private_key_path]) ] end |
.description ⇒ Object
37 38 39 |
# File 'lib/fastlane/plugin/rustore_sdk/actions/rustore_get_auth_token_action.rb', line 37 def self.description "Get RuStore Auth Token using RSA private key" end |
.is_supported?(platform) ⇒ Boolean
80 81 82 |
# File 'lib/fastlane/plugin/rustore_sdk/actions/rustore_get_auth_token_action.rb', line 80 def self.is_supported?(platform) [:android].include?(platform) end |
.output ⇒ Object
74 75 76 77 78 |
# File 'lib/fastlane/plugin/rustore_sdk/actions/rustore_get_auth_token_action.rb', line 74 def self.output [ ['RUSTORE_AUTH_TOKEN', 'The RuStore Auth Token'] ] end |
.return_value ⇒ Object
45 46 47 |
# File 'lib/fastlane/plugin/rustore_sdk/actions/rustore_get_auth_token_action.rb', line 45 def self.return_value "The RuStore Auth Token (JWE)" end |
.run(params) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/fastlane/plugin/rustore_sdk/actions/rustore_get_auth_token_action.rb', line 11 def self.run(params) key_id = params[:key_id] private_key_path = params[:private_key_path] private_key_data = params[:private_key_data] UI.("RuStore Auth Config:") UI.(" Key ID: #{key_id[0..3]}***") UI.(" Private Key Path: #{private_key_path}") if private_key_path UI.(" Private Key Data: [PROVIDED]") if private_key_data UI.user_error!("You must provide either 'private_key_path' or 'private_key_data' (or set RUSTORE_PRIVATE_KEY_PATH / RUSTORE_PRIVATE_KEY_DATA env vars)") if private_key_path.nil? && private_key_data.nil? UI.("Fetching auth token from RuStore...") token = Helper::RustoreSdkHelper.get_auth_token( key_id: key_id, private_key_path: private_key_path, private_key_data: private_key_data ) UI.success("Successfully obtained RuStore auth token") # Save token in shared_values for use in other actions Actions.lane_context[SharedValues::RUSTORE_AUTH_TOKEN] = token token end |