cine_io 0.1.4 → 0.1.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 +10 -0
- data/lib/cine_io.rb +4 -0
- data/lib/cine_io/peer.rb +14 -0
- data/lib/cine_io/version.rb +1 -1
- data/spec/cine_io/peer_spec.rb +19 -0
- data/spec/cine_io_spec.rb +5 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a37c24dc5ba3033b57e53be1b0b641b58ae2aa1e
|
4
|
+
data.tar.gz: 4eea038909835278e264b92ca422818c51ae2eb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8d039ce91e1f079d1ba5d82b331efa83ad699d218b17de137de328fbe599e541a8e21daa2ec674665e13f17da76e500fddbb037f67facf4d2bcdf6971445f2b
|
7
|
+
data.tar.gz: 9c1b0b310548b02714305920f6c6abd9eb6cc4706b7f3fbdd23f0a67936d97fead5ec75bda322580e8bf86e732b301ba3139d2213245b34edafb00ce80bd28c1
|
data/README.md
CHANGED
@@ -130,6 +130,16 @@ recordings = client.streams.recordings.delete('STREAM_ID', 'recordingName')
|
|
130
130
|
# => Date String
|
131
131
|
```
|
132
132
|
|
133
|
+
### Peer
|
134
|
+
|
135
|
+
#### Identity Signature Generation
|
136
|
+
|
137
|
+
```ruby
|
138
|
+
var identity = "Unique user name to your app"
|
139
|
+
response = client.peer.generate_identity_signature(identity)
|
140
|
+
// response looks like {signature: "sha1-hash", timestamp: 1420258111, identity: "Unique user name to your app"}
|
141
|
+
```
|
142
|
+
|
133
143
|
## Contributing
|
134
144
|
|
135
145
|
1. Fork it
|
data/lib/cine_io.rb
CHANGED
data/lib/cine_io/peer.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'digest/sha1'
|
2
|
+
|
3
|
+
class CineIo::Peer
|
4
|
+
def initialize(client)
|
5
|
+
@client = client
|
6
|
+
end
|
7
|
+
|
8
|
+
def generate_identity_signature(identity)
|
9
|
+
secretKey = @client.config.fetch(:secretKey)
|
10
|
+
timestamp = Time.now.to_i
|
11
|
+
signature = Digest::SHA1.hexdigest "identity=#{identity}×tamp=#{timestamp}#{secretKey}"
|
12
|
+
return {identity: identity, signature: signature, timestamp: timestamp}
|
13
|
+
end
|
14
|
+
end
|
data/lib/cine_io/version.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe CineIo::Peer do
|
4
|
+
|
5
|
+
let(:client) { CineIo::Client.new(:secretKey => "MY SECRET", :publicKey => "MY PUBLIC") }
|
6
|
+
|
7
|
+
subject { described_class.new(client) }
|
8
|
+
|
9
|
+
|
10
|
+
describe '#generate_identity_signature' do
|
11
|
+
it 'returns the correct signature' do
|
12
|
+
time = Time.parse("Jan 2 2015")
|
13
|
+
allow(Time).to receive(:now) { time }
|
14
|
+
|
15
|
+
expect(subject.generate_identity_signature('Thomas')).to eq(identity: "Thomas", signature: "6fbb691889a3db90f6be439aaaaebfca50f1e94d", timestamp: 1420185600)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
data/spec/cine_io_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cine_io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cine.io
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- Rakefile
|
97
97
|
- cine_io.gemspec
|
98
98
|
- lib/cine_io.rb
|
99
|
+
- lib/cine_io/peer.rb
|
99
100
|
- lib/cine_io/project.rb
|
100
101
|
- lib/cine_io/project_handler.rb
|
101
102
|
- lib/cine_io/projects_handler.rb
|
@@ -105,6 +106,7 @@ files:
|
|
105
106
|
- lib/cine_io/stream_recordings_handler.rb
|
106
107
|
- lib/cine_io/streams_handler.rb
|
107
108
|
- lib/cine_io/version.rb
|
109
|
+
- spec/cine_io/peer_spec.rb
|
108
110
|
- spec/cine_io/project_handler_spec.rb
|
109
111
|
- spec/cine_io/project_spec.rb
|
110
112
|
- spec/cine_io/projects_handler_spec.rb
|
@@ -166,6 +168,7 @@ signing_key:
|
|
166
168
|
specification_version: 4
|
167
169
|
summary: The official cine.io ruby gem
|
168
170
|
test_files:
|
171
|
+
- spec/cine_io/peer_spec.rb
|
169
172
|
- spec/cine_io/project_handler_spec.rb
|
170
173
|
- spec/cine_io/project_spec.rb
|
171
174
|
- spec/cine_io/projects_handler_spec.rb
|