Class: Fastlane::Actions::BitwardenGetObjectAction

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

Documentation collapse

Class Method Summary collapse

Class Method Details

.authorsObject



72
73
74
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_get_object.rb', line 72

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

.available_optionsObject



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_get_object.rb', line 42

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: :object_type,
                                 description: "Type of the object to get (collection, item, etc.)",
                                 verify_block: proc do |value|
                                   UI.user_error!("No object type provided to the Bitwarden Get Object Action`") unless value && !value.empty?
                                 end),
    FastlaneCore::ConfigItem.new(key: :args,
                                 description: "Other arguments (hash)",
                                 type: Hash,
                                 optional: true),
    FastlaneCore::ConfigItem.new(key: :str_args,
                                 description: "Other arguments (string)",
                                 optional: true)
  ]
end

.descriptionObject



34
35
36
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_get_object.rb', line 34

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

.detailsObject



38
39
40
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_get_object.rb', line 38

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

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


76
77
78
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_get_object.rb', line 76

def self.is_supported?(platform)
  true
end

.outputObject



63
64
65
66
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_get_object.rb', line 63

def self.output
  [
  ]
end

.return_valueObject



68
69
70
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_get_object.rb', line 68

def self.return_value
  "The resulting object"
end

.run(params) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/fastlane/plugin/bitwarden/actions/bitwarden_get_object.rb', line 10

def self.run(params)
  @helper = Helper::BitwardenHelper.new(params[:cli_path])
  object_type = params[:object_type]
  other_args = params[:args] || {}
  str_args = params[:str_args] || ""

  args = ['get', object_type]

  args.push(str_args)

  other_args.each do |key, value|
    args.push(key.to_s)
    args.push(value)
  end

  args.push('--raw')

  @helper.exec(*args)
end