Skip to content

Commit

Permalink
Merge pull request #1596 from himdel/gapri-custom-attr
Browse files Browse the repository at this point in the history
Don't redact custom attributes
  • Loading branch information
martinpovolny authored Aug 17, 2017
2 parents 151e5bc + f3cb9b1 commit 847706d
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions app/helpers/ems_container_helper/textual_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,25 +120,9 @@ def textual_group_miq_custom_attributes
TextualGroup.new(_("Custom Attributes"), textual_miq_custom_attributes)
end

def redact_username_and_password(value)
begin
uri = URI.parse(value)
uri.password = '***' if uri.password
uri.user = '***' if uri.user
uri.to_s
rescue # dont reduct in case the value was malformed, to allow debugging it.
value
end
end

def textual_miq_custom_attributes
attrs = @record.custom_attributes
return nil if attrs.blank?
attrs.sort_by(&:name).collect do |a|
{
:label => a.name.tr("_", " "),
:value => redact_username_and_password(a.value)
}
end
attrs.sort_by(&:name).collect { |a| {:label => a.name.tr("_", " "), :value => a.value} }
end
end

0 comments on commit 847706d

Please sign in to comment.