peatio 0.4.2 → 0.4.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0571b3f094a51a7780a01511d2428918599c461c78620493099903613e88dd1
4
- data.tar.gz: 8bd678a3af4dee0e3108a070bd6a0e2e3891f1330c6b7c2f1a726e3b0fc9e07b
3
+ metadata.gz: 544f2e08a61c0d131a56d773a10f5ca00cc3f48fed002b29d03f12f74cb14408
4
+ data.tar.gz: bc924762a87b68999d9f69ffbbfb2244e9e27d93a009f90a3aa1fedc938a8390
5
5
  SHA512:
6
- metadata.gz: 0a29628f6043f5d93a08126f1f6643bd0f280ce04bdd4e3635ada713292064a0515d043053b146ec2594c08679382ab709348c4ce1abcba3fde6e231d7d4f0cc
7
- data.tar.gz: ba48681a96d5ec2b388a84efae83f6fc07de679bde9e3387da055eabc8e4fc9814ec58fcab848caea20e6732d2ef5b6180c92c34d1e7a9e77ad3771b1217761d
6
+ metadata.gz: e09bbcd7320c24252e9538b2b89afa1cc52b4b6926eb0ce9889177cba0459d9b89d0183e8b93cac3e7768cb03b24ac32a7cba43b0c771a8e71a6c655835f66c9
7
+ data.tar.gz: 0116a1991d8b7db0d1570ca0bb8a2a7849c701380f31d0ceb131ece9287572cfad6b8fb0892782dbe5ae2b39d512ae766d7a5c6eea189ee16f25a713c668163e
@@ -2,8 +2,16 @@ sudo: false
2
2
  language: ruby
3
3
  cache: bundler
4
4
  rvm:
5
- - 2.5.1
6
- before_install: gem install bundler -v 1.16.3
5
+ - 2.5.3
6
+ before_install: gem install bundler -v 1.17.1
7
7
  env:
8
- - WEBSOCKET_HOST: localhost
9
- WEBSOCKET_PORT: 8081
8
+ - WEBSOCKET_HOST: localhost
9
+ WEBSOCKET_PORT: 8081
10
+ deploy:
11
+ provider: rubygems
12
+ api_key:
13
+ secure: MTlSs+/1/+djQBx9UpZBoPdkLb9j9tx31CxoJ2uw3a429cj9qhJc+qZL9Gbim4kqdDhWAlfIFKDn2aeVPHIcd3VAP3dBUkG2gMxC440gx7rBJXSGpo+zwS9pnsFNQb9RnFZ4OI0dDr0VvYyctZh2h4VVTKhP2m7U59A6yNeNhW8K5HzUZ3+QvykiEQVQUrT29BRpf+9vEISVDPk3o0S0HO+RRvWXOBe5F2M/5hhJUdxUZ2/Pikg3PFJGhS1+g23YhLiEvMN6TiHz/PbUdLN1hnAVgmE86t/DU2lRzhDHNX3CetEhEhtElkTlbpIitmfy8309G0lUMZkN4Z6qKjuYKjuGYXYjXS6nEq6oy5U0HK2Ljo6ka4WZC5u08t5+I12jzCJ5Nq3kdqJkYZwMODgzvcyw4EKNHejyYLGGIbrXgbuYtR6wwvIYz7hz/j/fFxFDawBYC9s92/gvthtHNTzosBi/I07DYYhdF7Rt4TMfdPpasctV8ijTQ+ePH76cNPaDBqupemZUMSJRuuPOXS8SXS1xLDrPviffok/a3zmHDHgYWjqqBzktjCZ5C2PIeVo3o+ClSiWu8tJ3UquqdQ2ug60LK6ttbKxvDk/De3JcV4SEpqJBroSWD84hp0IiyQMEAhl/SxCVLXn9m5xF3evqH168p/Tgr5pklFUDw/tpSh8=
14
+ gem: peatio
15
+ on:
16
+ tags: true
17
+ repo: rubykube/peatio-core
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- peatio (0.4.2)
4
+ peatio (0.4.4)
5
5
  amqp
