keepassx 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +7 -6
- data/.travis.yml +9 -11
- data/Gemfile +0 -2
- data/README.md +2 -0
- data/Rakefile +9 -0
- data/bin/_guard-core +29 -0
- data/bin/guard +29 -0
- data/bin/rake +29 -0
- data/bin/rspec +29 -0
- data/bin/rubocop +29 -0
- data/keepassx.gemspec +8 -4
- data/lib/keepassx.rb +4 -12
- data/lib/keepassx/aes_crypt.rb +4 -4
- data/lib/keepassx/database/loader.rb +2 -2
- data/lib/keepassx/field.rb +6 -0
- data/lib/keepassx/field/base.rb +5 -7
- data/lib/keepassx/header.rb +7 -7
- data/lib/keepassx/version.rb +13 -1
- data/spec/keepassx/database_spec.rb +1 -1
- data/spec/keepassx/entry_spec.rb +1 -1
- data/spec/keepassx/group_spec.rb +1 -1
- data/spec/{keepassx_spec.rb → keepassx/keepassx_spec.rb} +1 -1
- data/spec/spec_helper.rb +22 -26
- data/spec/{factories.rb → support/factories.rb} +2 -2
- metadata +37 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 945653f35de55b69816fd7a44a8fb29503ca416421aae21983b99857c0cec77e
|
4
|
+
data.tar.gz: f2f25e59e94c62177fe91745936307c273bf5295dcfbbf8625629013e09d679a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef0e360a5c586f67510b795031d29fc6f9d4d9744364e68affe7ca5ad56e485a7dae14c18795b175f1b8f457c523e593ce2b67598af0befe79b8a47f2beb1986
|
7
|
+
data.tar.gz: 978a3be71d215349828300832a47e795afad02140056fee41e3ff89c34e1bf3932c6e31cca655f144a971ad9a4435abe86b078ea0e7091ef0312178d7f788c5c
|
data/.rubocop.yml
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
AllCops:
|
2
|
-
TargetRubyVersion: 2.
|
2
|
+
TargetRubyVersion: 2.5
|
3
3
|
Exclude:
|
4
|
+
- bin/*
|
4
5
|
- spec/**/*
|
5
6
|
|
6
|
-
Documentation:
|
7
|
+
Style/Documentation:
|
7
8
|
Enabled: false
|
8
9
|
|
9
|
-
Layout/
|
10
|
+
Layout/HashAlignment:
|
10
11
|
Enabled: false
|
11
12
|
|
12
13
|
Layout/EmptyLines:
|
@@ -25,12 +26,12 @@ Layout/EmptyLineBetweenDefs:
|
|
25
26
|
Enabled: false
|
26
27
|
|
27
28
|
Layout/IndentationConsistency:
|
28
|
-
EnforcedStyle:
|
29
|
+
EnforcedStyle: indented_internal_methods
|
29
30
|
|
30
|
-
|
31
|
+
Layout/LineLength:
|
31
32
|
Enabled: false
|
32
33
|
|
33
|
-
Metrics/
|
34
|
+
Metrics/AbcSize:
|
34
35
|
Enabled: false
|
35
36
|
|
36
37
|
Metrics/MethodLength:
|
data/.travis.yml
CHANGED
@@ -1,14 +1,12 @@
|
|
1
|
+
---
|
2
|
+
os: linux
|
3
|
+
dist: xenial
|
4
|
+
|
1
5
|
language: ruby
|
2
6
|
cache: bundler
|
3
|
-
sudo: false
|
4
7
|
rvm:
|
5
|
-
- 2.
|
6
|
-
- 2.
|
7
|
-
- 2.
|
8
|
-
-
|
9
|
-
- jruby-9.2.
|
10
|
-
before_install:
|
11
|
-
- gem update --system
|
12
|
-
- gem install bundler --no-document
|
13
|
-
after_success:
|
14
|
-
- bundle exec codeclimate-test-reporter
|
8
|
+
- 2.7.1
|
9
|
+
- 2.6.6
|
10
|
+
- 2.5.8
|
11
|
+
- ruby-head
|
12
|
+
- jruby-9.2.11.0
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
[![GitHub license](https://img.shields.io/github/license/pitluga/keepassx.svg)](https://github.com/pitluga/keepassx/blob/master/LICENSE)
|
4
4
|
[![GitHub release](https://img.shields.io/github/release/pitluga/keepassx.svg)](https://github.com/pitluga/keepassx/releases/latest)
|
5
|
+
[![Gem](https://img.shields.io/gem/v/keepassx.svg)](https://rubygems.org/gems/keepassx)
|
6
|
+
[![Gem](https://img.shields.io/gem/dtv/keepassx.svg)](https://rubygems.org/gems/keepassx)
|
5
7
|
[![Build Status](https://travis-ci.org/pitluga/keepassx.svg?branch=master)](https://travis-ci.org/pitluga/keepassx)
|
6
8
|
|
7
9
|
### A Ruby library to read and write [KeePassX](http://www.keepassx.org/) databases.
|
data/Rakefile
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'bundler/gem_tasks'
|
3
4
|
require 'rspec/core/rake_task'
|
4
5
|
|
5
6
|
RSpec::Core::RakeTask.new(:spec)
|
6
7
|
task default: :spec
|
8
|
+
|
9
|
+
task :console do
|
10
|
+
require 'pry'
|
11
|
+
require 'keepassx'
|
12
|
+
puts 'Loaded KeepassX'
|
13
|
+
ARGV.clear
|
14
|
+
Pry.start
|
15
|
+
end
|
data/bin/_guard-core
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application '_guard-core' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("guard", "_guard-core")
|
data/bin/guard
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'guard' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("guard", "guard")
|
data/bin/rake
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rake' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("rake", "rake")
|
data/bin/rspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rspec' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("rspec-core", "rspec")
|
data/bin/rubocop
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rubocop' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("rubocop", "rubocop")
|
data/keepassx.gemspec
CHANGED
@@ -4,7 +4,7 @@ require_relative 'lib/keepassx/version'
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = 'keepassx'
|
7
|
-
s.version = Keepassx::VERSION
|
7
|
+
s.version = Keepassx::VERSION::STRING
|
8
8
|
s.authors = ['Tony Pitluga', 'Paul Hinze']
|
9
9
|
s.email = ['tony.pitluga@gmail.com', 'paul.t.hinze@gmail.com']
|
10
10
|
s.homepage = 'http://github.com/pitluga/keepassx'
|
@@ -12,13 +12,17 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.description = 'See http://github.com/pitluga/keepassx'
|
13
13
|
s.license = 'MIT'
|
14
14
|
|
15
|
+
s.required_ruby_version = '>= 2.5.0'
|
16
|
+
|
15
17
|
s.files = `git ls-files`.split("\n")
|
16
18
|
|
19
|
+
s.add_runtime_dependency 'zeitwerk'
|
20
|
+
|
17
21
|
s.add_development_dependency 'factory_bot'
|
18
|
-
s.add_development_dependency 'guard'
|
19
22
|
s.add_development_dependency 'guard-rspec'
|
20
|
-
s.add_development_dependency 'rake'
|
23
|
+
s.add_development_dependency 'rake'
|
21
24
|
s.add_development_dependency 'respect'
|
22
25
|
s.add_development_dependency 'rspec'
|
23
|
-
s.add_development_dependency '
|
26
|
+
s.add_development_dependency 'rubocop'
|
27
|
+
s.add_development_dependency 'simplecov', '~> 0.17.1'
|
24
28
|
end
|
data/lib/keepassx.rb
CHANGED
@@ -7,18 +7,10 @@ require 'securerandom'
|
|
7
7
|
require 'digest/sha2'
|
8
8
|
require 'yaml'
|
9
9
|
|
10
|
-
require '
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
require 'keepassx/field/base'
|
15
|
-
require 'keepassx/field/entry'
|
16
|
-
require 'keepassx/field/group'
|
17
|
-
require 'keepassx/fieldable'
|
18
|
-
require 'keepassx/entry'
|
19
|
-
require 'keepassx/group'
|
20
|
-
require 'keepassx/header'
|
21
|
-
require 'keepassx/aes_crypt'
|
10
|
+
require 'zeitwerk'
|
11
|
+
loader = Zeitwerk::Loader.for_gem
|
12
|
+
loader.inflector.inflect 'aes_crypt' => 'AESCrypt'
|
13
|
+
loader.setup
|
22
14
|
|
23
15
|
module Keepassx
|
24
16
|
class << self
|
data/lib/keepassx/aes_crypt.rb
CHANGED
@@ -4,7 +4,7 @@ module Keepassx
|
|
4
4
|
module AESCrypt
|
5
5
|
module_function
|
6
6
|
|
7
|
-
# rubocop:disable Naming/
|
7
|
+
# rubocop:disable Naming/MethodParameterName
|
8
8
|
def decrypt(encrypted_data, key, iv, cipher_type)
|
9
9
|
aes = OpenSSL::Cipher.new(cipher_type)
|
10
10
|
aes.decrypt
|
@@ -12,10 +12,10 @@ module Keepassx
|
|
12
12
|
aes.iv = iv unless iv.nil?
|
13
13
|
aes.update(encrypted_data) + aes.final
|
14
14
|
end
|
15
|
-
# rubocop:enable Naming/
|
15
|
+
# rubocop:enable Naming/MethodParameterName
|
16
16
|
|
17
17
|
|
18
|
-
# rubocop:disable Naming/
|
18
|
+
# rubocop:disable Naming/MethodParameterName
|
19
19
|
def encrypt(data, key, iv, cipher_type)
|
20
20
|
aes = OpenSSL::Cipher.new(cipher_type)
|
21
21
|
aes.encrypt
|
@@ -23,7 +23,7 @@ module Keepassx
|
|
23
23
|
aes.iv = iv unless iv.nil?
|
24
24
|
aes.update(data) + aes.final
|
25
25
|
end
|
26
|
-
# rubocop:enable Naming/
|
26
|
+
# rubocop:enable Naming/MethodParameterName
|
27
27
|
|
28
28
|
end
|
29
29
|
end
|
@@ -150,12 +150,12 @@ module Keepassx
|
|
150
150
|
|
151
151
|
|
152
152
|
def decrypt_payload(payload, final_key)
|
153
|
-
AESCrypt.decrypt(payload, final_key, header.encryption_iv, 'AES-256-CBC')
|
153
|
+
Keepassx::AESCrypt.decrypt(payload, final_key, header.encryption_iv, 'AES-256-CBC')
|
154
154
|
end
|
155
155
|
|
156
156
|
|
157
157
|
def encrypt_payload(payload, final_key)
|
158
|
-
AESCrypt.encrypt(payload, final_key, header.encryption_iv, 'AES-256-CBC')
|
158
|
+
Keepassx::AESCrypt.encrypt(payload, final_key, header.encryption_iv, 'AES-256-CBC')
|
159
159
|
end
|
160
160
|
|
161
161
|
|
data/lib/keepassx/field/base.rb
CHANGED
@@ -81,12 +81,12 @@ module Keepassx
|
|
81
81
|
private
|
82
82
|
|
83
83
|
|
84
|
-
# rubocop:disable Style/
|
84
|
+
# rubocop:disable Style/RedundantInterpolation
|
85
85
|
def set_export_import_methods(type)
|
86
86
|
@export_method = "#{type}".to_sym
|
87
87
|
@import_method = "#{type}=".to_sym
|
88
88
|
end
|
89
|
-
# rubocop:enable Style/
|
89
|
+
# rubocop:enable Style/RedundantInterpolation
|
90
90
|
|
91
91
|
|
92
92
|
### EXPORT METHODS
|
@@ -107,18 +107,18 @@ module Keepassx
|
|
107
107
|
|
108
108
|
|
109
109
|
def int
|
110
|
-
@data.
|
110
|
+
@data.unpack1('I')
|
111
111
|
end
|
112
112
|
|
113
113
|
|
114
114
|
def short
|
115
|
-
@data.
|
115
|
+
@data.unpack1('S')
|
116
116
|
end
|
117
117
|
|
118
118
|
|
119
119
|
def ascii
|
120
120
|
# TODO: Add spec
|
121
|
-
@data.
|
121
|
+
@data.unpack1('H*')
|
122
122
|
end
|
123
123
|
|
124
124
|
|
@@ -137,11 +137,9 @@ module Keepassx
|
|
137
137
|
|
138
138
|
### IMPORT METHODS
|
139
139
|
|
140
|
-
# rubocop:disable Naming/UncommunicativeMethodParamName
|
141
140
|
def null=(_)
|
142
141
|
@data = nil
|
143
142
|
end
|
144
|
-
# rubocop:enable Naming/UncommunicativeMethodParamName
|
145
143
|
|
146
144
|
|
147
145
|
def shunt=(value)
|
data/lib/keepassx/header.rb
CHANGED
@@ -69,17 +69,17 @@ module Keepassx
|
|
69
69
|
@rounds = 50_000
|
70
70
|
else
|
71
71
|
header_bytes = StringIO.new(header_bytes)
|
72
|
-
@signature1 = header_bytes.read(4).
|
73
|
-
@signature2 = header_bytes.read(4).
|
74
|
-
@flags = header_bytes.read(4).
|
75
|
-
@version = header_bytes.read(4).
|
72
|
+
@signature1 = header_bytes.read(4).unpack1('L*')
|
73
|
+
@signature2 = header_bytes.read(4).unpack1('L*')
|
74
|
+
@flags = header_bytes.read(4).unpack1('L*')
|
75
|
+
@version = header_bytes.read(4).unpack1('L*')
|
76
76
|
@master_seed = header_bytes.read(16)
|
77
77
|
@encryption_iv = header_bytes.read(16)
|
78
|
-
@groups_count = header_bytes.read(4).
|
79
|
-
@entries_count = header_bytes.read(4).
|
78
|
+
@groups_count = header_bytes.read(4).unpack1('L*')
|
79
|
+
@entries_count = header_bytes.read(4).unpack1('L*')
|
80
80
|
@content_hash = header_bytes.read(32)
|
81
81
|
@master_seed2 = header_bytes.read(32)
|
82
|
-
@rounds = header_bytes.read(4).
|
82
|
+
@rounds = header_bytes.read(4).unpack1('L*')
|
83
83
|
end
|
84
84
|
end
|
85
85
|
# rubocop:enable Metrics/MethodLength
|
data/lib/keepassx/version.rb
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Keepassx
|
4
|
-
|
4
|
+
|
5
|
+
def self.gem_version
|
6
|
+
Gem::Version.new VERSION::STRING
|
7
|
+
end
|
8
|
+
|
9
|
+
module VERSION
|
10
|
+
MAJOR = 1
|
11
|
+
MINOR = 1
|
12
|
+
TINY = 0
|
13
|
+
PRE = nil
|
14
|
+
|
15
|
+
STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
|
16
|
+
end
|
5
17
|
end
|
data/spec/keepassx/entry_spec.rb
CHANGED
data/spec/keepassx/group_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -5,7 +5,7 @@ require 'factory_bot'
|
|
5
5
|
|
6
6
|
# Start Simplecov
|
7
7
|
SimpleCov.start do
|
8
|
-
add_filter '
|
8
|
+
add_filter 'spec/'
|
9
9
|
end
|
10
10
|
|
11
11
|
# Configure RSpec
|
@@ -21,30 +21,17 @@ RSpec.configure do |config|
|
|
21
21
|
config.expect_with :rspec do |c|
|
22
22
|
c.syntax = :expect
|
23
23
|
end
|
24
|
-
end
|
25
|
-
|
26
|
-
# Load lib
|
27
|
-
require 'keepassx'
|
28
|
-
require_relative 'factories'
|
29
|
-
|
30
|
-
FIXTURE_PATH = File.expand_path File.join(File.dirname(__FILE__), 'fixtures')
|
31
|
-
TEST_DATABASE_PATH = File.join(FIXTURE_PATH, 'database_test.kdb')
|
32
|
-
EMPTY_DATABASE_PATH = File.join(FIXTURE_PATH, 'database_empty.kdb')
|
33
|
-
KEYFILE_DATABASE_PATH = File.join(FIXTURE_PATH, 'database_with_key.kdb')
|
34
24
|
|
25
|
+
# disable monkey patching
|
26
|
+
# see: https://relishapp.com/rspec/rspec-core/v/3-8/docs/configuration/zero-monkey-patching-mode
|
27
|
+
config.disable_monkey_patching!
|
28
|
+
end
|
35
29
|
|
30
|
+
# Configure/Patch Respect
|
36
31
|
module RespectPatch
|
37
|
-
def
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
module InstanceMethods
|
42
|
-
|
43
|
-
def validate_uuid(uuid)
|
44
|
-
return true if uuid =~ /\A[0-9a-f]{32}\z/i
|
45
|
-
raise Respect::ValidationError, "invalid UUID"
|
46
|
-
end
|
47
|
-
|
32
|
+
def validate_uuid(uuid)
|
33
|
+
return true if uuid =~ /\A[0-9a-f]{32}\z/i
|
34
|
+
raise Respect::ValidationError, "invalid UUID"
|
48
35
|
end
|
49
36
|
end
|
50
37
|
|
@@ -54,8 +41,17 @@ module UUIDValidator
|
|
54
41
|
end
|
55
42
|
end
|
56
43
|
|
57
|
-
|
58
|
-
Respect::FormatValidator.send(:include, RespectPatch)
|
59
|
-
end
|
60
|
-
|
44
|
+
Respect::FormatValidator.prepend(RespectPatch)
|
61
45
|
Respect.extend_dsl_with(UUIDValidator)
|
46
|
+
|
47
|
+
# Load factories
|
48
|
+
require_relative 'support/factories'
|
49
|
+
|
50
|
+
# Declare some constants used during tests
|
51
|
+
FIXTURE_PATH = File.expand_path File.join(File.dirname(__FILE__), 'fixtures')
|
52
|
+
TEST_DATABASE_PATH = File.join(FIXTURE_PATH, 'database_test.kdb')
|
53
|
+
EMPTY_DATABASE_PATH = File.join(FIXTURE_PATH, 'database_empty.kdb')
|
54
|
+
KEYFILE_DATABASE_PATH = File.join(FIXTURE_PATH, 'database_with_key.kdb')
|
55
|
+
|
56
|
+
# Load lib
|
57
|
+
require 'keepassx'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
FactoryBot.define do
|
2
2
|
|
3
|
-
factory :group, class: Keepassx::Group do
|
3
|
+
factory :group, class: 'Keepassx::Group' do
|
4
4
|
id { 1 }
|
5
5
|
name { 'test_group' }
|
6
6
|
icon { 20 }
|
@@ -8,7 +8,7 @@ FactoryBot.define do
|
|
8
8
|
initialize_with { new(attributes) }
|
9
9
|
end
|
10
10
|
|
11
|
-
factory :entry, class: Keepassx::Entry do
|
11
|
+
factory :entry, class: 'Keepassx::Entry' do
|
12
12
|
name { 'test_entry' }
|
13
13
|
group { build(:group) }
|
14
14
|
username { 'test' }
|
metadata
CHANGED
@@ -1,24 +1,24 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keepassx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Pitluga
|
8
8
|
- Paul Hinze
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-08-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: zeitwerk
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '0'
|
21
|
-
type: :
|
21
|
+
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
|
-
name:
|
29
|
+
name: factory_bot
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - ">="
|
@@ -57,16 +57,16 @@ dependencies:
|
|
57
57
|
name: rake
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- - "
|
60
|
+
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
62
|
+
version: '0'
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- - "
|
67
|
+
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
69
|
+
version: '0'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: respect
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -96,7 +96,7 @@ dependencies:
|
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
|
-
name:
|
99
|
+
name: rubocop
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
102
|
- - ">="
|
@@ -109,6 +109,20 @@ dependencies:
|
|
109
109
|
- - ">="
|
110
110
|
- !ruby/object:Gem::Version
|
111
111
|
version: '0'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: simplecov
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - "~>"
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: 0.17.1
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - "~>"
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 0.17.1
|
112
126
|
description: See http://github.com/pitluga/keepassx
|
113
127
|
email:
|
114
128
|
- tony.pitluga@gmail.com
|
@@ -126,6 +140,11 @@ files:
|
|
126
140
|
- LICENSE
|
127
141
|
- README.md
|
128
142
|
- Rakefile
|
143
|
+
- bin/_guard-core
|
144
|
+
- bin/guard
|
145
|
+
- bin/rake
|
146
|
+
- bin/rspec
|
147
|
+
- bin/rubocop
|
129
148
|
- keepassx.gemspec
|
130
149
|
- lib/keepassx.rb
|
131
150
|
- lib/keepassx/aes_crypt.rb
|
@@ -134,6 +153,7 @@ files:
|
|
134
153
|
- lib/keepassx/database/finder.rb
|
135
154
|
- lib/keepassx/database/loader.rb
|
136
155
|
- lib/keepassx/entry.rb
|
156
|
+
- lib/keepassx/field.rb
|
137
157
|
- lib/keepassx/field/base.rb
|
138
158
|
- lib/keepassx/field/entry.rb
|
139
159
|
- lib/keepassx/field/group.rb
|
@@ -142,7 +162,6 @@ files:
|
|
142
162
|
- lib/keepassx/hashable_payload.rb
|
143
163
|
- lib/keepassx/header.rb
|
144
164
|
- lib/keepassx/version.rb
|
145
|
-
- spec/factories.rb
|
146
165
|
- spec/fixtures/database_empty.kdb
|
147
166
|
- spec/fixtures/database_test.kdb
|
148
167
|
- spec/fixtures/database_test_dumped.yml
|
@@ -154,13 +173,14 @@ files:
|
|
154
173
|
- spec/keepassx/database_spec.rb
|
155
174
|
- spec/keepassx/entry_spec.rb
|
156
175
|
- spec/keepassx/group_spec.rb
|
157
|
-
- spec/keepassx_spec.rb
|
176
|
+
- spec/keepassx/keepassx_spec.rb
|
158
177
|
- spec/spec_helper.rb
|
178
|
+
- spec/support/factories.rb
|
159
179
|
homepage: http://github.com/pitluga/keepassx
|
160
180
|
licenses:
|
161
181
|
- MIT
|
162
182
|
metadata: {}
|
163
|
-
post_install_message:
|
183
|
+
post_install_message:
|
164
184
|
rdoc_options: []
|
165
185
|
require_paths:
|
166
186
|
- lib
|
@@ -168,15 +188,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
168
188
|
requirements:
|
169
189
|
- - ">="
|
170
190
|
- !ruby/object:Gem::Version
|
171
|
-
version:
|
191
|
+
version: 2.5.0
|
172
192
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
173
193
|
requirements:
|
174
194
|
- - ">="
|
175
195
|
- !ruby/object:Gem::Version
|
176
196
|
version: '0'
|
177
197
|
requirements: []
|
178
|
-
rubygems_version: 3.
|
179
|
-
signing_key:
|
198
|
+
rubygems_version: 3.1.2
|
199
|
+
signing_key:
|
180
200
|
specification_version: 4
|
181
201
|
summary: Ruby API access for KeePassX databases
|
182
202
|
test_files: []
|