selfsdk 0.0.205 → 0.0.206
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jwt_service.rb +15 -0
- data/lib/selfsdk.rb +1 -0
- data/lib/services/auth.rb +1 -1
- data/lib/services/chat.rb +1 -7
- data/lib/services/facts.rb +1 -1
- data/lib/services/requester.rb +3 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04e3ca0ab456325ed10c941ecdcc1df830f5a0f4c9cf3943fd9d06bce2aef5de
|
4
|
+
data.tar.gz: d24a21a686ee1ad5181b4f3a482442dba30961b451c9fa31c2e3d2abedf6d197
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c096d4d924486aa47c855e16487db1e41445ac0f0d7dd45b70d7b05335dcdd90b9749d039c91660fb30b1943bc996ab745f4c705c59353b9811e37646821601
|
7
|
+
data.tar.gz: 3222fecfe339e2695a72bb5ada11a8bcf121eef7ddab3134d1c38770b18bf9131bb24c89a29ca1b6b12df6faaf6e9dd6350c420336c841f4e9f1e4d2c8c9d816
|
data/lib/jwt_service.rb
CHANGED
@@ -93,6 +93,21 @@ module SelfSDK
|
|
93
93
|
"#{payload}.#{signature}"
|
94
94
|
end
|
95
95
|
|
96
|
+
def build_dynamic_link(body, env, callback)
|
97
|
+
base_url = "https://#{env}.links.joinself.com"
|
98
|
+
portal_url = "https://developer.#{env}.joinself.com"
|
99
|
+
apn = "com.joinself.app.#{env}"
|
100
|
+
|
101
|
+
if env.empty? || env == 'development'
|
102
|
+
base_url = "https://links.joinself.com"
|
103
|
+
portal_url = "https://developer.joinself.com"
|
104
|
+
apn = "com.joinself.app"
|
105
|
+
end
|
106
|
+
apn = "com.joinself.app.dev" if env == 'development'
|
107
|
+
|
108
|
+
"#{base_url}?link=#{portal_url}/callback/#{callback}%3Fqr=#{body}&apn=#{apn}"
|
109
|
+
end
|
110
|
+
|
96
111
|
private
|
97
112
|
|
98
113
|
def header
|
data/lib/selfsdk.rb
CHANGED
data/lib/services/auth.rb
CHANGED
@@ -69,7 +69,7 @@ module SelfSDK
|
|
69
69
|
|
70
70
|
# Generates a deep link to authenticate with self app.
|
71
71
|
#
|
72
|
-
# @param callback [String] the
|
72
|
+
# @param callback [String] the callback identifier you'll be redirected to if the app is not installed.
|
73
73
|
# @option opts [String] :selfid the user selfid you want to authenticate.
|
74
74
|
# @option opts [String] :cid The unique identifier of the authentication request.
|
75
75
|
#
|
data/lib/services/chat.rb
CHANGED
@@ -184,13 +184,7 @@ module SelfSDK
|
|
184
184
|
body = @jwt.encode(body)
|
185
185
|
|
186
186
|
env = @messaging.client.client.env
|
187
|
-
|
188
|
-
return "https://links.joinself.com/?link=#{callback}%3Fqr=#{body}&apn=com.joinself.app"
|
189
|
-
elsif env == 'development'
|
190
|
-
return "https://links.joinself.com/?link=#{callback}%3Fqr=#{body}&apn=com.joinself.app.dev"
|
191
|
-
end
|
192
|
-
|
193
|
-
"https://#{env}.links.joinself.com/?link=#{callback}%3Fqr=#{body}&apn=com.joinself.app.#{env}"
|
187
|
+
@jwt.build_dynamic_link(body, env, callback)
|
194
188
|
end
|
195
189
|
|
196
190
|
# Subscribes to a connection response
|
data/lib/services/facts.rb
CHANGED
@@ -84,7 +84,7 @@ module SelfSDK
|
|
84
84
|
# Generates a deep link to authenticate with self app.
|
85
85
|
#
|
86
86
|
# @param facts [Array] a list of facts to be requested.
|
87
|
-
# @param callback [String] the
|
87
|
+
# @param callback [String] the callback identifier you'll be redirected to if the app is not installed.
|
88
88
|
# @option opts [String] :selfid the user selfid you want to authenticate.
|
89
89
|
# @option opts [String] :cid The unique identifier of the authentication request.
|
90
90
|
#
|
data/lib/services/requester.rb
CHANGED
@@ -124,7 +124,7 @@ module SelfSDK
|
|
124
124
|
# Generates a deep link to authenticate with self app.
|
125
125
|
#
|
126
126
|
# @param facts [Array] a list of facts to be requested.
|
127
|
-
# @param callback [String] the
|
127
|
+
# @param callback [String] the callback identifier you'll be redirected to if the app is not installed.
|
128
128
|
# @option opts [String] :selfid the user selfid you want to authenticate.
|
129
129
|
# @option opts [String] :cid The unique identifier of the authentication request.
|
130
130
|
#
|
@@ -132,14 +132,9 @@ module SelfSDK
|
|
132
132
|
def generate_deep_link(facts, callback, opts = {})
|
133
133
|
opts[:request] = false
|
134
134
|
selfid = opts.fetch(:selfid, "-")
|
135
|
-
body = @client.jwt.encode(request(selfid, facts, opts))
|
136
135
|
|
137
|
-
|
138
|
-
|
139
|
-
elsif @client.env == 'development'
|
140
|
-
return "https://links.joinself.com/?link=#{callback}%3Fqr=#{body}&apn=com.joinself.app.dev"
|
141
|
-
end
|
142
|
-
"https://#{@client.env}.links.joinself.com/?link=#{callback}%3Fqr=#{body}&apn=com.joinself.app.#{@client.env}"
|
136
|
+
body = @client.jwt.encode(request(selfid, facts, opts))
|
137
|
+
@client.jwt.build_dynamic_link(body, @client.env, callback)
|
143
138
|
end
|
144
139
|
|
145
140
|
private
|