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 +4 -4
- data/lib/duo-api.rb +4 -0
- data/lib/duo-api/client.rb +4 -0
- data/lib/duo-api/request.rb +4 -1
- data/lib/duo-api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49eebac2703d4d5d1aad07d23d483a34cc093a24
|
4
|
+
data.tar.gz: 204d20d9c551e540159c617fe6cd658ea5cbd3cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abfcac031b6f4abcd51499d52e46819c68613c1dcca717778de6028d5cbab43954bf26184d4d9826ab9fdf2526e67a790993f9a3b9ff616ee05e8dc9c62add7e
|
7
|
+
data.tar.gz: 8be61341d700ece319522d763b3a3d526af5525009f0f5dec325d21a126c3f9f432ec9b5d5af19c3fa55dc5c4996458a44d4b5f5dd8b12a9b90fb03880bfb55b
|
data/lib/duo-api.rb
CHANGED
data/lib/duo-api/client.rb
CHANGED
@@ -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
|
data/lib/duo-api/request.rb
CHANGED
@@ -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| "#{
|
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
|
data/lib/duo-api/version.rb
CHANGED
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.
|
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:
|
11
|
+
date: 2016-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|