Class: Fastlane::Actions::BitwardenLoginAction
- Inherits:
-
Action
- Object
- Action
- Fastlane::Actions::BitwardenLoginAction
- Defined in:
- lib/fastlane/plugin/bitwarden/actions/bitwarden_login.rb
Documentation collapse
- .authors ⇒ Object
- .available_options ⇒ Object
- .description ⇒ Object
- .details ⇒ Object
- .is_supported?(platform) ⇒ Boolean
- .output ⇒ Object
- .return_value ⇒ Object
Class Method Summary collapse
Class Method Details
.authors ⇒ Object
77 78 79 |
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_login.rb', line 77 def self. ["[email protected]"] end |
.available_options ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_login.rb', line 38 def self. [ FastlaneCore::ConfigItem.new(key: :cli_path, env_name: "BW_CLI_PATH", optional: true, description: "Override path to the Bitwarden CLI"), FastlaneCore::ConfigItem.new(key: :server_url, env_name: "BW_SERVER_URL", description: "Server URL use when signing in to Bitwarden", default_value: "https://bitwarden.com", verify_block: proc do |value| UI.user_error!("No Server URL provided to the Bitwarden Login Action, pass it like so: `server_url: '<...server_url...>'`") unless value && !value.empty? end), FastlaneCore::ConfigItem.new(key: :email, env_name: "BW_EMAIL", description: "Email to use when signing in to Bitwarden", verify_block: proc do |value| UI.user_error!("No Email provided to the Bitwarden Login Action, pass it like so: `email: '<...email...>'`") unless value && !value.empty? end), FastlaneCore::ConfigItem.new(key: :password, env_name: "BW_PASSWORD", description: "Master Password to use when signing in to Bitwarden", verify_block: proc do |value| UI.user_error!("No Password provided to the Bitwarden Login Action `email: '<...email...>'`") unless value && !value.empty? end) ] end |
.bw_login(result) ⇒ Object
12 13 14 15 |
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_login.rb', line 12 def self.bw_login(result) session = @helper.exec('login', @email, @password, '--raw') Actions.lane_context[SharedValues::BW_SESSION] = session end |
.description ⇒ Object
30 31 32 |
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_login.rb', line 30 def self.description "You can use this action to login to BitWarden and unlock the vault." end |
.details ⇒ Object
34 35 36 |
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_login.rb', line 34 def self.details "You can use this action to login to BitWarden and unlock the vault." end |
.ensure_login ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_login.rb', line 4 def self.ensure_login UI.("Logging in to " + @server_url) @helper.exec('config', 'server', @server_url) UI.("Checking login") @helper.exec('login', '--check', error_callback: method(:bw_login)) Actions::BitwardenUnlockVaultAction.run(cli_path: @cli_path, password: @password) end |
.is_supported?(platform) ⇒ Boolean
81 82 83 |
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_login.rb', line 81 def self.is_supported?(platform) true end |
.output ⇒ Object
67 68 69 70 71 |
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_login.rb', line 67 def self.output [ ['BW_SESSION', 'The session token that Bitwarden returns'] ] end |
.return_value ⇒ Object
73 74 75 |
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_login.rb', line 73 def self.return_value "The BW_SESSION token" end |
.run(params) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_login.rb', line 17 def self.run(params) @cli_path = params[:cli_path] @server_url = params[:server_url] @email = params[:email] @password = params[:password] @helper = Helper::BitwardenHelper.new(@cli_path) self.ensure_login end |