Class: Fastlane::Actions::BitwardenUnlockVaultAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/bitwarden/actions/bitwarden_unlock_vault.rb

Documentation collapse

Class Method Summary collapse

Class Method Details

.authorsObject



51
52
53
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_unlock_vault.rb', line 51

def self.authors
  ["[email protected]"]
end

.available_optionsObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_unlock_vault.rb', line 26

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :cli_path,
                                 env_name: "BW_CLI_PATH",
                                 optional: true,
                                 description: "Override path to the Bitwarden CLI"),
    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

.descriptionObject



18
19
20
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_unlock_vault.rb', line 18

def self.description
  "You can use this action to download an item's attachment from BitWarden."
end

.detailsObject



22
23
24
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_unlock_vault.rb', line 22

def self.details
  "You can use this action to download an item's attachment from BitWarden."
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_unlock_vault.rb', line 55

def self.is_supported?(platform)
  true
end

.outputObject



41
42
43
44
45
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_unlock_vault.rb', line 41

def self.output
  [
    ['BW_SESSION', 'The session token that Bitwarden returns']
  ]
end

.return_valueObject



47
48
49
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_unlock_vault.rb', line 47

def self.return_value
  "The BW_SESSION token"
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_unlock_vault.rb', line 4

def self.run(params)
  @helper = Helper::BitwardenHelper.new(params[:cli_path])
  password = params[:password]

  UI.message("Unlocking vault...")

  session = @helper.exec('unlock', password, '--raw')
  Actions.lane_context[SharedValues::BW_SESSION] = session
end