canzea 0.1.61 → 0.1.62

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
  SHA1:
3
- metadata.gz: e43ec6fb5b900370eee107efc7c63a3df04d68ad
4
- data.tar.gz: 669ff02f30f31302e0e26d21ce27140d2c13bcb5
3
+ metadata.gz: bb44f9067f408cf0b656946739909340a8c088b4
4
+ data.tar.gz: 1f90505fe1e573789d803605dabb6f2b693b071d
5
5
  SHA512:
6
- metadata.gz: 6659a1662fe46eee49a4eaafd7724161aea3d9ffe466b6fc1c86e91881f62f597eff4fcd202e3ff3500ab9b865932301cb3f2651d8f1bf1455a51b8c3d1606ae
7
- data.tar.gz: b42c8e053c1cd7c2b63d5b8dda0f13e8803e1e04d55b9366ecadab764c163e3372c0f1674b3e4aaf9b31b7658a3e31f3c7eb9ef92a962a9e7ac3bdc49d800d33
6
+ metadata.gz: 4ca31ef179903515d3eb58bfd5403031fa45bbba1e21b33e18ba5cb567fed97b582cfdb9defcf9d59c6c4f58c25765a04bb1afad784a4b688f534b4047e8170d
7
+ data.tar.gz: 1287ff526ac8cb0cbad7f8a6f34fc2956b94a827c0847ae29edf88d868b30efe675abce094289da78e9fba1ca64bd34a13302b393a4b12afec8a8d37ee3f178a
@@ -1,3 +1,3 @@
1
1
  module Canzea
2
- VERSION = "0.1.61"
2
+ VERSION = "0.1.62"
3
3
  end
data/lib/canzea.rb CHANGED
@@ -38,6 +38,8 @@ module Canzea
38
38
 
39
39
  flag nil, :pwd, 'PWD'
40
40
 
41
+ flag nil, :verbose, 'Verbose'
42
+
41
43
  # flag nil, :run, 'Run a step'
42
44
  # flag nil, :helper, 'Execute a helper'
43
45
  flag nil, :remote, 'Remote execution'
@@ -68,6 +70,7 @@ module Canzea
68
70
  option nil, :serverBase, 'Server Base', argument: :required
69
71
  option nil, :serverNumber, 'Server Number', argument: :required
70
72
  option nil, :privateKey, 'Task', argument: :required
73
+ option nil, :publicKey, 'Task', argument: :required
71
74
  option nil, :template, 'Template', argument: :required
72
75
 
73
76
  option nil, :action, 'Helper Action', argument: :required
@@ -84,7 +87,9 @@ module Canzea
84
87
 
85
88
  extraConfig = Canzea::config[:catalog_location] + "/config.json"
86
89
  if File.exists?(extraConfig)
87
- puts "-- Reading #{extraConfig}"
90
+ if (opts[:verbose])
91
+ puts "-- Reading #{extraConfig}"
92
+ end
88
93
  file = File.read(extraConfig)
89
94
  Canzea::configure JSON.parse(file)
90
95
  end
@@ -142,12 +147,12 @@ module Canzea
142
147
 
143
148
  if (opts[:encrypt])
144
149
  remote = RemoteCall.new
145
- remote.encrypt args[0]
150
+ remote.encrypt args[0], opts[:publicKey]
146
151
  end
147
152
 
148
153
  if (opts[:decrypt])
149
154
  remote = RemoteCall.new
150
- remote.decrypt args[0] opts[:privateKey]
155
+ remote.decrypt args[0], opts[:privateKey]
151
156
  end
152
157
 
153
158
  if (opts[:lifecycle])
@@ -42,19 +42,17 @@ class RemoteCall
42
42
  end
43
43
  end
44
44
 
45
- def encrypt (contents)
46
- puts "Encrypting #{contents}"
47
- pubkey_pem = File.read 'root_id_rsa.pem.pub'
45
+ def encrypt (contents, publicKey)
46
+ pubkey_pem = File.read publicKey
48
47
  key = OpenSSL::PKey::RSA.new pubkey_pem
49
- output = Base64.encode64 key.public_encrypt contents
48
+ output = Base64.urlsafe_encode64 key.public_encrypt contents
50
49
  puts output
51
50
  end
52
51
 
53
52
  def decrypt (contents, privateKey)
54
- puts "Decrypting #{contents}"
55
53
  privkey_pem = File.read privateKey
56
54
  key = OpenSSL::PKey::RSA.new privkey_pem
57
- output = key.private_decrypt Base64.decode64 contents
55
+ output = key.private_decrypt Base64.urlsafe_decode64 contents
58
56
  puts output
59
57
  end
60
58
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canzea
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.61
4
+ version: 0.1.62
5
5
  platform: ruby
6
6
  authors:
7
7
  - Canzea Technologies