omniauth-lifx 1.0.0 → 1.1.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/CHANGELOG.md +4 -0
- data/Gemfile.lock +3 -3
- data/lib/omniauth/lifx/version.rb +1 -1
- data/lib/omniauth/strategies/lifx.rb +19 -14
- 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: af33f74fb72c9c4f16cc27507a260e728bfdac8a
|
|
4
|
+
data.tar.gz: b2a8d6500b1c9eb4c0ed70a42b6b8ea9d6103b27
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: edb8317b109538e83310384bf1bdee678bf21110d1189e868f21e5d0a6c350c52c540f0447e0729097f02703076ab217f78961571551ea0f95872cb6be0bf1aa
|
|
7
|
+
data.tar.gz: 71ebe90ce136fb9596fceb154a568d8e2fbde25346517da1acffdb9ceb0c57da3876471b4c438662678e346c84b0e26c1463d909b3c61a95c47393a0bd2aba38
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
|
4
4
|
|
|
5
|
+
## [1.1.0] - 2016-01-18
|
|
6
|
+
|
|
7
|
+
Set omniauth uid using the Lifx-Account-Uuid header.
|
|
8
|
+
|
|
5
9
|
## [1.0.0] - 2016-01-17
|
|
6
10
|
|
|
7
11
|
First version. Hopefully this works.
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
omniauth-lifx (1.
|
|
4
|
+
omniauth-lifx (1.1.0)
|
|
5
5
|
omniauth (~> 1.0)
|
|
6
6
|
omniauth-oauth2 (~> 1.1)
|
|
7
7
|
|
|
@@ -21,9 +21,9 @@ GEM
|
|
|
21
21
|
multi_json (~> 1.3)
|
|
22
22
|
multi_xml (~> 0.5)
|
|
23
23
|
rack (~> 1.2)
|
|
24
|
-
omniauth (1.
|
|
24
|
+
omniauth (1.3.1)
|
|
25
25
|
hashie (>= 1.2, < 4)
|
|
26
|
-
rack (
|
|
26
|
+
rack (>= 1.0, < 3)
|
|
27
27
|
omniauth-oauth2 (1.3.1)
|
|
28
28
|
oauth2 (~> 1.0)
|
|
29
29
|
omniauth (~> 1.2)
|
|
@@ -15,26 +15,31 @@ module OmniAuth
|
|
|
15
15
|
option :scope, "remote_control:all"
|
|
16
16
|
|
|
17
17
|
uid {
|
|
18
|
-
|
|
18
|
+
user_uuid
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
# extra do
|
|
22
22
|
# { :endpoints => raw_info }
|
|
23
23
|
# end
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
25
|
+
def user_uuid
|
|
26
|
+
all_lights
|
|
27
|
+
@user_uuid
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def all_lights
|
|
31
|
+
return @all_lights if @all_lights
|
|
32
|
+
@all_lights = {}
|
|
33
|
+
uri = URI("https://api.lifx.com/v1/lights/all")
|
|
34
|
+
req = Net::HTTP::Get.new(uri)
|
|
35
|
+
req["Authorization"] = "Bearer #{access_token.token}"
|
|
36
|
+
Net::HTTP.start(uri.host, uri.port, :use_ssl => true) do |http|
|
|
37
|
+
res = http.request(req)
|
|
38
|
+
@user_uuid = res["Lifx-Account-Uuid"]
|
|
39
|
+
@all_lights = JSON.parse(res.body)
|
|
40
|
+
end
|
|
41
|
+
return @all_lights
|
|
42
|
+
end
|
|
38
43
|
end
|
|
39
44
|
end
|
|
40
45
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: omniauth-lifx
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Hsiu-Fan Wang
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-01-
|
|
11
|
+
date: 2016-01-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: omniauth
|