totvs_password_vault 0.1.1 → 0.2.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 +4 -4
- data/lib/totvs/password_vault/key.rb +52 -4
- data/lib/totvs/password_vault/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5356b80dc4c54253975a22fdaac45abdbed63cd8
|
4
|
+
data.tar.gz: 99ad8f9eb421706a2e67c49c08c902ea0ad40af6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8d345f46f6eb6e5bb21f6a7c61fe0e76dbf9cab7420f79586c210a6b490db8aae2902039031bcfc3e612357c334bdc5bda3919f9f0924505cb4d9903c9ee3fb
|
7
|
+
data.tar.gz: 87a3127d06ba4e0eafbf0a9fc8801812a6c50cc0b28d63f46351d497d3e1b60e65a7873a7a7133c72b0ac8d055d86e92105fc0ab5f43db3769bb643c8ff229ef
|
@@ -25,13 +25,34 @@ module Totvs
|
|
25
25
|
# @return [Hash<Symbol, String>] content the saved content
|
26
26
|
# @param public_key [String]
|
27
27
|
# @param private_key [String]
|
28
|
+
# @param hostname [String]
|
29
|
+
# @param ip [String]
|
30
|
+
# @param username [String]
|
31
|
+
# @param maker [String]
|
32
|
+
# @param device_type [String]
|
33
|
+
# @param device_model [String]
|
34
|
+
# @param site [String]
|
35
|
+
# @param password_type [String]
|
36
|
+
# @param tags [Array]
|
28
37
|
# @raise [Totvs::PasswordVault::Connection::RequestFailure] if the request was not a success
|
29
38
|
def retrieve(id:)
|
30
39
|
headers = { "Accept" => "application/json" }
|
31
40
|
response = get(path: build_path(id), headers: headers)
|
32
41
|
response = parse_json response.body
|
33
42
|
|
34
|
-
{
|
43
|
+
{
|
44
|
+
public_key: response["chave"]["chave_publica"],
|
45
|
+
private_key: response["chave"]["chave_privada"],
|
46
|
+
hostname: response["chave"]["hostname"],
|
47
|
+
ip: response["chave"]["ip"],
|
48
|
+
username: response["chave"]["username"],
|
49
|
+
maker: response["chave"]["fabricante"],
|
50
|
+
device_type: response["chave"]["tipo"],
|
51
|
+
device_model: response["chave"]["modelo"],
|
52
|
+
site: response["chave"]["site"],
|
53
|
+
password_type: response["chave"]["tipo_senha"],
|
54
|
+
tags: response["chave"]["tags"]
|
55
|
+
}
|
35
56
|
end
|
36
57
|
|
37
58
|
# @param id [String] the id key to save info
|
@@ -39,7 +60,27 @@ module Totvs
|
|
39
60
|
# @param private_key [String]
|
40
61
|
# @param hostname [String]
|
41
62
|
# @param ip [String]
|
42
|
-
|
63
|
+
# @param maker [String, nil]
|
64
|
+
# @param device_type [String, nil]
|
65
|
+
# @param device_model [String, nil]
|
66
|
+
# @param site [String, nil]
|
67
|
+
# @param password_type [String, nil]
|
68
|
+
# @param tags [Array[String], nil]
|
69
|
+
def save(
|
70
|
+
id:,
|
71
|
+
public_key:,
|
72
|
+
private_key:,
|
73
|
+
hostname:,
|
74
|
+
ip:,
|
75
|
+
username: nil,
|
76
|
+
maker: nil,
|
77
|
+
device_type: nil,
|
78
|
+
device_model: nil,
|
79
|
+
site: nil,
|
80
|
+
password_type: nil,
|
81
|
+
tags: [],
|
82
|
+
**kwargs
|
83
|
+
)
|
43
84
|
headers = {
|
44
85
|
"Accept" => "application/json",
|
45
86
|
"Content-Type" => "application/json"
|
@@ -49,8 +90,15 @@ module Totvs
|
|
49
90
|
chave_publica: public_key,
|
50
91
|
chave_privada: private_key,
|
51
92
|
hostname: hostname,
|
52
|
-
ip: ip
|
53
|
-
|
93
|
+
ip: ip,
|
94
|
+
username: username,
|
95
|
+
fabricante: maker,
|
96
|
+
tipo: device_type,
|
97
|
+
modelo: device_model,
|
98
|
+
site: site,
|
99
|
+
tipo_senha: password_type,
|
100
|
+
tags: tags
|
101
|
+
}.merge(kwargs).delete_if { |_, value| value.nil? || value.empty? }
|
54
102
|
|
55
103
|
post path: build_path(id), body: body, headers: headers
|
56
104
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: totvs_password_vault
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Guilherme da Silva Mello
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oauth
|
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
version: '0'
|
155
155
|
requirements: []
|
156
156
|
rubyforge_project:
|
157
|
-
rubygems_version: 2.
|
157
|
+
rubygems_version: 2.4.5.1
|
158
158
|
signing_key:
|
159
159
|
specification_version: 4
|
160
160
|
summary: Totvs password vault manager.
|