Class: Fastlane::Actions::ReadItemFromKeychainAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::ReadItemFromKeychainAction
- Defined in:
- lib/fastlane/plugin/secret_keeper/actions/read_item_from_keychain_action.rb
Class Method Summary collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .return_value ⇒ Object
- .run(params) ⇒ Object
Class Method Details
.authors ⇒ Object
23 24 25 |
# File 'lib/fastlane/plugin/secret_keeper/actions/read_item_from_keychain_action.rb', line 23 def self. ["Daniel Jankowski"] end |
.available_options ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'lib/fastlane/plugin/secret_keeper/actions/read_item_from_keychain_action.rb', line 31 def self. [ FastlaneCore::ConfigItem.new(key: :item_name, env_name: "SECRET_KEEPER_ITEM_NAME", description: "Item name for a given password stored in the keychain", optional: false, type: String) ] end |
.description ⇒ Object
19 20 21 |
# File 'lib/fastlane/plugin/secret_keeper/actions/read_item_from_keychain_action.rb', line 19 def self.description "Reads the password from the keychain for a given item" end |
.is_supported?(platform) ⇒ Boolean
41 42 43 |
# File 'lib/fastlane/plugin/secret_keeper/actions/read_item_from_keychain_action.rb', line 41 def self.is_supported?(platform) true end |
.return_value ⇒ Object
27 28 29 |
# File 'lib/fastlane/plugin/secret_keeper/actions/read_item_from_keychain_action.rb', line 27 def self.return_value "Returns password as a plain text" end |
.run(params) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/fastlane/plugin/secret_keeper/actions/read_item_from_keychain_action.rb', line 6 def self.run(params) item_name = params[:item_name] item = Security::InternetPassword.find(server: item_name) if item UI.success("Sucessfully read an item from the keychain 🎉") return item.password else UI.error("Could not read an item from the keychain. Please make sure '#{item_name}' item exists in the keychain ❌") return nil end end |