facebook_digit_auth 0.1.1 → 0.1.2.pre.beta.pre.1
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/digit_client.rb +41 -0
- data/lib/facebook_client.rb +2 -2
- data/lib/facebook_digit_auth/version.rb +1 -1
- data/lib/facebook_digit_auth.rb +7 -4
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5257b78631810ae80a50b610cab4281c6b4b77c
|
4
|
+
data.tar.gz: c45a36737056a04d3224b2af04c6c5969a4fe3bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcc3a5b72464999bb44d7e5cad3a53f4303ae8dc9146f39f620fc772df3d5fbbc0c927e99d933d97127ddb2378ebf656df0db431596d9f2cc45c9622cde8b1e1
|
7
|
+
data.tar.gz: fd6b608d4d8bca8e83732283bb23b1ec57f833f1e19352b66ddcba114cbac6af01740cc24c3095814cce351b35bde9455c5686f98dd7aa8d5be911bdac8adbca
|
data/lib/digit_client.rb
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'httparty'
|
2
|
+
|
3
|
+
class DigitsClient
|
4
|
+
def initialize(digit_params)
|
5
|
+
@digits_credentials = digit_params
|
6
|
+
@user_id = digit_params[:user_id]
|
7
|
+
@phone_no = digit_params[:number]
|
8
|
+
@auth_token = digit_params[:auth_token]
|
9
|
+
@auth_token_secret = digit_params[:auth_token_secret]
|
10
|
+
@auth_headers = digit_params[:auth_headers]
|
11
|
+
end
|
12
|
+
|
13
|
+
def data
|
14
|
+
if verified
|
15
|
+
{result: true,data: response}
|
16
|
+
else
|
17
|
+
{result: false,message: "Wrong credentials supplied!"}
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def response
|
22
|
+
HTTParty.get(url, :headers => header)
|
23
|
+
end
|
24
|
+
|
25
|
+
def verified
|
26
|
+
if response["phone_number"] != @phone_no || response["id_str"] != @user_id response["access_token"]["token"] != @auth_token || response["access_token"]["secret"] != @auth_token_secret
|
27
|
+
false
|
28
|
+
else
|
29
|
+
true
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def header
|
34
|
+
{"Authorization" => @auth_headers['X-Verify-Credentials-Authorization']}
|
35
|
+
end
|
36
|
+
|
37
|
+
def url
|
38
|
+
@auth_headers["X-Auth-Service-Provider"]
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
data/lib/facebook_client.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
class FacebookClient
|
1
|
+
class FacebookClient
|
2
|
+
|
2
3
|
def initialize(token)
|
3
4
|
@client = Koala::Facebook::API.new(token)
|
4
5
|
end
|
@@ -98,7 +99,6 @@ class FacebookClient
|
|
98
99
|
end
|
99
100
|
|
100
101
|
def profile_picture
|
101
|
-
puts "basic information #{basic_information}"
|
102
102
|
photo_url(basic_information["facebook_user_id"])
|
103
103
|
end
|
104
104
|
|
data/lib/facebook_digit_auth.rb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
require "facebook_digit_auth/version"
|
2
|
+
class FacebookDigitAuth
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
def test_method(params,type)
|
5
|
+
if type == 'facebook'
|
6
|
+
FacebookClient.new(params).data
|
7
|
+
elsif type == 'digit'
|
8
|
+
DigitsClient.new(params).data
|
9
|
+
end
|
7
10
|
end
|
8
11
|
|
9
12
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: facebook_digit_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.1
|
4
|
+
version: 0.1.2.pre.beta.pre.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RaghavSingh
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -68,6 +68,7 @@ files:
|
|
68
68
|
- bin/console
|
69
69
|
- bin/setup
|
70
70
|
- facebook_digit_auth.gemspec
|
71
|
+
- lib/digit_client.rb
|
71
72
|
- lib/facebook_client.rb
|
72
73
|
- lib/facebook_digit_auth.rb
|
73
74
|
- lib/facebook_digit_auth/version.rb
|
@@ -86,9 +87,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
86
87
|
version: '0'
|
87
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
89
|
requirements:
|
89
|
-
- - "
|
90
|
+
- - ">"
|
90
91
|
- !ruby/object:Gem::Version
|
91
|
-
version:
|
92
|
+
version: 1.3.1
|
92
93
|
requirements: []
|
93
94
|
rubyforge_project:
|
94
95
|
rubygems_version: 2.5.1
|