From ca55a4de574d2af35dba26fd268ed369bb9ca3c0 Mon Sep 17 00:00:00 2001 From: Calvin Leung Huang Date: Thu, 14 Apr 2016 11:30:55 -0400 Subject: [PATCH] Set fieldlabel default to Password --- lib/zanzibar.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/zanzibar.rb b/lib/zanzibar.rb index 9805e2c..2813bb6 100644 --- a/lib/zanzibar.rb +++ b/lib/zanzibar.rb @@ -116,9 +116,9 @@ module Zanzibar ## Retrieve the value from a field label of a secret # Will raise an error if there are any issues # @param [Integer] the secret id - # @param [String] the field label to get + # @param [String] the field label to get, defaults to Password # @return [String] the value for the given field label - def get_fieldlabel_value(scrt_id, fieldlabel) + def get_fieldlabel_value(scrt_id, fieldlabel = 'Password') secret = get_secret(scrt_id) secret_items = secret[:secret][:items][:secret_item] return get_secret_item_by_field_name(secret_items, fieldlabel)[:value] @@ -132,7 +132,7 @@ module Zanzibar # @return [String] the password for the given secret def get_password(scrt_id) - return get_fieldlabel_value(scrt_id, 'Password') + return get_fieldlabel_value(scrt_id) end ## Get the password, save it to a file, and return the path to the file.