6
6
  bunny
7
7
  clamp
@@ -18,8 +18,9 @@ GEM
18
18
  amq-protocol (>= 2.2.0)
19
19
  eventmachine
20
20
  ast (2.4.0)
21
- bunny (2.11.0)
22
- amq-protocol (~> 2.3.0)
21
+ bump (0.6.1)
22
+ bunny (2.12.0)
23
+ amq-protocol (~> 2.3, >= 2.3.0)
23
24
  bunny-mock (1.7.0)
24
25
  bunny (>= 1.7)
25
26
  clamp (1.3.0)
@@ -51,7 +52,7 @@ GEM
51
52
  rspec-mocks (~> 3.8.0)
52
53
  rspec-core (3.8.0)
53
54
  rspec-support (~> 3.8.0)
54
- rspec-expectations (3.8.1)
55
+ rspec-expectations (3.8.2)
55
56
  diff-lcs (>= 1.2.0, < 2.0)
56
57
  rspec-support (~> 3.8.0)
57
58
  rspec-mocks (3.8.0)
@@ -60,16 +61,16 @@ GEM
60
61
  rspec-support (3.8.0)
61
62
  rspec_junit_formatter (0.4.1)
62
63
  rspec-core (>= 2, < 4, != 2.12.0)
63
- rubocop (0.58.2)
64
+ rubocop (0.60.0)
64
65
  jaro_winkler (~> 1.5.1)
65
66
  parallel (~> 1.10)
66
67
  parser (>= 2.5, != 2.5.1.1)
67
68
  powerpack (~> 0.1)
68
69
  rainbow (>= 2.2.2, < 4.0)
69
70
  ruby-progressbar (~> 1.7)
70
- unicode-display_width (~> 1.0, >= 1.0.1)
71
- rubocop-github (0.10.0)
72
- rubocop (~> 0.51)
71
+ unicode-display_width (~> 1.4.0)
72
+ rubocop-github (0.12.0)
73
+ rubocop (~> 0.59)
73
74
  ruby-progressbar (1.10.0)
74
75
  simplecov (0.16.1)
75
76
  docile (~> 1.1)
@@ -86,6 +87,7 @@ PLATFORMS
86
87
  ruby
87
88
 
88
89
  DEPENDENCIES
90
+ bump
89
91
  bundler (~> 1.16)
90
92
  bunny-mock
91
93
  em-spec
@@ -99,4 +101,4 @@ DEPENDENCIES
99
101
  simplecov-json
100
102
 
101
103
  BUNDLED WITH
102
- 1.16.4
104
+ 1.17.1
@@ -15,5 +15,6 @@ module Peatio
15
15
  require_relative "peatio/mq/events"
16
16
  require_relative "peatio/ranger"
17
17
  require_relative "peatio/injectors/peatio_events"
18
+ require_relative "peatio/security/key_generator"
18
19
  require_relative "peatio/auth/jwt_authenticator"
19
20
  end
@@ -3,6 +3,7 @@ require "peatio/command/service"
3
3
  require "peatio/command/db"
4
4
  require "peatio/command/amqp"
5
5
  require "peatio/command/inject"
6
+ require "peatio/command/security"
6
7
 
7
8
  module Peatio
8
9
  class Root < Command::Base
@@ -10,5 +11,6 @@ module Peatio
10
11
  subcommand "db", "Database related sub-commands", Peatio::Command::DB::Root
11
12
  subcommand "service", "Services management related sub-commands", Peatio::Command::Service::Root
12
13
  subcommand "inject", "Data injectors", Peatio::Command::Inject
14
+ subcommand "security", "Security management related sub-commands", Peatio::Command::Security
13
15
  end
14
16
  end
