totvs_password_vault 0.1.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 +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.rubocop.yml +81 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +75 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/lib/totvs/password_vault/connection.rb +166 -0
- data/lib/totvs/password_vault/information.rb +64 -0
- data/lib/totvs/password_vault/key.rb +72 -0
- data/lib/totvs/password_vault/parsers/json_parser.rb +14 -0
- data/lib/totvs/password_vault/response.rb +31 -0
- data/lib/totvs/password_vault/version.rb +5 -0
- data/lib/totvs/password_vault.rb +11 -0
- data/totvs_password_vault.gemspec +40 -0
- metadata +160 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 692fc779e57e55d29cd598ea21175308303849ab
|
4
|
+
data.tar.gz: 5b7883c5e74c71cb77021b7b018e4b60216f2875
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 60bfbfdfec5b2c82d9baf31496239f4cceb2d48a309ac1eef6a0b2144ef1fe416ee627b3a960e896a2fcdf6e80a843559a9f651b3fb1117b6d67a0c0d67b7889
|
7
|
+
data.tar.gz: 128937f32969529a40092b6d6f929c97fe6f66fa1d500ef865077bdbc826fc5314d4ac9548798c53de3e29857f96a8acd8cdc48145bee57fe1deae42b68c0eec
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
AllCops:
|
2
|
+
Include:
|
3
|
+
- "**/*.gemspec"
|
4
|
+
- "**/Rakefile"
|
5
|
+
- "**/Gemfile"
|
6
|
+
Exclude:
|
7
|
+
- "spec/spec_helper.rb"
|
8
|
+
- "bin/*"
|
9
|
+
|
10
|
+
# avoid parameter lists longer than 5 parameters.
|
11
|
+
ParameterLists:
|
12
|
+
Max: 5
|
13
|
+
CountKeywordArgs: true
|
14
|
+
Enabled: false
|
15
|
+
|
16
|
+
Lint/UnusedMethodArgument:
|
17
|
+
Enabled: false
|
18
|
+
|
19
|
+
Style/DoubleNegation:
|
20
|
+
Enabled: false
|
21
|
+
|
22
|
+
Style/AlignHash:
|
23
|
+
EnforcedLastArgumentHashStyle: ignore_implicit
|
24
|
+
|
25
|
+
Metrics/BlockNesting:
|
26
|
+
Enabled: false
|
27
|
+
|
28
|
+
Style/CaseIndentation:
|
29
|
+
IndentOneStep: false
|
30
|
+
|
31
|
+
Style/ClassAndModuleChildren:
|
32
|
+
Enabled: false
|
33
|
+
|
34
|
+
Style/Documentation:
|
35
|
+
Enabled: false
|
36
|
+
|
37
|
+
Style/Encoding:
|
38
|
+
EnforcedStyle: when_needed
|
39
|
+
|
40
|
+
Style/FormatString:
|
41
|
+
Enabled: false
|
42
|
+
|
43
|
+
Style/GuardClause:
|
44
|
+
Enabled: false
|
45
|
+
|
46
|
+
Style/IfUnlessModifier:
|
47
|
+
MaxLineLength: 120
|
48
|
+
|
49
|
+
Style/IndentHash:
|
50
|
+
EnforcedStyle: consistent
|
51
|
+
|
52
|
+
Style/LambdaCall:
|
53
|
+
EnforcedStyle: call
|
54
|
+
|
55
|
+
Metrics/LineLength:
|
56
|
+
Max: 120
|
57
|
+
|
58
|
+
Style/NonNilCheck:
|
59
|
+
IncludeSemanticChanges: true
|
60
|
+
|
61
|
+
Metrics/MethodLength:
|
62
|
+
Enabled: false
|
63
|
+
|
64
|
+
Metrics/ClassLength:
|
65
|
+
Enabled: false
|
66
|
+
|
67
|
+
Style/PredicateName:
|
68
|
+
NamePrefixBlacklist:
|
69
|
+
- is_
|
70
|
+
|
71
|
+
Style/RedundantReturn:
|
72
|
+
AllowMultipleReturnValues: true
|
73
|
+
|
74
|
+
Style/SingleLineBlockParams:
|
75
|
+
Enabled: false
|
76
|
+
|
77
|
+
Style/StringLiterals:
|
78
|
+
EnforcedStyle: double_quotes
|
79
|
+
|
80
|
+
Style/WhileUntilModifier:
|
81
|
+
MaxLineLength: 120
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Guilherme da Silva Mello
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
# Totvs::PasswordVault
|
2
|
+
|
3
|
+
[](https://travis-ci.org/diegoaltheman/totvs_password_vault)
|
4
|
+
|
5
|
+
This gem is responsible for connecting to Totvs password vault and save keys, important information.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem "totvs_password_vault"
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install totvs_password_vault
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
### Connection config
|
26
|
+
|
27
|
+
Currently this gem only supports a pre configured token keys. Please, set these env vars:
|
28
|
+
|
29
|
+
- VAULT_CONSUMER_KEY
|
30
|
+
- VAULT_CONSUMER_SECRET
|
31
|
+
- VAULT_BASE_URL
|
32
|
+
- VAULT_ACCESS_TOKEN
|
33
|
+
- VAULT_ACCESS_TOKEN_SECRET
|
34
|
+
|
35
|
+
### Totvs::PasswordVault::Key
|
36
|
+
|
37
|
+
This class is responsible for handling keys (mainly ssh keys, but could be anything).
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
key = Totvs::PasswordVault::Key.new
|
41
|
+
key.save(id: "keyid", public_key: "public key", private_key: "private key", hostname: "hostname", ip: "0.0.0.0")
|
42
|
+
|
43
|
+
key.retrieve(id: "keyid") #=> { public_key: "public key", private_key: "private key" }
|
44
|
+
```
|
45
|
+
|
46
|
+
### Totvs::PasswordVault::Information
|
47
|
+
|
48
|
+
This class is responsible for handling any important information you need to store.
|
49
|
+
|
50
|
+
```ruby
|
51
|
+
info = Totvs::PasswordVault::Information.new
|
52
|
+
info.save(id: "keyid", content: { "some" => "value" })
|
53
|
+
|
54
|
+
info.retrieve(id: "keyid") #=> { "some" => "value" }
|
55
|
+
```
|
56
|
+
|
57
|
+
## Development
|
58
|
+
|
59
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
60
|
+
|
61
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
62
|
+
|
63
|
+
## Contributing
|
64
|
+
|
65
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/diegoaltheman/totvs_password_vault.
|
66
|
+
|
67
|
+
## TODO
|
68
|
+
|
69
|
+
- Access token should be fetched (validated) and not env var configured
|
70
|
+
|
71
|
+
|
72
|
+
## License
|
73
|
+
|
74
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
75
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "totvs/password_vault"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,166 @@
|
|
1
|
+
require "oauth"
|
2
|
+
|
3
|
+
module Totvs
|
4
|
+
module PasswordVault
|
5
|
+
class Connection
|
6
|
+
class Error < StandardError; end
|
7
|
+
class TimeoutError < Error; end
|
8
|
+
class RequestFailure < Error
|
9
|
+
attr_reader :response
|
10
|
+
|
11
|
+
# @param message [String]
|
12
|
+
# @param response [Net::HTTPResponse]
|
13
|
+
def initialize(message = nil, response:)
|
14
|
+
super("Status code: #{response.code}. Body: #{response.body}. #{message}")
|
15
|
+
|
16
|
+
@response = response
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
# @!attribute [w] consumer_key
|
21
|
+
# @return [String]
|
22
|
+
attr_writer :consumer_key
|
23
|
+
|
24
|
+
# @!attribute [w] consumer_secret
|
25
|
+
# @return [String]
|
26
|
+
attr_writer :consumer_secret
|
27
|
+
|
28
|
+
# @!attribute [w] vault_base_url
|
29
|
+
# @return [String]
|
30
|
+
attr_writer :vault_base_url
|
31
|
+
|
32
|
+
# @!attribute [w] vault_access_token
|
33
|
+
# @return [String]
|
34
|
+
attr_writer :vault_access_token
|
35
|
+
|
36
|
+
# @!attribute [w] vault_access_token_secret
|
37
|
+
# @return [String]
|
38
|
+
attr_writer :vault_access_token_secret
|
39
|
+
|
40
|
+
# Returns the oauth consumer
|
41
|
+
# @return [OAuth::Consumer]
|
42
|
+
def consumer
|
43
|
+
@consumer ||= OAuth::Consumer.new(
|
44
|
+
consumer_key,
|
45
|
+
consumer_secret,
|
46
|
+
site: vault_base_url
|
47
|
+
)
|
48
|
+
end
|
49
|
+
|
50
|
+
# Returns the oauth access token
|
51
|
+
# @return [OAuth::AccessToken]
|
52
|
+
def access_token
|
53
|
+
@access_token ||= OAuth::AccessToken.new(
|
54
|
+
consumer,
|
55
|
+
vault_access_token,
|
56
|
+
vault_access_token_secret
|
57
|
+
)
|
58
|
+
end
|
59
|
+
|
60
|
+
# Alias access token
|
61
|
+
# @return [OAuth::AccessToken]
|
62
|
+
def requester
|
63
|
+
access_token
|
64
|
+
end
|
65
|
+
|
66
|
+
# Makes a http request
|
67
|
+
#
|
68
|
+
# @param http_method [Symbol]
|
69
|
+
# @param path [String]
|
70
|
+
# @param args [...]
|
71
|
+
#
|
72
|
+
# @return [Net::HTTPResponse]
|
73
|
+
#
|
74
|
+
# @raise [TimeoutError]
|
75
|
+
def make_request(http_method, path, *args)
|
76
|
+
requester.request http_method, path, *args
|
77
|
+
rescue Timeout::Error => e
|
78
|
+
raise TimeoutError, "#{http_method.to_s.upcase}: #{path}. #{e}"
|
79
|
+
end
|
80
|
+
|
81
|
+
# @return [Response] response
|
82
|
+
# @raise [RequestFailure] if the request was not a success
|
83
|
+
# @raise [TimeoutError]
|
84
|
+
def get(path:, headers: {})
|
85
|
+
response = make_request(:get, path, headers)
|
86
|
+
validate_success! response
|
87
|
+
|
88
|
+
wrap_response response
|
89
|
+
end
|
90
|
+
|
91
|
+
# @return [Response] response
|
92
|
+
# @raise [RequestFailure] if the request was not a success
|
93
|
+
# @raise [TimeoutError]
|
94
|
+
def post(path:, body: nil, headers: {})
|
95
|
+
response = make_request(:post, path, body, headers)
|
96
|
+
validate_success! response
|
97
|
+
|
98
|
+
wrap_response response
|
99
|
+
end
|
100
|
+
|
101
|
+
# @return [Response] response
|
102
|
+
# @raise [RequestFailure] if the request was not a success
|
103
|
+
# @raise [TimeoutError]
|
104
|
+
def put(path:, body: nil, headers: {})
|
105
|
+
response = make_request(:put, path, body, headers)
|
106
|
+
validate_success! response
|
107
|
+
|
108
|
+
wrap_response response
|
109
|
+
end
|
110
|
+
|
111
|
+
# @return [Response] response
|
112
|
+
# @raise [RequestFailure] if the request was not a success
|
113
|
+
# @raise [TimeoutError]
|
114
|
+
def delete(path:, headers: {})
|
115
|
+
response = make_request(:delete, path, headers)
|
116
|
+
validate_success! response
|
117
|
+
|
118
|
+
wrap_response response
|
119
|
+
end
|
120
|
+
|
121
|
+
# @return [String]
|
122
|
+
def consumer_key
|
123
|
+
@consumer_key ||= ENV["VAULT_CONSUMER_KEY"]
|
124
|
+
end
|
125
|
+
|
126
|
+
# @return [String]
|
127
|
+
def consumer_secret
|
128
|
+
@consumer_secret ||= ENV["VAULT_CONSUMER_SECRET"]
|
129
|
+
end
|
130
|
+
|
131
|
+
# @return [String]
|
132
|
+
def vault_base_url
|
133
|
+
@vault_base_url ||= ENV["VAULT_BASE_URL"]
|
134
|
+
end
|
135
|
+
|
136
|
+
# @return [String]
|
137
|
+
def vault_access_token
|
138
|
+
@vault_access_token ||= ENV["VAULT_ACCESS_TOKEN"]
|
139
|
+
end
|
140
|
+
|
141
|
+
# @return [String]
|
142
|
+
def vault_access_token_secret
|
143
|
+
@vault_access_token_secret ||= ENV["VAULT_ACCESS_TOKEN_SECRET"]
|
144
|
+
end
|
145
|
+
|
146
|
+
# Wraps the response to a Response object
|
147
|
+
# @return [Response]
|
148
|
+
def wrap_response(response)
|
149
|
+
Response.new status_code: response.code.to_i,
|
150
|
+
body: response.body,
|
151
|
+
content_type: response.content_type
|
152
|
+
end
|
153
|
+
|
154
|
+
protected
|
155
|
+
|
156
|
+
def validate_success!(response)
|
157
|
+
unless response.is_a? Net::HTTPSuccess
|
158
|
+
message = "Response class: #{response}"
|
159
|
+
fail RequestFailure.new message, response: response
|
160
|
+
end
|
161
|
+
|
162
|
+
response
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
require "forwardable"
|
2
|
+
require "totvs/password_vault/parsers/json_parser"
|
3
|
+
|
4
|
+
module Totvs
|
5
|
+
module PasswordVault
|
6
|
+
class Information
|
7
|
+
extend Forwardable
|
8
|
+
include JsonParser
|
9
|
+
|
10
|
+
def_delegators :connection, :get, :post, :delete
|
11
|
+
|
12
|
+
# @!attribute [w] connection
|
13
|
+
# @return [Connection]
|
14
|
+
attr_writer :connection
|
15
|
+
|
16
|
+
def initialize(connection: nil)
|
17
|
+
@connection = connection
|
18
|
+
end
|
19
|
+
|
20
|
+
def connection
|
21
|
+
@connection ||= Connection.new
|
22
|
+
end
|
23
|
+
|
24
|
+
# @param id [String] the id key to fetch info from
|
25
|
+
# @return [Hash, Array] content the saved content
|
26
|
+
# @raise [Totvs::PasswordVault::Connection::RequestFailure] if the request was not a success
|
27
|
+
def retrieve(id:)
|
28
|
+
headers = { "Accept" => "application/json" }
|
29
|
+
response = get(path: build_path(id), headers: headers)
|
30
|
+
response = parse_json(response.body)
|
31
|
+
|
32
|
+
parse_json(response["info"]["conteudo"])
|
33
|
+
end
|
34
|
+
|
35
|
+
# @param id [String] the id key to save info
|
36
|
+
# @param content [#to_json]
|
37
|
+
def save(id:, content:, **kwargs)
|
38
|
+
headers = {
|
39
|
+
"Accept" => "application/json",
|
40
|
+
"Content-Type" => "application/json"
|
41
|
+
}
|
42
|
+
|
43
|
+
body = {
|
44
|
+
conteudo: content.to_json
|
45
|
+
}.merge(kwargs)
|
46
|
+
|
47
|
+
post path: build_path(id), body: body, headers: headers
|
48
|
+
end
|
49
|
+
|
50
|
+
# @param id [String] the id key to be removed
|
51
|
+
# @raise [Totvs::PasswordVault::Connection::RequestFailure] if the request was not a success
|
52
|
+
def destroy(id:)
|
53
|
+
headers = { "Accept" => "application/json" }
|
54
|
+
delete path: build_path(id), headers: headers
|
55
|
+
end
|
56
|
+
|
57
|
+
protected
|
58
|
+
|
59
|
+
def build_path(key)
|
60
|
+
"/iso/coe/info/#{key}"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require "forwardable"
|
2
|
+
require "totvs/password_vault/parsers/json_parser"
|
3
|
+
|
4
|
+
module Totvs
|
5
|
+
module PasswordVault
|
6
|
+
class Key
|
7
|
+
extend Forwardable
|
8
|
+
include JsonParser
|
9
|
+
|
10
|
+
def_delegators :connection, :get, :post, :delete
|
11
|
+
|
12
|
+
# @!attribute [w] connection
|
13
|
+
# @return [Connection]
|
14
|
+
attr_writer :connection
|
15
|
+
|
16
|
+
def initialize(connection: nil)
|
17
|
+
@connection = connection
|
18
|
+
end
|
19
|
+
|
20
|
+
def connection
|
21
|
+
@connection ||= Connection.new
|
22
|
+
end
|
23
|
+
|
24
|
+
# @param id [String] the id key to fetch info from
|
25
|
+
# @return [Hash<Symbol, String>] content the saved content
|
26
|
+
# @param public_key [String]
|
27
|
+
# @param private_key [String]
|
28
|
+
# @raise [Totvs::PasswordVault::Connection::RequestFailure] if the request was not a success
|
29
|
+
def retrieve(id:)
|
30
|
+
headers = { "Accept" => "application/json" }
|
31
|
+
response = get(path: build_path(id), headers: headers)
|
32
|
+
response = parse_json response.body
|
33
|
+
|
34
|
+
{ public_key: response["chave"]["chave_publica"], private_key: response["chave"]["chave_privada"] }
|
35
|
+
end
|
36
|
+
|
37
|
+
# @param id [String] the id key to save info
|
38
|
+
# @param public_key [String]
|
39
|
+
# @param private_key [String]
|
40
|
+
# @param hostname [String]
|
41
|
+
# @param ip [String]
|
42
|
+
def save(id:, public_key:, private_key:, hostname:, ip:, **kwargs)
|
43
|
+
headers = {
|
44
|
+
"Accept" => "application/json",
|
45
|
+
"Content-Type" => "application/json"
|
46
|
+
}
|
47
|
+
|
48
|
+
body = {
|
49
|
+
chave_publica: public_key,
|
50
|
+
chave_privada: private_key,
|
51
|
+
hostname: hostname,
|
52
|
+
ip: ip
|
53
|
+
}.merge(kwargs)
|
54
|
+
|
55
|
+
post path: build_path(id), body: body, headers: headers
|
56
|
+
end
|
57
|
+
|
58
|
+
# @param id [String] the id key to be removed
|
59
|
+
# @raise [Totvs::PasswordVault::Connection::RequestFailure] if the request was not a success
|
60
|
+
def destroy(id:)
|
61
|
+
headers = { "Accept" => "application/json" }
|
62
|
+
delete path: build_path(id), headers: headers
|
63
|
+
end
|
64
|
+
|
65
|
+
protected
|
66
|
+
|
67
|
+
def build_path(key)
|
68
|
+
"/iso/coe/chave/#{key}"
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Totvs
|
2
|
+
module PasswordVault
|
3
|
+
class Response
|
4
|
+
# @!attribute status_code
|
5
|
+
# @return [Integer]
|
6
|
+
attr_reader :status_code
|
7
|
+
|
8
|
+
# @!attribute body
|
9
|
+
# @return [String]
|
10
|
+
attr_reader :body
|
11
|
+
|
12
|
+
# @!attribute content_type
|
13
|
+
# @return [String]
|
14
|
+
attr_reader :content_type
|
15
|
+
|
16
|
+
# @param status_code [Integer] the status code
|
17
|
+
# @param body [String]
|
18
|
+
# @param content_type
|
19
|
+
def initialize(status_code:, body:, content_type:)
|
20
|
+
@status_code = status_code
|
21
|
+
@body = body
|
22
|
+
@content_type = content_type
|
23
|
+
end
|
24
|
+
|
25
|
+
# @return [Boolean]
|
26
|
+
def success?
|
27
|
+
status_code >= 200 && status_code < 300
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require "totvs/password_vault/version"
|
2
|
+
require "totvs/password_vault/connection"
|
3
|
+
require "totvs/password_vault/information"
|
4
|
+
require "totvs/password_vault/key"
|
5
|
+
require "totvs/password_vault/response"
|
6
|
+
require "totvs/password_vault/parsers/json_parser"
|
7
|
+
|
8
|
+
module Totvs
|
9
|
+
module PasswordVault
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "totvs/password_vault/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "totvs_password_vault"
|
8
|
+
spec.version = Totvs::PasswordVault::VERSION
|
9
|
+
spec.authors = ["Guilherme da Silva Mello"]
|
10
|
+
spec.email = ["guilhermesilvamello@gmail.com"]
|
11
|
+
|
12
|
+
spec.required_ruby_version = ">= 2.1"
|
13
|
+
|
14
|
+
spec.summary = "Totvs password vault manager."
|
15
|
+
spec.description = "This gem allows you to manage your data on totvs password vault."
|
16
|
+
spec.homepage = "https://github.com/diegoaltheman/totvs_password_vault"
|
17
|
+
spec.license = "MIT"
|
18
|
+
|
19
|
+
# # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
20
|
+
# # delete this section to allow pushing this gem to any host.
|
21
|
+
# if spec.respond_to?(:metadata)
|
22
|
+
# spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
23
|
+
# else
|
24
|
+
# raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
25
|
+
# end
|
26
|
+
|
27
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
28
|
+
spec.bindir = "exe"
|
29
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
30
|
+
spec.require_paths = ["lib"]
|
31
|
+
|
32
|
+
spec.add_dependency "oauth", "~> 0.4"
|
33
|
+
|
34
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
35
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
36
|
+
spec.add_development_dependency "rspec", "~> 3.3"
|
37
|
+
spec.add_development_dependency "rspec-its", "~> 1.2"
|
38
|
+
spec.add_development_dependency "rubocop", "~> 0.32"
|
39
|
+
spec.add_development_dependency "pry", "~> 0.10"
|
40
|
+
end
|
metadata
ADDED
@@ -0,0 +1,160 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: totvs_password_vault
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Guilherme da Silva Mello
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-07-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: oauth
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.4'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.4'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.10'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.10'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.3'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.3'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec-its
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.2'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.2'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.32'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.32'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: pry
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.10'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.10'
|
111
|
+
description: This gem allows you to manage your data on totvs password vault.
|
112
|
+
email:
|
113
|
+
- guilhermesilvamello@gmail.com
|
114
|
+
executables: []
|
115
|
+
extensions: []
|
116
|
+
extra_rdoc_files: []
|
117
|
+
files:
|
118
|
+
- ".gitignore"
|
119
|
+
- ".rspec"
|
120
|
+
- ".rubocop.yml"
|
121
|
+
- ".travis.yml"
|
122
|
+
- Gemfile
|
123
|
+
- LICENSE.txt
|
124
|
+
- README.md
|
125
|
+
- Rakefile
|
126
|
+
- bin/console
|
127
|
+
- bin/setup
|
128
|
+
- lib/totvs/password_vault.rb
|
129
|
+
- lib/totvs/password_vault/connection.rb
|
130
|
+
- lib/totvs/password_vault/information.rb
|
131
|
+
- lib/totvs/password_vault/key.rb
|
132
|
+
- lib/totvs/password_vault/parsers/json_parser.rb
|
133
|
+
- lib/totvs/password_vault/response.rb
|
134
|
+
- lib/totvs/password_vault/version.rb
|
135
|
+
- totvs_password_vault.gemspec
|
136
|
+
homepage: https://github.com/diegoaltheman/totvs_password_vault
|
137
|
+
licenses:
|
138
|
+
- MIT
|
139
|
+
metadata: {}
|
140
|
+
post_install_message:
|
141
|
+
rdoc_options: []
|
142
|
+
require_paths:
|
143
|
+
- lib
|
144
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
145
|
+
requirements:
|
146
|
+
- - ">="
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: '2.1'
|
149
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - ">="
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '0'
|
154
|
+
requirements: []
|
155
|
+
rubyforge_project:
|
156
|
+
rubygems_version: 2.2.3
|
157
|
+
signing_key:
|
158
|
+
specification_version: 4
|
159
|
+
summary: Totvs password vault manager.
|
160
|
+
test_files: []
|