etherpad_canvas 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +3 -4
- data/lib/etherpad_canvas/etherpad_collaboration.rb +23 -22
- data/lib/etherpad_canvas/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: ccb6dcf3c4924ddaa7bdde322c1d6964a3f2570a
|
4
|
+
data.tar.gz: 59285dce7becc30a79e03f108fcc7090ec60ef06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52cd53f87601f4a230814ebb1ca6c5d7a28230e7c2442a2b0f2603080aa6e6861a8d945e366e921d29fec81ea4517c6fa8ff5d6b1df060a397aca51f2b639753
|
7
|
+
data.tar.gz: f4d67a544a432fbbba732ae10ad787a28f63bddf383df7d8505883a2b77fadaa7edb86387b3515ba41a12b378b03e4d841118752547c936edfdf420e58732d80
|
data/README.rdoc
CHANGED
@@ -17,10 +17,9 @@ Installation
|
|
17
17
|
sysadmin@appserver:~$ cd /path/to/canvas/gems/plugins
|
18
18
|
sysadmin@appserver:/path/to/canvas/gems/plugins$ git clone https://github.com/atomicjolt/etherpad_canvas.git
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
verification.
|
20
|
+
Run rake:secret and add the generated secret through
|
21
|
+
Canvas settings and save that secret for utilization
|
22
|
+
with the Etherpad Plugin for verification.
|
24
23
|
|
25
24
|
===================================================
|
26
25
|
Usage
|
@@ -21,31 +21,32 @@ class EtherpadCollaboration
|
|
21
21
|
|
22
22
|
def self.sign_url(user, collaboration)
|
23
23
|
plugin = PluginSetting.find_by(name: "etherpad_canvas")
|
24
|
+
etherpad_plugin = PluginSetting.find_by(name: "etherpad")
|
25
|
+
domain = etherpad_plugin.split("/")
|
26
|
+
|
24
27
|
if !plugin.disabled
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
collaboration.url = url.join
|
37
|
-
else
|
38
|
-
collaboration.url += signing(key, query)
|
39
|
-
end
|
40
|
-
|
41
|
-
collaboration.url
|
28
|
+
key = plugin.settings[:key]
|
29
|
+
|
30
|
+
url = generate_url user, collaboration
|
31
|
+
|
32
|
+
url_sans_http = url.split(domain)[0]
|
33
|
+
|
34
|
+
digest = OpenSSL::Digest.new("sha1")
|
35
|
+
|
36
|
+
hmac = OpenSSL::HMAC.hexdigest(digest, key, url_sans_http)
|
37
|
+
|
38
|
+
"#{url}&signature=#{hmac}"
|
42
39
|
end
|
43
40
|
end
|
44
41
|
|
45
|
-
def
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
42
|
+
def self.generate_url(user, collaboration)
|
43
|
+
timestamp = (Time.now.to_f * 1000).to_i
|
44
|
+
query = {
|
45
|
+
timestamp: timestamp,
|
46
|
+
user_id: user.id,
|
47
|
+
username: user.name,
|
48
|
+
}.to_query
|
49
|
+
|
50
|
+
"#{collaboration.url}?#{query}"
|
50
51
|
end
|
51
52
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: etherpad_canvas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Durr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|