@@ -0,0 +1,30 @@
1
+ require 'base64'
2
+
3
+ module Peatio::Command
4
+ class Security < Peatio::Command::Base
5
+ class KeyGenerator < Peatio::Command::Base
6
+ option "--print", :flag, "print on screen"
7
+ option "--path", "FOLDER", "save keypair into folder", default: "secrets"
8
+
9
+ def execute
10
+ keypair = Peatio::Security::KeyGenerator.new
11
+
12
+ if print?
13
+ puts keypair.private, keypair.public
14
+ puts "-----BASE64 ENCODED-----"
15
+ puts Base64.urlsafe_encode64(keypair.public)
16
+ else
17
+ begin
18
+ keypair.save(path)
19
+ puts "Files saved in #{File.join(path, 'rsa-key')}"
20
+
21
+ rescue IOError => e
22
+ abort('Failed saving files')
23
+ end
24
+ end
25
+ end
26
+ end
27
+
28
+ subcommand "keygen", "Generate a public private rsa key pair", KeyGenerator
29
+ end
30
+ end
@@ -0,0 +1,26 @@
1
+ require 'fileutils'
2
+
3
+ module Peatio::Security
4
+ class KeyGenerator
5
+
6
+ attr_reader :public, :private
7
+
8
+ def initialize
9
+ OpenSSL::PKey::RSA.generate(2048).tap do |pkey|
10
+ @public = pkey.public_key.to_pem
11
+ @private = pkey.to_pem
12
+ end
13
+ end
14
+
15
+ def save(folder)
16
+ FileUtils.mkdir_p(folder) unless File.exists?(folder)
17
+
18
+ write(File.join(folder, 'rsa-key'), @private)
19
+ write(File.join(folder, 'rsa-key.pub'), @public)
20
+ end
21
+
22
+ def write(filename, text)
23
+ File.open(filename, 'w') { |file| file.write(text) }
24
+ end
25
+ end
26
+ end
@@ -1,3 +1,3 @@
1
1
  module Peatio
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.4"
3
3
  end
@@ -33,6 +33,7 @@ Gem::Specification.new do |spec|
33
33
  spec.add_development_dependency "bundler", "~> 1.16"
34
34
  spec.add_development_dependency "rake", "~> 10.0"
35
35
  spec.add_development_dependency "rspec", "~> 3.0"
36
+ spec.add_development_dependency "bump"
36
37
  spec.add_development_dependency "em-spec"
37
38
  spec.add_development_dependency "em-websocket-client"
38
39
  spec.add_development_dependency "bunny-mock"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peatio
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Louis B.
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-08-29 00:00:00.000000000 Z
12
+ date: 2018-10-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: clamp
@@ -151,6 +151,20 @@ dependencies:
151
151
  - - "~>"
152
152
  - !ruby/object:Gem::Version
153
153
  version: '3.0'
154
+ - !ruby/object:Gem::Dependency
155
+ name: bump
156
+ requirement: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - ">="
159
+ - !ruby/object:Gem::Version
160
+ version: '0'
161
+ type: :development
162
+ prerelease: false
163
+ version_requirements: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - ">="
166
+ - !ruby/object:Gem::Version
167
+ version: '0'
154
168
  - !ruby/object:Gem::Dependency
155
169
  name: em-spec
156
170
  requirement: !ruby/object:Gem::Requirement
@@ -279,6 +293,7 @@ files:
279
293
  - lib/peatio/command/db.rb
280
294
  - lib/peatio/command/inject.rb
281
295
  - lib/peatio/command/root.rb
296
+ - lib/peatio/command/security.rb
282
297
  - lib/peatio/command/service.rb
283
298
  - lib/peatio/error.rb
284
299
  - lib/peatio/executor.rb
@@ -287,6 +302,7 @@ files:
287
302
  - lib/peatio/mq/client.rb
288
303
  - lib/peatio/mq/events.rb
289
304
  - lib/peatio/ranger.rb
305
+ - lib/peatio/security/key_generator.rb
290
306
  - lib/peatio/sql/client.rb
291
307
  - lib/peatio/sql/schema.rb
292
308
  - lib/peatio/version.rb