keylime 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circle-ruby +3 -0
- data/.rubocop.yml +2 -0
- data/README.md +1 -1
- data/circle.yml +3 -8
- data/keylime.gemspec +5 -5
- data/lib/keylime/credential.rb +32 -8
- metadata +12 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a50d84f7194d60ee59f2653314f78b2e03b4e961
|
4
|
+
data.tar.gz: 311fe4218068e5e64703e0afc90829d704def173
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54ac17b13a3842ca56097b4cbe84437d764809a3f64f7b6f4752209bfaa31251e6543054b634035f6879ed4aa9ca1f89a31d24ae836b229ccefa26f1a8233271
|
7
|
+
data.tar.gz: b5d9aad7a118e10c2beb6a3253679f0128cd6a5e14b5b2f6eaa9cc8f2aa7d00fccdc5d159a9e9a5c5853fe8dc276b30af4d0613d3b7f6aa07e000b31c81cfc56
|
data/.circle-ruby
ADDED
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -3,7 +3,7 @@ keylime
|
|
3
3
|
|
4
4
|
[![Gem Version](https://img.shields.io/gem/v/keylime.svg)](https://rubygems.org/gems/keylime)
|
5
5
|
[![Dependency Status](https://img.shields.io/gemnasium/akerl/keylime.svg)](https://gemnasium.com/akerl/keylime)
|
6
|
-
[![Build Status](https://img.shields.io/circleci/project/akerl/keylime.svg)](https://circleci.com/gh/akerl/keylime)
|
6
|
+
[![Build Status](https://img.shields.io/circleci/project/akerl/keylime/master.svg)](https://circleci.com/gh/akerl/keylime)
|
7
7
|
[![Coverage Status](https://img.shields.io/codecov/c/github/akerl/keylime.svg)](https://codecov.io/github/akerl/keylime)
|
8
8
|
[![Code Quality](https://img.shields.io/codacy/b84e51f348094a33b2982bfb73adc645.svg)](https://www.codacy.com/app/akerl/keylime)
|
9
9
|
[![MIT Licensed](https://img.shields.io/badge/license-MIT-green.svg)](https://tldrlegal.com/license/mit-license)
|
data/circle.yml
CHANGED
@@ -1,12 +1,7 @@
|
|
1
1
|
dependencies:
|
2
2
|
override:
|
3
|
-
|
4
|
-
|
5
|
-
- 'rvm-exec 2.1.6 bundle install'
|
6
|
-
- 'rvm-exec 2.2.2 bundle install'
|
3
|
+
- 'for i in $(cat .circle-ruby) ; do rvm-exec $i gem update --system --no-doc || exit 1 ; done'
|
4
|
+
- 'for i in $(cat .circle-ruby) ; do rvm-exec $i bundle install || exit 1 ; done'
|
7
5
|
test:
|
8
6
|
override:
|
9
|
-
|
10
|
-
- 'rvm-exec 2.0.0-p645 bundle exec rake'
|
11
|
-
- 'rvm-exec 2.1.6 bundle exec rake'
|
12
|
-
- 'rvm-exec 2.2.2 bundle exec rake'
|
7
|
+
- 'for i in $(cat .circle-ruby) ; do rvm-exec $i bundle exec rake || exit 1 ; done'
|
data/keylime.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'keylime'
|
3
|
-
s.version = '0.0
|
3
|
+
s.version = '0.1.0'
|
4
4
|
s.date = Time.now.strftime('%Y-%m-%d')
|
5
5
|
|
6
6
|
s.summary = 'Simple wrapper for using Mac Keychain'
|
@@ -16,9 +16,9 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.add_dependency 'ruby-keychain', '~> 0.3.0'
|
17
17
|
s.add_dependency 'userinput', '~> 1.0.0'
|
18
18
|
|
19
|
-
s.add_development_dependency 'rubocop', '~> 0.
|
20
|
-
s.add_development_dependency 'rake', '~>
|
19
|
+
s.add_development_dependency 'rubocop', '~> 0.49.0'
|
20
|
+
s.add_development_dependency 'rake', '~> 12.0.0'
|
21
21
|
s.add_development_dependency 'codecov', '~> 0.1.1'
|
22
|
-
s.add_development_dependency 'rspec', '~> 3.
|
23
|
-
s.add_development_dependency 'fuubar', '~> 2.
|
22
|
+
s.add_development_dependency 'rspec', '~> 3.6.0'
|
23
|
+
s.add_development_dependency 'fuubar', '~> 2.2.0'
|
24
24
|
end
|
data/lib/keylime/credential.rb
CHANGED
@@ -1,17 +1,22 @@
|
|
1
|
-
require 'keychain'
|
2
1
|
require 'userinput'
|
3
2
|
|
4
3
|
module Keylime
|
4
|
+
ENABLED = begin
|
5
|
+
require 'keychain'
|
6
|
+
true
|
7
|
+
rescue LoadError
|
8
|
+
raise if RUBY_PLATFORM =~ /darwin/
|
9
|
+
false
|
10
|
+
end
|
11
|
+
|
5
12
|
##
|
6
13
|
# Easy wrapper around getting and setting secrets
|
7
14
|
class Credential
|
8
15
|
def initialize(params = {})
|
9
16
|
@options = params
|
10
|
-
@enabled = RUBY_PLATFORM =~ /darwin/ || ENV['CI']
|
11
17
|
end
|
12
18
|
|
13
19
|
def get
|
14
|
-
return unless @enabled
|
15
20
|
keychain_segment.where(@options).first
|
16
21
|
end
|
17
22
|
|
@@ -41,11 +46,10 @@ module Keylime
|
|
41
46
|
end
|
42
47
|
|
43
48
|
def keychain
|
44
|
-
@keychain
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
end
|
49
|
+
return @keychain if @keychain
|
50
|
+
@keychain = StubKeychain.new unless Keylime::ENABLED
|
51
|
+
@keychain ||= Keychain.open(@options[:keychain]) if @options[:keychain]
|
52
|
+
@keychain ||= Keychain
|
49
53
|
end
|
50
54
|
|
51
55
|
def key_type
|
@@ -56,4 +60,24 @@ module Keylime
|
|
56
60
|
@keychain_segment ||= keychain.send(key_type)
|
57
61
|
end
|
58
62
|
end
|
63
|
+
|
64
|
+
##
|
65
|
+
# Stub keychain for if keylime is running on a non-Mac
|
66
|
+
class StubKeychain
|
67
|
+
def segment
|
68
|
+
StubKeychainSegment.new
|
69
|
+
end
|
70
|
+
alias internet_passwords segment
|
71
|
+
alias generic_passwords segment
|
72
|
+
end
|
73
|
+
|
74
|
+
##
|
75
|
+
# Stub segment for if keylime is running on a non-Mac
|
76
|
+
class StubKeychainSegment
|
77
|
+
def where
|
78
|
+
[]
|
79
|
+
end
|
80
|
+
|
81
|
+
def create() end
|
82
|
+
end
|
59
83
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keylime
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Les Aker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-keychain
|
@@ -44,28 +44,28 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.49.0
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.49.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 12.0.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 12.0.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: codecov
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,34 +86,35 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 3.
|
89
|
+
version: 3.6.0
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 3.
|
96
|
+
version: 3.6.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: fuubar
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 2.
|
103
|
+
version: 2.2.0
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 2.
|
110
|
+
version: 2.2.0
|
111
111
|
description: Simple wrapper for using Mac Keychain
|
112
112
|
email: me@lesaker.org
|
113
113
|
executables: []
|
114
114
|
extensions: []
|
115
115
|
extra_rdoc_files: []
|
116
116
|
files:
|
117
|
+
- ".circle-ruby"
|
117
118
|
- ".gitignore"
|
118
119
|
- ".prospectus"
|
119
120
|
- ".rspec"
|
@@ -150,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
151
|
version: '0'
|
151
152
|
requirements: []
|
152
153
|
rubyforge_project:
|
153
|
-
rubygems_version: 2.
|
154
|
+
rubygems_version: 2.6.11
|
154
155
|
signing_key:
|
155
156
|
specification_version: 4
|
156
157
|
summary: Simple wrapper for using Mac Keychain
|