tanker-core 2.31.1.beta.1 → 2.32.0.alpha.3
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/tanker/c_tanker/c_verification.rb +7 -1
- data/lib/tanker/c_tanker/c_verification_method.rb +3 -0
- data/lib/tanker/core/verification.rb +12 -0
- data/lib/tanker/core/verification_method.rb +2 -0
- data/lib/tanker/core/version.rb +1 -1
- data/lib/tanker/verification_options.rb +5 -3
- data/vendor/tanker/darwin-aarch64/libctanker.dylib +0 -0
- data/vendor/tanker/darwin-x86_64/libctanker.dylib +0 -0
- data/vendor/tanker/linux-x86_64/libctanker.so +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35807b63789da11922bba195e97ad38426d94d2ae88c4d7d86738f9aa81d29b3
|
4
|
+
data.tar.gz: a71c96a6f18fdfbf5a6006e06268f841aeee930431786b0e5e7822333d429d2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 268e586fd6b4753efe053d4d7d837a920fe20e3914f4e83c47b84d414f49e971ea0b874d8c608dd9495827b769847fc8fd05b9a02d21f01dd5bacc677dcc2e49
|
7
|
+
data.tar.gz: e08552e46eb8c589e281f5fb77d85c585cfaaccd67baf037972f2cb9c0714dc4b2fe237b507ac64d8716d03ca6477c64f442430510864800ec761859af3e3a4d
|
@@ -48,6 +48,7 @@ module Tanker
|
|
48
48
|
:verification_key, :pointer,
|
49
49
|
:email_verification, CEmailVerification,
|
50
50
|
:passphrase, :pointer,
|
51
|
+
:e2e_passphrase, :pointer,
|
51
52
|
:oidc_id_token, :pointer,
|
52
53
|
:phone_number_verification, CPhoneNumberVerification,
|
53
54
|
:preverified_email, :pointer,
|
@@ -60,6 +61,7 @@ module Tanker
|
|
60
61
|
TYPE_PHONE_NUMBER = 5
|
61
62
|
TYPE_PREVERIFIED_EMAIL = 6
|
62
63
|
TYPE_PREVERIFIED_PHONE_NUMBER = 7
|
64
|
+
TYPE_E2E_PASSPHRASE = 8
|
63
65
|
|
64
66
|
def initialize(verification) # rubocop:disable Metrics/CyclomaticComplexity Not relevant for a case/when
|
65
67
|
super()
|
@@ -97,11 +99,15 @@ module Tanker
|
|
97
99
|
@preverified_phone_number = CTanker.new_cstring verification.preverified_phone_number
|
98
100
|
self[:type] = TYPE_PREVERIFIED_PHONE_NUMBER
|
99
101
|
self[:preverified_phone_number] = @preverified_phone_number
|
102
|
+
when Tanker::E2ePassphraseVerification
|
103
|
+
@e2e_passphrase = CTanker.new_cstring verification.e2e_passphrase
|
104
|
+
self[:type] = TYPE_E2E_PASSPHRASE
|
105
|
+
self[:e2e_passphrase] = @e2e_passphrase
|
100
106
|
else
|
101
107
|
raise ArgumentError, 'Unknown Tanker::Verification type!'
|
102
108
|
end
|
103
109
|
|
104
|
-
self[:version] =
|
110
|
+
self[:version] = 6
|
105
111
|
end
|
106
112
|
end
|
107
113
|
|
@@ -18,6 +18,7 @@ module Tanker
|
|
18
18
|
TYPE_PHONE_NUMBER = 5
|
19
19
|
TYPE_PREVERIFIED_EMAIL = 6
|
20
20
|
TYPE_PREVERIFIED_PHONE_NUMBER = 7
|
21
|
+
TYPE_E2E_PASSPHRASE = 8
|
21
22
|
|
22
23
|
def to_verification_method # rubocop:disable Metrics/CyclomaticComplexity Not relevant for a case/when
|
23
24
|
case self[:type]
|
@@ -35,6 +36,8 @@ module Tanker
|
|
35
36
|
PreverifiedEmailVerificationMethod.new(self[:value].read_string.force_encoding(Encoding::UTF_8))
|
36
37
|
when TYPE_PREVERIFIED_PHONE_NUMBER
|
37
38
|
PreverifiedPhoneNumberVerificationMethod.new(self[:value].read_string.force_encoding(Encoding::UTF_8))
|
39
|
+
when TYPE_E2E_PASSPHRASE
|
40
|
+
E2ePassphraseVerificationMethod.new
|
38
41
|
else
|
39
42
|
raise "Unknown VerificationMethod type #{self[:type]}!"
|
40
43
|
end
|
@@ -93,4 +93,16 @@ module Tanker
|
|
93
93
|
@preverified_phone_number = preverified_phone_number
|
94
94
|
end
|
95
95
|
end
|
96
|
+
|
97
|
+
class E2ePassphraseVerification < Verification
|
98
|
+
attr_reader :e2e_passphrase
|
99
|
+
|
100
|
+
def initialize(e2e_passphrase)
|
101
|
+
super()
|
102
|
+
|
103
|
+
ASSERT_UTF8.call(e2e_passphrase)
|
104
|
+
|
105
|
+
@e2e_passphrase = e2e_passphrase
|
106
|
+
end
|
107
|
+
end
|
96
108
|
end
|
data/lib/tanker/core/version.rb
CHANGED
@@ -5,14 +5,16 @@ require 'ffi'
|
|
5
5
|
module Tanker
|
6
6
|
# Options that can be given when using a verification method
|
7
7
|
class VerificationOptions < FFI::Struct
|
8
|
-
def initialize(with_session_token: false)
|
8
|
+
def initialize(with_session_token: false, allow_e2e_method_switch: false)
|
9
9
|
super()
|
10
10
|
|
11
|
-
self[:version] =
|
11
|
+
self[:version] = 2
|
12
12
|
self[:with_session_token] = with_session_token ? 1 : 0
|
13
|
+
self[:allow_e2e_method_switch] = allow_e2e_method_switch ? 1 : 0
|
13
14
|
end
|
14
15
|
|
15
16
|
layout :version, :uint8,
|
16
|
-
:with_session_token, :uint8
|
17
|
+
:with_session_token, :uint8,
|
18
|
+
:allow_e2e_method_switch, :uint8
|
17
19
|
end
|
18
20
|
end
|
Binary file
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tanker-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.32.0.alpha.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tanker team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|