plivo 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/ext/mkrf_conf.rb +9 -0
- data/lib/plivo.rb +19 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d9ceb0d7ecfc61f7364966cee4d3870509977cc
|
4
|
+
data.tar.gz: c1b42c3c29c07e5f95197e4d432c4a8fb4300d03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e99c4936780a984e27aef417c29f991521bc0c1528adbb4114222bb0120d6d0c21c0445601c9c17e2750b540d0ceacb37205276a3a35cd9f1ce7d8a800c8791c
|
7
|
+
data.tar.gz: a823b375289a6c09a0281809ff284cac7e75b0b7f1258ff5fb161be71a7c7d6fa74d216fcaa82d3f95c26fa83ca6f29dbbec4d5ed484a98f3f97dc2c1e36676d
|
data/README.md
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
Plivo Ruby Library
|
2
2
|
---------------------------
|
3
3
|
|
4
|
-
[![Gem Version](https://badge.fury.io/rb/plivo.png)](http://badge.fury.io/rb/plivo)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/plivo.png)](http://badge.fury.io/rb/plivo)
|
5
|
+
[![Dependency Status](https://gemnasium.com/plivo/plivo-ruby.png)](https://gemnasium.com/plivo/plivo-ruby)
|
5
6
|
|
6
7
|
Description
|
7
8
|
~~~~~~~~~~~
|
data/ext/mkrf_conf.rb
ADDED
data/lib/plivo.rb
CHANGED
@@ -3,11 +3,30 @@ require 'restclient'
|
|
3
3
|
require 'json'
|
4
4
|
require 'rexml/document'
|
5
5
|
require 'htmlentities'
|
6
|
+
require 'openssl'
|
7
|
+
require 'base64'
|
6
8
|
|
7
9
|
module Plivo
|
8
10
|
class PlivoError < Exception
|
9
11
|
end
|
10
12
|
|
13
|
+
class XPlivoSignature
|
14
|
+
attr_accessor :signature, :uri, :post_params, :auth_token
|
15
|
+
|
16
|
+
def initialize(signature, uri, post_params, auth_token)
|
17
|
+
@signature = signature
|
18
|
+
@uri = uri
|
19
|
+
@post_params = post_params
|
20
|
+
@auth_token = auth_token
|
21
|
+
end
|
22
|
+
|
23
|
+
def is_valid?
|
24
|
+
uri = @post_params.sort.reduce(@uri) {|_, (key, val)| _ += key + val}
|
25
|
+
return Base64.encode64(OpenSSL::HMAC.digest('sha1', @auth_token, uri)).chomp.eql? @signature
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
11
30
|
class RestAPI
|
12
31
|
attr_accessor :auth_id, :auth_token, :url, :version, :api, :headers, :rest
|
13
32
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plivo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Plivo Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: builder
|
@@ -69,12 +69,14 @@ dependencies:
|
|
69
69
|
description: A Ruby gem for interacting with the Plivo Cloud Platform
|
70
70
|
email: support@plivo.com
|
71
71
|
executables: []
|
72
|
-
extensions:
|
72
|
+
extensions:
|
73
|
+
- ext/mkrf_conf.rb
|
73
74
|
extra_rdoc_files:
|
74
75
|
- README.md
|
75
76
|
files:
|
76
77
|
- lib/plivo.rb
|
77
78
|
- README.md
|
79
|
+
- ext/mkrf_conf.rb
|
78
80
|
homepage: http://www.plivo.com
|
79
81
|
licenses:
|
80
82
|
- MIT
|
@@ -95,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
97
|
version: '0'
|
96
98
|
requirements: []
|
97
99
|
rubyforge_project:
|
98
|
-
rubygems_version: 2.
|
100
|
+
rubygems_version: 2.1.0
|
99
101
|
signing_key:
|
100
102
|
specification_version: 4
|
101
103
|
summary: A Ruby gem for communicating with the Plivo Cloud Platform
|