ruby-pass-qt 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5bfcc8040db258bced9832227eab7678bb6f222c64807ee1807e65ddc1df6e1e
4
- data.tar.gz: f0fc47811dcdef53c4decee7048c299a19819359af7f95bc7c7620c7050f0a33
3
+ metadata.gz: ff7e9aec8abb1930464e918a319eb2e0356b5b01775a82577fb3fd04573baf77
4
+ data.tar.gz: b98a28691163b14373977108e3699e043d4ffbd095c5d07d5219d8024714c9d2
5
5
  SHA512:
6
- metadata.gz: 8556ac4347712e744affa4367e30fadea7776e2df53635b75ef6389917a7d7469572d3a067cbd72c0c5ec22a5cce78a00f02f8252a25722b8e62c1db97748733
7
- data.tar.gz: e399793e4c7ab17c38beb055d557af033a267c92790447c5bb6cbc0cab330a491163fc3a1db0a38a5bc9b82f605bf608e13272e26defc0fad5f8c880204ac3b2
6
+ metadata.gz: 18305f13b8ff16d87a22a4510c1ef62f8764eb86d036a5b924da34f8cb6540e9ae3fef83a3fe4d3161c45d518a6891ba9aa1ccb2dac4e4c6b8efaac37d2ea8ef
7
+ data.tar.gz: fb1591d11c18e8a79aa3a60f5312c3b9202029e6653e5223123a163a654d4f369d634b61bf191a3b28d0637e29e1d75df8a2f8cc321c56dd7b78a5435491386d
data/README.md CHANGED
@@ -6,13 +6,14 @@ A simple GUI for pass on Linux.
6
6
 
