Skip to content

Commit

Permalink
improve password parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
egze committed Nov 3, 2024
1 parent 084b083 commit 689efb1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/kamal/secrets/adapters/enpass.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ def fetch_secret_titles(secrets)

def parse_result_and_take_secrets(unparsed_result, secrets)
unparsed_result.split("\n").reduce({}) do |acc, line|
title = line[/title:\s*(\w+)/, 1]
label = line[/label:\s*(.*?)\s{2}/, 1]
password = line[/password:\s*([^"]+)/, 1]
title = line[/title:\s{1}(\w+)/, 1]
label = line[/label:\s{1}(.*?)\s{2}/, 1]
password = line[/password:\s{1}([^"]+)/, 1]

if title && !password.to_s.empty?
key = label.nil? || label.empty? ? title : "#{title}/#{label}"
Expand Down

0 comments on commit 689efb1

Please sign in to comment.