onetime 0.5.0 → 0.5.1

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.
data.tar.gz.sig CHANGED
Binary file
@@ -1,5 +1,9 @@
1
1
  ONETIME, CHANGES
2
2
 
3
+ #### 0.5.1 (2013-02-12) ###############################
4
+
5
+ * ADDED: global recipient parameter for 'generate' and 'share' commands.
6
+
3
7
  #### 0.5.0 (2013-02-12) ###############################
4
8
 
5
9
  * ADDED: Support for getting secrets based on the URI
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.5.1
@@ -17,6 +17,8 @@ class Onetime::CLI
17
17
  global :c, :custid, String, "Customer ID (e.g. you@yourcompany.com)"
18
18
  global :k, :apikey, String, "API key (e.g. 4eb33c6340006d6607c813fc7e707a32f8bf5342)"
19
19
 
20
+ global :r, :recipient, Array, "Email address to deliver the secret link"
21
+
20
22
  global :f, :format, String, "Output format (json or yaml)"
21
23
  global :j, :json, "Shorthand for -f json"
22
24
  global :y, :yaml, "Shorthand for -f yaml"
@@ -123,6 +125,7 @@ class Onetime::CLI
123
125
  option :p, :passphrase, String, "Passphrase to encrypt the secret (something only you and recipient know)"
124
126
  option :r, :recipient, Array, "Email address to deliver the secret link"
125
127
  command :share do |obj|
128
+ recipients = [obj.option.recipient, obj.global.recipient].flatten.compact.uniq
126
129
  begin
127
130
  if Kernel.select [$stdin], nil, nil, 0
128
131
  secret_value = STDIN.read
@@ -136,7 +139,7 @@ class Onetime::CLI
136
139
  exit 0
137
140
  end
138
141
  raise RuntimeError, "No secret provided" if secret_value.chomp.empty?
139
- opts = { :secret => secret_value, :ttl => obj.option.ttl, :recipient => obj.option.recipient }
142
+ opts = { :secret => secret_value, :ttl => obj.option.ttl, :recipient => recipients }
140
143
  opts[:passphrase] = obj.option.passphrase if obj.option.passphrase
141
144
  @res = @api.post '/share', opts
142
145
  if @res.nil?
@@ -165,7 +168,8 @@ class Onetime::CLI
165
168
  option :p, :passphrase, String, "Passphrase to encrypt the secret (something only you and recipient know)"
166
169
  option :r, :recipient, Array, "Email address to deliver the secret link"
167
170
  command :generate do |obj|
168
- opts = { :ttl => obj.option.ttl, :recipient => obj.option.recipient }
171
+ recipients = [obj.option.recipient, obj.global.recipient].flatten.compact.uniq
172
+ opts = { :ttl => obj.option.ttl, :recipient => recipients }
169
173
  opts[:passphrase] = obj.option.passphrase if obj.option.passphrase
170
174
  @res = @api.post '/generate', opts
171
175
  if @res.nil?
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "onetime"
8
- s.version = "0.5.0"
8
+ s.version = "0.5.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Delano Mandelbaum"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onetime
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
metadata.gz.sig CHANGED
Binary file