selfsdk 0.0.185 → 0.0.186

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46b877bce1cf941473947fe1980fcc28dd2998a4bf19781a8eb7563b50e5576d
4
- data.tar.gz: bcaa5355a79c64e88e846fed291f83f23034258817611e3bf23810fd9e6f57e6
3
+ metadata.gz: 537d89a4c6f35651b5c5935b12861a3b76966a34858fc8c0cce2e6a0c079a574
4
+ data.tar.gz: a1e8991eff4ccaf30dd7ee633a17009f43e68e383b28cedb29cd61977135b575
5
5
  SHA512:
6
- metadata.gz: 6365053015bbf9aff47e00eb1d40fd9a2609e1353404abab7389ce37747a3792de36c5d30e1dc3e85f3d57a2c2fe1f5de2219bf549b8008e94908974fd8f0dee
7
- data.tar.gz: ff241c95f89d25f006d1ed74cf890b7cb9c6db7580fb1e9695b082fca8200f14282b2023b7aa3b0388201c190f905e8f9e5cfa4c4ba251d693f26e1e92df3372
6
+ metadata.gz: f2c2a074476b655870575194c68781a905b5a6186823c732c70a612d61baa530f2e10cc501b80013571119befcc9d0decd18dc55c15e999751eb908d7576e9d8
7
+ data.tar.gz: 7587e69db01c25ccaa558da3ef9f70d9a668c16d6b93c12b178f86ca8956f5a90b966e8107b9157a7211e6a2cb78ef801644792c1886ee0ea129c8d22363c5cc
@@ -35,6 +35,7 @@ module SelfSDK
35
35
  @description = opts.include?(:description) ? opts[:description] : nil
36
36
  @exp_timeout = opts.fetch(:exp_timeout, DEFAULT_EXP_TIMEOUT)
37
37
  @allowed_for = opts.fetch(:allowed_for, nil)
38
+ @auth = opts.fetch(:auth, false)
38
39
 
39
40
  @intermediary = if opts.include?(:intermediary)
40
41
  opts[:intermediary]
@@ -91,6 +92,7 @@ module SelfSDK
91
92
  b[:options] = @options unless (@options.nil? || @options == false)
92
93
  b[:description] = @description unless (@description.nil? || @description.empty?)
93
94
  b[:allowed_until] = (SelfSDK::Time.now + @allowed_for).strftime('%FT%TZ') unless @allowed_for.nil?
95
+ b[:auth] = @auth unless @auth.nil?
94
96
  b
95
97
  end
96
98
 
@@ -11,7 +11,7 @@ module SelfSDK
11
11
  class FactResponse < Base
12
12
  MSG_TYPE = "identities.facts.query.resp"
13
13
 
14
- attr_accessor :facts, :audience
14
+ attr_accessor :facts, :audience, :auth
15
15
 
16
16
  def parse(input, envelope=nil)
17
17
  @input = input
@@ -24,6 +24,7 @@ module SelfSDK
24
24
  @issued = ::Time.parse(payload[:iat])
25
25
  @audience = payload[:aud]
26
26
  @status = payload[:status]
27
+ @auth = payload[:auth]
27
28
  @facts = []
28
29
  payload[:facts] = [] if payload[:facts].nil?
29
30
  payload[:facts].each do |f|
@@ -69,7 +70,7 @@ module SelfSDK
69
70
  @facts.each do |fact|
70
71
  encoded_facts.push(fact.to_hash)
71
72
  end
72
-
73
+
73
74
  { typ: MSG_TYPE,
74
75
  iss: @jwt.id,
75
76
  sub: @sub || @to,
@@ -79,7 +80,8 @@ module SelfSDK
79
80
  cid: @id,
80
81
  jti: SecureRandom.uuid,
81
82
  status: @status,
82
- facts: encoded_facts }
83
+ facts: encoded_facts,
84
+ auth: @auth }
83
85
  end
84
86
 
85
87
  protected
data/lib/services/auth.rb CHANGED
@@ -89,11 +89,11 @@ module SelfSDK
89
89
  body = @client.jwt.encode(request(selfid, opts))
90
90
 
91
91
  if @client.env.empty?
92
- return "https://joinself.page.link/?link=#{callback}%3Fqr=#{body}&apn=com.joinself.app"
92
+ return "https://links.joinself.com/?link=#{callback}%3Fqr=#{body}&apn=com.joinself.app"
93
93
  elsif @client.env == 'development'
94
- return "https://joinself.page.link/?link=#{callback}%3Fqr=#{body}&apn=com.joinself.app.dev"
94
+ return "https://links.joinself.com/?link=#{callback}%3Fqr=#{body}&apn=com.joinself.app.dev"
95
95
  end
96
- "https://joinself.page.link/?link=#{callback}%3Fqr=#{body}&apn=com.joinself.app.#{@client.env}"
96
+ "https://#{@client.env}.links.joinself.com/?link=#{callback}%3Fqr=#{body}&apn=com.joinself.app.#{@client.env}"
97
97
  end
98
98
 
99
99
  # Adds an observer for an authentication response
@@ -41,6 +41,7 @@ module SelfSDK
41
41
  # @option opts [String] :cid The unique identifier of the authentication request.
42
42
  # @option opts [Integer] :exp_timeout timeout in seconds to expire the request.
43
43
  # @option opts [Integer] :allowed_for number of seconds for enabling recurrent requests.
44
+ # @option opts [Boolean] :auth allows displaying the request as anuthentication request with facts.
44
45
  # @return [Object] SelfSDK:::Messages::FactRequest
45
46
  def request(selfid, facts, opts = {}, &block)
46
47
  SelfSDK.logger.info "authenticating #{selfid}"
@@ -116,11 +117,11 @@ module SelfSDK
116
117
  body = @client.jwt.encode(request(selfid, facts, opts))
117
118
 
118
119
  if @client.env.empty?
119
- return "https://joinself.page.link/?link=#{callback}%3Fqr=#{body}&apn=com.joinself.app"
120
+ return "https://links.joinself.com/?link=#{callback}%3Fqr=#{body}&apn=com.joinself.app"
120
121
  elsif @client.env == 'development'
121
- return "https://joinself.page.link/?link=#{callback}%3Fqr=#{body}&apn=com.joinself.app.dev"
122
+ return "https://links.joinself.com/?link=#{callback}%3Fqr=#{body}&apn=com.joinself.app.dev"
122
123
  end
123
- "https://joinself.page.link/?link=#{callback}%3Fqr=#{body}&apn=com.joinself.app.#{@client.env}"
124
+ "https://#{@client.env}.links.joinself.com/?link=#{callback}%3Fqr=#{body}&apn=com.joinself.app.#{@client.env}"
124
125
  end
125
126
 
126
127
  private
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selfsdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.185
4
+ version: 0.0.186
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aldgate Ventures