cryptoform 0.1.0 → 0.4.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/.rubocop.yml +6 -1
- data/.tool-versions +1 -1
- data/Cryptofile +2 -7
- data/Gemfile +2 -0
- data/Gemfile.lock +46 -40
- data/README.md +4 -4
- data/exe/cryptoform +1 -7
- data/lib/cryptoform/application.rb +38 -0
- data/lib/cryptoform/config/builder.rb +6 -2
- data/lib/cryptoform/config/state_config_builder.rb +3 -1
- data/lib/cryptoform/encryption_backends/backend.rb +7 -2
- data/lib/cryptoform/encryption_backends/lockbox.rb +9 -3
- data/lib/cryptoform/server.rb +12 -43
- data/lib/cryptoform/storage_backends/backend.rb +7 -2
- data/lib/cryptoform/storage_backends/file.rb +6 -2
- data/lib/cryptoform/version.rb +1 -1
- data/lib/cryptoform.rb +4 -1
- data/terraform/backend.tf +1 -1
- metadata +60 -17
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2c6cc60c333e671e55fbfd296176c2ced70ac3b4fcb02123e1978935ee6de35e
|
|
4
|
+
data.tar.gz: 21c722a203ce621da18fea553a8c1723aa9c4b3357a562aa17a3c1b3d71442dc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ad46477f8340822cb0ece4cedb09f901e9bc12d35c463bb24cc55905d771b65c4fd19fc6c3cec8c8fd555581cd7b61de8b2d208f6615241d00280118960f47fb
|
|
7
|
+
data.tar.gz: 78ae779546f83c481e1c8566c33576c6996a93be972b5d33831616bc3141e7fef6bf16b11fcfe102020ec5140918d74ec9b71c22944d2777327c4eb69894f6bd
|
data/.rubocop.yml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
AllCops:
|
|
2
|
-
TargetRubyVersion: 3.
|
|
2
|
+
TargetRubyVersion: 3.2
|
|
3
3
|
NewCops: enable
|
|
4
4
|
SuggestExtensions: true
|
|
5
5
|
|
|
@@ -14,6 +14,11 @@ require:
|
|
|
14
14
|
- rubocop-performance
|
|
15
15
|
- rubocop-rspec
|
|
16
16
|
- rubocop-rake
|
|
17
|
+
- rubocop-disable_syntax
|
|
18
|
+
|
|
19
|
+
Style/DisableSyntax:
|
|
20
|
+
DisableSyntax:
|
|
21
|
+
- endless_methods
|
|
17
22
|
|
|
18
23
|
Layout/LineLength:
|
|
19
24
|
Max: 120
|
data/.tool-versions
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
ruby 3.
|
|
1
|
+
ruby 3.2.4
|
|
2
2
|
terraform 1.9.2
|
data/Cryptofile
CHANGED
|
@@ -2,12 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
port 3000
|
|
4
4
|
|
|
5
|
-
state :
|
|
6
|
-
storage_backend :file
|
|
7
|
-
encryption_backend :lockbox, key: -> { ENV.fetch("CRYPTOFORM_KEY") }
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
state :state2 do
|
|
11
|
-
storage_backend :file, name: "state2.tfstate.enc"
|
|
5
|
+
state :state do
|
|
6
|
+
storage_backend :file
|
|
12
7
|
encryption_backend :lockbox, key: -> { ENV.fetch("CRYPTOFORM_KEY") }
|
|
13
8
|
end
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,49 +1,27 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
cryptoform (0.
|
|
5
|
-
async-http (~> 0.69)
|
|
4
|
+
cryptoform (0.4.0)
|
|
6
5
|
base64 (~> 0.2)
|
|
7
6
|
lockbox (~> 1.3)
|
|
7
|
+
rackup (~> 2.1)
|
|
8
|
+
sinatra (~> 4.0)
|
|
9
|
+
sinatra-contrib (~> 4.0)
|
|
10
|
+
webrick (~> 1.8)
|
|
8
11
|
zeitwerk (~> 2.6)
|
|
9
12
|
|
|
10
13
|
GEM
|
|
11
14
|
remote: https://rubygems.org/
|
|
12
15
|
specs:
|
|
13
16
|
ast (2.4.2)
|
|
14
|
-
async (2.12.1)
|
|
15
|
-
console (~> 1.25, >= 1.25.2)
|
|
16
|
-
fiber-annotation
|
|
17
|
-
io-event (~> 1.6, >= 1.6.5)
|
|
18
|
-
async-http (0.69.0)
|
|
19
|
-
async (>= 2.10.2)
|
|
20
|
-
async-pool (~> 0.7)
|
|
21
|
-
io-endpoint (~> 0.11)
|
|
22
|
-
io-stream (~> 0.4)
|
|
23
|
-
protocol-http (~> 0.26)
|
|
24
|
-
protocol-http1 (~> 0.19)
|
|
25
|
-
protocol-http2 (~> 0.18)
|
|
26
|
-
traces (>= 0.10)
|
|
27
|
-
async-pool (0.7.0)
|
|
28
|
-
async (>= 1.25)
|
|
29
17
|
backport (1.2.0)
|
|
30
18
|
base64 (0.2.0)
|
|
31
19
|
benchmark (0.3.0)
|
|
32
20
|
childprocess (5.0.0)
|
|
33
|
-
console (1.25.2)
|
|
34
|
-
fiber-annotation
|
|
35
|
-
fiber-local (~> 1.1)
|
|
36
|
-
json
|
|
37
21
|
diff-lcs (1.5.1)
|
|
22
|
+
docile (1.4.0)
|
|
38
23
|
e2mmap (0.1.0)
|
|
39
|
-
fiber-annotation (0.2.0)
|
|
40
|
-
fiber-local (1.1.0)
|
|
41
|
-
fiber-storage
|
|
42
|
-
fiber-storage (0.1.2)
|
|
43
24
|
iniparse (1.5.0)
|
|
44
|
-
io-endpoint (0.11.0)
|
|
45
|
-
io-event (1.6.5)
|
|
46
|
-
io-stream (0.4.0)
|
|
47
25
|
jaro_winkler (1.6.0)
|
|
48
26
|
json (2.7.2)
|
|
49
27
|
kramdown (2.4.0)
|
|
@@ -53,6 +31,9 @@ GEM
|
|
|
53
31
|
language_server-protocol (3.17.0.3)
|
|
54
32
|
lockbox (1.3.3)
|
|
55
33
|
mini_portile2 (2.8.7)
|
|
34
|
+
multi_json (1.15.0)
|
|
35
|
+
mustermann (3.0.0)
|
|
36
|
+
ruby2_keywords (~> 0.0.1)
|
|
56
37
|
nokogiri (1.16.6)
|
|
57
38
|
mini_portile2 (~> 2.8.2)
|
|
58
39
|
racc (~> 1.4)
|
|
@@ -63,17 +44,19 @@ GEM
|
|
|
63
44
|
iniparse (~> 1.4)
|
|
64
45
|
rexml (~> 3.2)
|
|
65
46
|
parallel (1.25.1)
|
|
66
|
-
parser (3.3.
|
|
47
|
+
parser (3.3.4.0)
|
|
67
48
|
ast (~> 2.4.1)
|
|
68
49
|
racc
|
|
69
|
-
protocol-hpack (1.4.3)
|
|
70
|
-
protocol-http (0.26.8)
|
|
71
|
-
protocol-http1 (0.19.1)
|
|
72
|
-
protocol-http (~> 0.22)
|
|
73
|
-
protocol-http2 (0.18.0)
|
|
74
|
-
protocol-hpack (~> 1.4)
|
|
75
|
-
protocol-http (~> 0.18)
|
|
76
50
|
racc (1.8.0)
|
|
51
|
+
rack (3.1.7)
|
|
52
|
+
rack-protection (4.0.0)
|
|
53
|
+
base64 (>= 0.1.0)
|
|
54
|
+
rack (>= 3.0.0, < 4)
|
|
55
|
+
rack-session (2.0.0)
|
|
56
|
+
rack (>= 3.0.0)
|
|
57
|
+
rackup (2.1.0)
|
|
58
|
+
rack (>= 3)
|
|
59
|
+
webrick (~> 1.8)
|
|
77
60
|
rainbow (3.1.1)
|
|
78
61
|
rake (13.2.1)
|
|
79
62
|
rbs (2.8.4)
|
|
@@ -95,27 +78,48 @@ GEM
|
|
|
95
78
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
96
79
|
rspec-support (~> 3.13.0)
|
|
97
80
|
rspec-support (3.13.1)
|
|
98
|
-
rubocop (1.
|
|
81
|
+
rubocop (1.65.0)
|
|
99
82
|
json (~> 2.3)
|
|
100
83
|
language_server-protocol (>= 3.17.0)
|
|
101
84
|
parallel (~> 1.10)
|
|
102
85
|
parser (>= 3.3.0.2)
|
|
103
86
|
rainbow (>= 2.2.2, < 4.0)
|
|
104
|
-
regexp_parser (>=
|
|
87
|
+
regexp_parser (>= 2.4, < 3.0)
|
|
105
88
|
rexml (>= 3.2.5, < 4.0)
|
|
106
89
|
rubocop-ast (>= 1.31.1, < 2.0)
|
|
107
90
|
ruby-progressbar (~> 1.7)
|
|
108
91
|
unicode-display_width (>= 2.4.0, < 3.0)
|
|
109
92
|
rubocop-ast (1.31.3)
|
|
110
93
|
parser (>= 3.3.1.0)
|
|
94
|
+
rubocop-disable_syntax (0.1.1)
|
|
95
|
+
rubocop (>= 1.50)
|
|
111
96
|
rubocop-performance (1.21.1)
|
|
112
97
|
rubocop (>= 1.48.1, < 2.0)
|
|
113
98
|
rubocop-ast (>= 1.31.1, < 2.0)
|
|
114
99
|
rubocop-rake (0.6.0)
|
|
115
100
|
rubocop (~> 1.0)
|
|
116
|
-
rubocop-rspec (3.0.
|
|
101
|
+
rubocop-rspec (3.0.3)
|
|
117
102
|
rubocop (~> 1.61)
|
|
118
103
|
ruby-progressbar (1.13.0)
|
|
104
|
+
ruby2_keywords (0.0.5)
|
|
105
|
+
simplecov (0.22.0)
|
|
106
|
+
docile (~> 1.1)
|
|
107
|
+
simplecov-html (~> 0.11)
|
|
108
|
+
simplecov_json_formatter (~> 0.1)
|
|
109
|
+
simplecov-html (0.12.3)
|
|
110
|
+
simplecov_json_formatter (0.1.4)
|
|
111
|
+
sinatra (4.0.0)
|
|
112
|
+
mustermann (~> 3.0)
|
|
113
|
+
rack (>= 3.0.0, < 4)
|
|
114
|
+
rack-protection (= 4.0.0)
|
|
115
|
+
rack-session (>= 2.0.0, < 3)
|
|
116
|
+
tilt (~> 2.0)
|
|
117
|
+
sinatra-contrib (4.0.0)
|
|
118
|
+
multi_json (>= 0.0.2)
|
|
119
|
+
mustermann (~> 3.0)
|
|
120
|
+
rack-protection (= 4.0.0)
|
|
121
|
+
sinatra (= 4.0.0)
|
|
122
|
+
tilt (~> 2.0)
|
|
119
123
|
solargraph (0.50.0)
|
|
120
124
|
backport (~> 1.2)
|
|
121
125
|
benchmark
|
|
@@ -135,8 +139,8 @@ GEM
|
|
|
135
139
|
strscan (3.1.0)
|
|
136
140
|
thor (1.3.1)
|
|
137
141
|
tilt (2.4.0)
|
|
138
|
-
traces (0.11.1)
|
|
139
142
|
unicode-display_width (2.5.0)
|
|
143
|
+
webrick (1.8.1)
|
|
140
144
|
yard (0.9.36)
|
|
141
145
|
zeitwerk (2.6.16)
|
|
142
146
|
|
|
@@ -150,9 +154,11 @@ DEPENDENCIES
|
|
|
150
154
|
rake
|
|
151
155
|
rspec
|
|
152
156
|
rubocop
|
|
157
|
+
rubocop-disable_syntax
|
|
153
158
|
rubocop-performance
|
|
154
159
|
rubocop-rake
|
|
155
160
|
rubocop-rspec
|
|
161
|
+
simplecov
|
|
156
162
|
solargraph
|
|
157
163
|
|
|
158
164
|
BUNDLED WITH
|
data/README.md
CHANGED
|
@@ -15,7 +15,7 @@ bother configuring an external state store.
|
|
|
15
15
|
|
|
16
16
|
## Installation
|
|
17
17
|
|
|
18
|
-
1. Install one of supported ruby versions: 3.
|
|
18
|
+
1. Install one of supported ruby versions: 3.2 or newer
|
|
19
19
|
2. In your terraform project, create 2 files:
|
|
20
20
|
|
|
21
21
|
*Gemfile*:
|
|
@@ -33,7 +33,7 @@ bother configuring an external state store.
|
|
|
33
33
|
```hcl
|
|
34
34
|
terraform {
|
|
35
35
|
backend "http" {
|
|
36
|
-
address = "http://127.0.0.1:3000/state"
|
|
36
|
+
address = "http://127.0.0.1:3000/states/state"
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
```
|
|
@@ -52,7 +52,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
|
52
52
|
|
|
53
53
|
## Contributing
|
|
54
54
|
|
|
55
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
|
55
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/zhulik/cryptoform. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/zhulik/cryptoform/blob/main/CODE_OF_CONDUCT.md).
|
|
56
56
|
|
|
57
57
|
## License
|
|
58
58
|
|
|
@@ -60,4 +60,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
|
60
60
|
|
|
61
61
|
## Code of Conduct
|
|
62
62
|
|
|
63
|
-
Everyone interacting in the Cryptoform project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
|
63
|
+
Everyone interacting in the Cryptoform project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/zhulik/cryptoform/blob/main/CODE_OF_CONDUCT.md).
|
data/exe/cryptoform
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class Cryptoform::Application < Sinatra::Application
|
|
4
|
+
set :show_exceptions, false
|
|
5
|
+
|
|
6
|
+
def initialize(config)
|
|
7
|
+
super
|
|
8
|
+
@states = config.states
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
get "/states/:name" do
|
|
12
|
+
state = state_config.encryption_backend.decrypt(state_config.storage_backend.read)
|
|
13
|
+
json(state)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
post "/states/:name" do
|
|
17
|
+
state = JSON.parse(request.body.read)
|
|
18
|
+
state_config.storage_backend.write(state_config.encryption_backend.encrypt(state))
|
|
19
|
+
json(state)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
error Cryptoform::StateMissingError do |e|
|
|
23
|
+
status 404
|
|
24
|
+
json(error: e.message)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
error Sinatra::NotFound do |e|
|
|
28
|
+
status 404
|
|
29
|
+
json(error: e.message)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
private
|
|
33
|
+
|
|
34
|
+
def state_config
|
|
35
|
+
name = params[:name].to_sym
|
|
36
|
+
@states[name] || raise(Sinatra::NotFound, "state #{name} is not configured in Cryptofile")
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -8,7 +8,9 @@ class Cryptoform::Config::Builder
|
|
|
8
8
|
@states = {}
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def port(port)
|
|
11
|
+
def port(port)
|
|
12
|
+
@port = port
|
|
13
|
+
end
|
|
12
14
|
|
|
13
15
|
def state(name, &)
|
|
14
16
|
name = name.to_sym
|
|
@@ -24,5 +26,7 @@ class Cryptoform::Config::Builder
|
|
|
24
26
|
raise Cryptoform::ConfigValidationError, "port must be an integer" if @key.is_a?(Numeric)
|
|
25
27
|
end
|
|
26
28
|
|
|
27
|
-
def config
|
|
29
|
+
def config
|
|
30
|
+
Config.new(@port, @states.transform_values(&:config))
|
|
31
|
+
end
|
|
28
32
|
end
|
|
@@ -31,7 +31,9 @@ class Cryptoform::Config::StateConfigBuilder
|
|
|
31
31
|
@encryption_backend = ENCRYPTION_BACKENDS[name].new(@name, **params)
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
-
def config
|
|
34
|
+
def config
|
|
35
|
+
Config.new(@storage_backend, @encryption_backend)
|
|
36
|
+
end
|
|
35
37
|
|
|
36
38
|
def validate!
|
|
37
39
|
if @storage_backend.nil?
|
|
@@ -6,6 +6,11 @@ class Cryptoform::EncryptionBackends::Backend
|
|
|
6
6
|
@params = params
|
|
7
7
|
end
|
|
8
8
|
|
|
9
|
-
def decrypt(ciphertext)
|
|
10
|
-
|
|
9
|
+
def decrypt(ciphertext)
|
|
10
|
+
raise NotImplementedError
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def encrypt(json)
|
|
14
|
+
raise NotImplementedError
|
|
15
|
+
end
|
|
11
16
|
end
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
class Cryptoform::EncryptionBackends::Lockbox < Cryptoform::EncryptionBackends::Backend
|
|
4
|
-
def encrypt(json)
|
|
4
|
+
def encrypt(json)
|
|
5
|
+
lockbox.encrypt(json.to_json)
|
|
6
|
+
end
|
|
5
7
|
|
|
6
|
-
def decrypt(ciphertext)
|
|
8
|
+
def decrypt(ciphertext)
|
|
9
|
+
JSON.parse(lockbox.decrypt(ciphertext))
|
|
10
|
+
end
|
|
7
11
|
|
|
8
|
-
def lockbox
|
|
12
|
+
def lockbox
|
|
13
|
+
::Lockbox.new(key: @params[:key].call, encode: true)
|
|
14
|
+
end
|
|
9
15
|
end
|
data/lib/cryptoform/server.rb
CHANGED
|
@@ -2,51 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
class Cryptoform::Server
|
|
4
4
|
def initialize(config)
|
|
5
|
-
@
|
|
5
|
+
@server = WEBrick::HTTPServer.new(
|
|
6
|
+
Port: config.port,
|
|
7
|
+
BindAddress: "0.0.0.0",
|
|
8
|
+
AccessLog: [
|
|
9
|
+
[$stdout, WEBrick::AccessLog::COMMON_LOG_FORMAT],
|
|
10
|
+
[$stdout, WEBrick::AccessLog::REFERER_LOG_FORMAT]
|
|
11
|
+
]
|
|
12
|
+
)
|
|
13
|
+
trap("INT") { @server.shutdown }
|
|
14
|
+
|
|
15
|
+
@server.mount("/", Rackup::Handler::WEBrick, Cryptoform::Application.new(config))
|
|
6
16
|
end
|
|
7
17
|
|
|
8
18
|
def run
|
|
9
|
-
|
|
10
|
-
Async::HTTP::Server.for(endpoint) do |request|
|
|
11
|
-
log_request(request) { handle_request(request) }
|
|
12
|
-
end.run
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
private
|
|
16
|
-
|
|
17
|
-
def handle_request(request) # rubocop:disable Metrics/AbcSize
|
|
18
|
-
name = request.path.split("/")&.[](1)&.to_sym
|
|
19
|
-
return ::Protocol::HTTP::Response[404, {}, []] unless @config.states.key?(name)
|
|
20
|
-
|
|
21
|
-
handler_name = :"#{request.method.downcase}_state"
|
|
22
|
-
return ::Protocol::HTTP::Response[405, {}, []] unless respond_to?(handler_name, true)
|
|
23
|
-
|
|
24
|
-
send(handler_name, @config.states[name], request:)
|
|
25
|
-
rescue Cryptoform::StateMissingError
|
|
26
|
-
::Protocol::HTTP::Response[404, {}, []]
|
|
27
|
-
rescue StandardError => e
|
|
28
|
-
logger.error(e)
|
|
29
|
-
::Protocol::HTTP::Response[500, {}, []]
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
def get_state(state_config, *)
|
|
33
|
-
state = state_config.encryption_backend.decrypt(state_config.storage_backend.read)
|
|
34
|
-
::Protocol::HTTP::Response[200, {}, [JSON.pretty_generate(state)]]
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
def post_state(state_config, request:)
|
|
38
|
-
state_config.storage_backend.write(state_config.encryption_backend.encrypt(request.body.read))
|
|
39
|
-
|
|
40
|
-
::Protocol::HTTP::Response[201, {}, []]
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
def logger = @logger ||= Logger.new($stdout)
|
|
44
|
-
|
|
45
|
-
def endpoint = @endpoint ||= Async::HTTP::Endpoint.parse("http://localhost:#{@config.port}")
|
|
46
|
-
|
|
47
|
-
def log_request(request)
|
|
48
|
-
yield.tap do |response|
|
|
49
|
-
logger.info { "#{request.method} #{request.path}: #{response.status}" }
|
|
50
|
-
end
|
|
19
|
+
@server.start
|
|
51
20
|
end
|
|
52
21
|
end
|
|
@@ -6,6 +6,11 @@ class Cryptoform::StorageBackends::Backend
|
|
|
6
6
|
@params = params
|
|
7
7
|
end
|
|
8
8
|
|
|
9
|
-
def read
|
|
10
|
-
|
|
9
|
+
def read
|
|
10
|
+
raise NotImplementedError
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def write(data)
|
|
14
|
+
raise NotImplementedError
|
|
15
|
+
end
|
|
11
16
|
end
|
|
@@ -7,9 +7,13 @@ class Cryptoform::StorageBackends::File < Cryptoform::StorageBackends::Backend
|
|
|
7
7
|
raise Cryptoform::StateMissingError, "state '#{@state_name}' is configured but missing"
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
def write(data)
|
|
10
|
+
def write(data)
|
|
11
|
+
::File.write(filename, data)
|
|
12
|
+
end
|
|
11
13
|
|
|
12
14
|
private
|
|
13
15
|
|
|
14
|
-
def filename
|
|
16
|
+
def filename
|
|
17
|
+
@filename ||= @params[:name] || "#{@state_name}.tfstate.enc"
|
|
18
|
+
end
|
|
15
19
|
end
|
data/lib/cryptoform/version.rb
CHANGED
data/lib/cryptoform.rb
CHANGED
data/terraform/backend.tf
CHANGED
metadata
CHANGED
|
@@ -1,57 +1,99 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cryptoform
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gleb Sinyavskiy
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-07-
|
|
11
|
+
date: 2024-07-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name:
|
|
14
|
+
name: base64
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '0.
|
|
19
|
+
version: '0.2'
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '0.
|
|
26
|
+
version: '0.2'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name:
|
|
28
|
+
name: lockbox
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
31
|
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
33
|
+
version: '1.3'
|
|
34
34
|
type: :runtime
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
38
|
- - "~>"
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
40
|
+
version: '1.3'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
42
|
+
name: rackup
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
45
|
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '1
|
|
47
|
+
version: '2.1'
|
|
48
48
|
type: :runtime
|
|
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: '1
|
|
54
|
+
version: '2.1'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: sinatra
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '4.0'
|
|
62
|
+
type: :runtime
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - "~>"
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '4.0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: sinatra-contrib
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - "~>"
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '4.0'
|
|
76
|
+
type: :runtime
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - "~>"
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '4.0'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: webrick
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - "~>"
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '1.8'
|
|
90
|
+
type: :runtime
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - "~>"
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '1.8'
|
|
55
97
|
- !ruby/object:Gem::Dependency
|
|
56
98
|
name: zeitwerk
|
|
57
99
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -87,6 +129,7 @@ files:
|
|
|
87
129
|
- Rakefile
|
|
88
130
|
- exe/cryptoform
|
|
89
131
|
- lib/cryptoform.rb
|
|
132
|
+
- lib/cryptoform/application.rb
|
|
90
133
|
- lib/cryptoform/config/builder.rb
|
|
91
134
|
- lib/cryptoform/config/state_config_builder.rb
|
|
92
135
|
- lib/cryptoform/encryption_backends/backend.rb
|
|
@@ -105,9 +148,9 @@ licenses:
|
|
|
105
148
|
metadata:
|
|
106
149
|
homepage_uri: https://github.com/zhulik/cryptoform
|
|
107
150
|
source_code_uri: https://github.com/zhulik/cryptoform
|
|
108
|
-
changelog_uri: https://github.com/zhulik/cryptoform
|
|
151
|
+
changelog_uri: https://github.com/zhulik/cryptoform/releases
|
|
109
152
|
rubygems_mfa_required: 'true'
|
|
110
|
-
post_install_message:
|
|
153
|
+
post_install_message:
|
|
111
154
|
rdoc_options: []
|
|
112
155
|
require_paths:
|
|
113
156
|
- lib
|
|
@@ -115,15 +158,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
115
158
|
requirements:
|
|
116
159
|
- - ">="
|
|
117
160
|
- !ruby/object:Gem::Version
|
|
118
|
-
version: 3.
|
|
161
|
+
version: 3.2.0
|
|
119
162
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
163
|
requirements:
|
|
121
164
|
- - ">="
|
|
122
165
|
- !ruby/object:Gem::Version
|
|
123
166
|
version: '0'
|
|
124
167
|
requirements: []
|
|
125
|
-
rubygems_version: 3.
|
|
126
|
-
signing_key:
|
|
168
|
+
rubygems_version: 3.5.11
|
|
169
|
+
signing_key:
|
|
127
170
|
specification_version: 4
|
|
128
171
|
summary: Save your encypted terraform state in git.
|
|
129
172
|
test_files: []
|