7
7
  - [Ruby 3.4+](https://www.ruby-lang.org/)
8
8
  - [Qt 6.10+](https://www.qt.io/)
9
- - [pass](https://www.passwordstore.org/)
10
- - [pwgen](https://sourceforge.net/projects/pwgen/)
9
+ - **one of the following password managers**
10
+ - [pass](https://www.passwordstore.org/) & [pwgen](https://sourceforge.net/projects/pwgen/)
11
+ - [gopass](https://github.com/gopasspw/gopass)
11
12
 
12
13
  ## Installation
13
14
 
14
15
  ```console
15
- $ gem install pass-qt
16
+ $ gem install ruby-pass-qt
16
17
  ```
17
18
 
18
19
  ## Usage
@@ -58,6 +58,9 @@ module PassQt
58
58
 
59
59
  entry_list = QDir.new(dir).entry_info_list(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot)
60
60
  entry_list.each do |entry|
61
+ next if entry.hidden?
62
+ next if entry.file_name.starts_with(".")
63
+
61
64
  filepath = entry.absolute_file_path
62
65
  next if @dataitems.key?(filepath)
63
66
 
@@ -44,7 +44,7 @@ module PassQt
44
44
 
45
45
  @passwordinput.set_echo_mode(QLineEdit::Password)
46
46
  Pass.pwgen(16, on_success: ->(data) {
47
- @passwordinput.set_text(data["stdout"].strip)
47
+ @passwordinput.set_text(data["stdout"].lines[0].strip)
48
48
  }, on_failure: ->(_) {})
49
49
 
50
50
  @usernamelabel = initialize_form_label("Username")
@@ -1,2 +1,3 @@
1
1
  QApplication.set_organization_name("souk4711")
2
2
  QApplication.set_application_name("PassQt")
3
+ QApplication.set_window_icon(QIcon.from_theme("pass-qt"))
@@ -0,0 +1,21 @@
1
+ module Pass
2
+ module Clients
3
+ class GoPass < ::Pass::Clients::Pass
4
+ def initialize
5
+ @program = "gopass"
6
+ end
7
+
8
+ def otp_insert(store, passname, password, on_success:, on_failure:)
9
+ arguments = QStringList.new << "insert" << passname
10
+ stdin = password
11
+ envs = {PASSWORD_STORE_DIR: store}
12
+ Contrib::Process.execute(@program, arguments, stdin:, envs:, on_success:, on_failure:)
13
+ end
14
+
15
+ def pwgen(pw_length, on_success:, on_failure:)
16
+ arguments = QStringList.new << "pwgen" << "-By1" << pw_length.to_s
17
+ Contrib::Process.execute(@program, arguments, on_success:, on_failure:)
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,40 @@
1
+ module Pass
2
+ module Clients
3
+ class Pass
4
+ def initialize
5
+ @program = "pass"
6
+ end
7
+
8
+ def show(store, passname, on_success:, on_failure:)
9
+ arguments = QStringList.new << "show" << passname
10
+ envs = {PASSWORD_STORE_DIR: store}
11
+ Contrib::Process.execute(@program, arguments, envs:, on_success:, on_failure:)
12
+ end
13
+
14
+ def insert(store, passname, password, extra, on_success:, on_failure:)
15
+ arguments = QStringList.new << "insert" << "-m" << passname
16
+ stdin = "#{password}\n#{extra}"
17
+ envs = {PASSWORD_STORE_DIR: store}
18
+ Contrib::Process.execute(@program, arguments, stdin:, envs:, on_success:, on_failure:)
19
+ end
20
+
21
+ def otp(store, passname, on_success:, on_failure:)
22
+ arguments = QStringList.new << "otp" << passname
23
+ envs = {PASSWORD_STORE_DIR: store}
24
+ Contrib::Process.execute(@program, arguments, envs:, on_success:, on_failure:)
25
+ end
26
+
27
+ def otp_insert(store, passname, password, on_success:, on_failure:)
28
+ arguments = QStringList.new << "otp" << "insert" << passname
29
+ stdin = password
30
+ envs = {PASSWORD_STORE_DIR: store}
31
+ Contrib::Process.execute(@program, arguments, stdin:, envs:, on_success:, on_failure:)
32
+ end
33
+
34
+ def pwgen(pw_length, on_success:, on_failure:)
35
+ arguments = QStringList.new << "-cnysB" << pw_length.to_s << "1"
36
+ Contrib::Process.execute("pwgen", arguments, on_success:, on_failure:)
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,2 @@
1
+ require_relative "clients/pass"
2
+ require_relative "clients/gopass"
@@ -1,32 +1,37 @@
1
+ require_relative "pass/clients"
2
+
1
3
  module Pass
2
4
  def self.show(store, passname, on_success:, on_failure:)
3
- arguments = QStringList.new << "show" << passname
4
- envs = {PASSWORD_STORE_DIR: store}
5
- Contrib::Process.execute("pass", arguments, envs:, on_success:, on_failure:)
5
+ client.show(store, passname, on_success:, on_failure:)
6
6
  end
7
7
 
8
8
  def self.insert(store, passname, password, extra, on_success:, on_failure:)
9
- arguments = QStringList.new << "insert" << "-m" << passname
10
- stdin = "#{password}\n#{extra}"
11
- envs = {PASSWORD_STORE_DIR: store}
12
- Contrib::Process.execute("pass", arguments, stdin:, envs:, on_success:, on_failure:)
9
+ client.insert(store, passname, password, extra, on_success:, on_failure:)
13
10
  end
14
11
 
15
12
  def self.otp(store, passname, on_success:, on_failure:)
16
- arguments = QStringList.new << "otp" << passname
17
- envs = {PASSWORD_STORE_DIR: store}
18
- Contrib::Process.execute("pass", arguments, envs:, on_success:, on_failure:)
13
+ client.otp(store, passname, on_success:, on_failure:)
19
14
  end
20
15
 
21
16
  def self.otp_insert(store, passname, password, on_success:, on_failure:)
22
- arguments = QStringList.new << "otp" << "insert" << passname
23
- stdin = password
24
- envs = {PASSWORD_STORE_DIR: store}
25
- Contrib::Process.execute("pass", arguments, stdin:, envs:, on_success:, on_failure:)
17
+ client.otp_insert(store, passname, password, on_success:, on_failure:)
26
18
  end
27
19
 
28
20
  def self.pwgen(pw_length, on_success:, on_failure:)
29
- arguments = QStringList.new << "-cnysB" << pw_length.to_s << "1"
30
- Contrib::Process.execute("pwgen", arguments, on_success:, on_failure:)
21
+ client.pwgen(pw_length, on_success:, on_failure:)
22
+ end
23
+
24
+ def self.client
25
+ @client ||= lambda do
26
+ [
27
+ ["pass", ::Pass::Clients::Pass],
28
+ ["gopass", ::Pass::Clients::GoPass]
29
+ ].each do |program, klass|
30
+ r = QProcess.execute(program, QStringList.new << "--version")
31
+ return klass.new if r.zero?
32
+ end
33
+
34
+ ::Pass::Clients::Pass.new
35
+ end.call
31
36
  end
32
37
  end
@@ -1,3 +1,3 @@
1
1
  module PassQt
2
- VERSION = "1.0.0"
2
+ VERSION = "2.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-pass-qt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Doe
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 2.1.0
18
+ version: 6.0.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: 2.1.0
25
+ version: 6.0.0
26
26
  description: A simple GUI for pass on Linux.
27
27
  email:
28
28
  - johndoe@example.com
@@ -55,6 +55,9 @@ files:
55
55
  - lib/pass-qt/lib/contrib.rb
56
56
  - lib/pass-qt/lib/contrib/process.rb
57
57
  - lib/pass-qt/lib/pass.rb
58
+ - lib/pass-qt/lib/pass/clients.rb
59
+ - lib/pass-qt/lib/pass/clients/gopass.rb
60
+ - lib/pass-qt/lib/pass/clients/pass.rb
58
61
  - lib/pass-qt/version.rb
59
62
  - screenshot.png
60
63
  homepage: https://github.com/souk4711/ruby-pass-qt