duo-api 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71554b5609e1c4674d332173ce21d03c4441fff3
4
- data.tar.gz: cd297f5fc2d41665d8d0aad0981d8f412be564b7
3
+ metadata.gz: 49eebac2703d4d5d1aad07d23d483a34cc093a24
4
+ data.tar.gz: 204d20d9c551e540159c617fe6cd658ea5cbd3cb
5
5
  SHA512:
6
- metadata.gz: 0a25d9359410243eb792aa58fe7ef881a965bf2d2f003837566081141a81729b9c82d9c8d0bee2fed3d37a8ea4df37f599546c0c6efd4f518d4c0de84eb94192
7
- data.tar.gz: e6dd96ae343874f54f6f6f6f3a81374b5335711f241f6c1aa8aa0745894c50c9d841a6b15eb64ab4cecacb16d554f800884638c81787ed81df376e5faf854ca0
6
+ metadata.gz: abfcac031b6f4abcd51499d52e46819c68613c1dcca717778de6028d5cbab43954bf26184d4d9826ab9fdf2526e67a790993f9a3b9ff616ee05e8dc9c62add7e
7
+ data.tar.gz: 8be61341d700ece319522d763b3a3d526af5525009f0f5dec325d21a126c3f9f432ec9b5d5af19c3fa55dc5c4996458a44d4b5f5dd8b12a9b90fb03880bfb55b
@@ -31,6 +31,10 @@ module DuoApi
31
31
  client.post(*args)
32
32
  end
33
33
 
34
+ def self.delete(*args)
35
+ client.delete(*args)
36
+ end
37
+
34
38
  def self.request(*args)
35
39
  client.request(*args)
36
40
  end
@@ -28,6 +28,10 @@ module DuoApi
28
28
  Request.request(self, path, { :method => "POST" }.merge(options))
29
29
  end
30
30
 
31
+ def delete(path, options = {})
32
+ Request.request(self, path, { :method => "DELETE" }.merge(options))
33
+ end
34
+
31
35
  def sign(user_key)
32
36
  signer.sign(user_key)
33
37
  end
@@ -1,5 +1,6 @@
1
1
  require "net/http"
2
2
  require "time"
3
+ require "erb"
3
4
  require "duo-api/header_signature"
4
5
  require "duo-api/response"
5
6
  require "duo-api/util"
@@ -31,7 +32,7 @@ module DuoApi
31
32
  params = stringify_hash(params)
32
33
  @query_string = params.
33
34
  sort_by { |k| k }.
34
- map {|k,v| "#{URI.encode(k.to_s)}=#{URI.encode(v.to_s)}" }.
35
+ map {|k,v| "#{ERB::Util.url_encode(k.to_s)}=#{ERB::Util.url_encode(v.to_s)}" }.
35
36
  join("&")
36
37
 
37
38
  @signature = HeaderSignature.new(client, method, path, query_string)
@@ -92,6 +93,8 @@ module DuoApi
92
93
  Net::HTTP::Get
93
94
  when "POST"
94
95
  Net::HTTP::Post
96
+ when "DELETE"
97
+ Net::HTTP::Delete
95
98
  end
96
99
  end
97
100
  end
@@ -1,3 +1,3 @@
1
1
  module DuoApi
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: duo-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Phenow
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-16 00:00:00.000000000 Z
11
+ date: 2016-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler