bravtroller 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/Gemfile.lock +2 -2
- data/lib/bravtroller/authenticator.rb +4 -0
- data/lib/bravtroller/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: 31fa1db5f4c097fdd8c2b112cb95dbbd355ed873
|
4
|
+
data.tar.gz: d04ee5118b33d88248ca6330589cadb7da3df3ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e66e501c6e42e77245f24c4665e83eacc5d9e6e3d1f04a0c119e76b89b1cff37171d099136c0850e28d45bce8eb2822e232a9b431433bbfd854bc79b620b867
|
7
|
+
data.tar.gz: c94334b619378a49685abe2ba687e805a5ed0ab9decfcfc099d0310163072ec897e3a77511f43504fac72dbab1f2e05f955babd994f331182971455d9e07a20a
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bravtroller (0.1.
|
4
|
+
bravtroller (0.1.4)
|
5
5
|
easy_upnp (~> 0.1.6)
|
6
6
|
|
7
7
|
GEM
|
@@ -11,7 +11,7 @@ GEM
|
|
11
11
|
gyoku (>= 0.4.0)
|
12
12
|
nokogiri
|
13
13
|
builder (3.2.2)
|
14
|
-
easy_upnp (0.1.
|
14
|
+
easy_upnp (0.1.7)
|
15
15
|
nokogiri (~> 1.6.6.2)
|
16
16
|
nori (~> 2.6.0)
|
17
17
|
rake
|
@@ -3,6 +3,8 @@ require 'json'
|
|
3
3
|
require 'base64'
|
4
4
|
|
5
5
|
module Bravtroller
|
6
|
+
class AuthorizationError < StandardError; end
|
7
|
+
|
6
8
|
class Authenticator
|
7
9
|
CLIENT_ID = 'bravtroller:de7cd7d5-a9a0-44a1-aba1-57d973a0ee8a'
|
8
10
|
|
@@ -43,6 +45,8 @@ module Bravtroller
|
|
43
45
|
|
44
46
|
auth_response = @bravia_client.post_request('/sony/accessControl', AUTH_REQUEST_PARAMS, headers)
|
45
47
|
|
48
|
+
raise AuthorizationError, 'Authentication failed' if auth_response.code == '401'
|
49
|
+
|
46
50
|
extract_cookie(auth_response)
|
47
51
|
else
|
48
52
|
# Already authorized, but the Set-Cookie header should still be set
|
data/lib/bravtroller/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bravtroller
|
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
|
- Christopher Mullins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: easy_upnp
|