rmega 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/rmega/storage.rb +14 -2
- data/lib/rmega/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: 1de0443e3d865f515533f1110ba81e188b50c82f
|
4
|
+
data.tar.gz: dcfa1879ea580bba7ed15fb6838084fc2ff3fb28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d393bdf468cc8f99f58a742be0e82eb9aab70479450fedb4e63f2f1d72aa15dd205860fbf01bbbac1c23e03a427538d9a84533a6c968b5aabe8b686f7eadf05
|
7
|
+
data.tar.gz: 905433bb7362720a3cdaa5753aee2f7a7a34f6c4f8ce6654efa4fcd75502176fbc8008b29b4dea61a89784a85644adc0d4761f32fdfa69ff5c0a856396bdacdd
|
data/CHANGELOG.md
CHANGED
data/lib/rmega/storage.rb
CHANGED
@@ -6,6 +6,8 @@ module Rmega
|
|
6
6
|
|
7
7
|
attr_reader :session
|
8
8
|
|
9
|
+
delegate :master_key, :shared_keys, to: :session
|
10
|
+
|
9
11
|
def initialize(session)
|
10
12
|
@session = session
|
11
13
|
end
|
@@ -23,9 +25,11 @@ module Rmega
|
|
23
25
|
end
|
24
26
|
|
25
27
|
def nodes
|
26
|
-
results = session.request(a: 'f', c: 1)
|
28
|
+
results = session.request(a: 'f', c: 1)
|
29
|
+
|
30
|
+
store_shared_keys(results['ok'] || [])
|
27
31
|
|
28
|
-
results.map do |node_data|
|
32
|
+
(results['f'] || []).map do |node_data|
|
29
33
|
node = Nodes::Factory.build(session, node_data)
|
30
34
|
node.process_shared_key if node.shared_root?
|
31
35
|
node
|
@@ -51,5 +55,13 @@ module Rmega
|
|
51
55
|
def download(public_url, path)
|
52
56
|
Nodes::Factory.build_from_url(session, public_url).download(path)
|
53
57
|
end
|
58
|
+
|
59
|
+
private
|
60
|
+
|
61
|
+
def store_shared_keys(list)
|
62
|
+
list.each do |hash|
|
63
|
+
shared_keys[hash['h']] = Crypto.decrypt_key(master_key, Utils.base64_to_a32(hash['k']))
|
64
|
+
end
|
65
|
+
end
|
54
66
|
end
|
55
67
|
end
|
data/lib/rmega/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rmega
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniele Molteni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|