farmbot-resource 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/client.rb +6 -7
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 55262027f1ae26bc9dc97e1ef4792834a8680b48
|
|
4
|
+
data.tar.gz: ab3c489d840fbe3486594184c1602fef86f8e63f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7d9ca8dc7c9d1c523b9dc9c614cde07eab9ff406fcc114041042491abf33bd36d82f424a404c4bb2ccdef06d3a5a32dca9357a297f8514f8c9c4767eb25685c2
|
|
7
|
+
data.tar.gz: 2d17f2764e0807c878330f9e7d9a48848e714b202b0568c759ec0c7ffbb287cfcd7d55abd622bc4c27bd3c0c6503bdf2dcb77522e2ccebbf9400e488e4944094
|
data/lib/client.rb
CHANGED
|
@@ -28,13 +28,12 @@ module FbResource
|
|
|
28
28
|
|
|
29
29
|
# Useful when you need to sign arbitrary secrets and give them to the server
|
|
30
30
|
def public_key
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
end
|
|
31
|
+
@public_key ||= self.class.public_key(config.url)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def self.public_key(url = "my.farmbot.io")
|
|
35
|
+
pem = Http.get(url + "/api/public_key", {}).body
|
|
36
|
+
@public_key = OpenSSL::PKey::RSA.new(pem)
|
|
38
37
|
end
|
|
39
38
|
|
|
40
39
|
def device
|