tanker-core 2.26.0.alpha.3 → 2.27.0.alpha.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/tanker/admin/c_admin/c_app_update_options.rb +12 -4
- data/lib/tanker/c_tanker/c_verification.rb +27 -0
- data/lib/tanker/c_tanker.rb +1 -4
- data/lib/tanker/core/init.rb +0 -18
- data/lib/tanker/core/session.rb +7 -5
- data/lib/tanker/core/version.rb +1 -1
- 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 -3
- data/lib/tanker/c_tanker/c_event.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 793322caa4dbe43066e014ef94c5bb90fe00de196a3b014a87aa906d0ab59146
|
4
|
+
data.tar.gz: 59bea480bd51af3f8d5f5796725b28b6700b079e4a93da72d448a7f7c9280513
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d76cc9e364d420c37e1741ca0eda48ec10019d7f3d8ac2cba5e1660c87f65f1db40b0676be63ae5bed0af2995aa4e7c72546a967ad7994cd7610aea7cf2f6e3a
|
7
|
+
data.tar.gz: 32d32bfa19cf440da4d305b53e0d0097316c119b6b587d6b3ebadb823d75c7d6660f6639391a19e77721a4881711bc150d514657ecf06cb403d1aca95e5b7f6a
|
@@ -7,9 +7,10 @@ module Tanker
|
|
7
7
|
class Admin
|
8
8
|
class AppUpdateOptions < FFI::Struct
|
9
9
|
def initialize(oidc_client_id: nil, oidc_client_provider: nil,
|
10
|
-
session_certificates: nil, preverified_verification: nil
|
10
|
+
session_certificates: nil, preverified_verification: nil,
|
11
|
+
user_enrollment: nil)
|
11
12
|
super()
|
12
|
-
self[:version] =
|
13
|
+
self[:version] = 3
|
13
14
|
unless oidc_client_id.nil?
|
14
15
|
@oidc_client_id = CTanker.new_cstring oidc_client_id
|
15
16
|
self[:oidc_client_id] = @oidc_client_id
|
@@ -24,19 +25,26 @@ module Tanker
|
|
24
25
|
@session_certificates = boolptr
|
25
26
|
self[:session_certificates] = @session_certificates
|
26
27
|
end
|
27
|
-
unless preverified_verification.nil?
|
28
|
+
unless preverified_verification.nil?
|
28
29
|
boolptr = FFI::MemoryPointer.new(:bool, 1)
|
29
30
|
boolptr.put(:bool, 0, preverified_verification)
|
30
31
|
@preverified_verification = boolptr
|
31
32
|
self[:preverified_verification] = @preverified_verification
|
32
33
|
end
|
34
|
+
unless user_enrollment.nil? # rubocop:disable Style/GuardClause no different than the other parameters
|
35
|
+
boolptr = FFI::MemoryPointer.new(:bool, 1)
|
36
|
+
boolptr.put(:bool, 0, user_enrollment)
|
37
|
+
@user_enrollment = boolptr
|
38
|
+
self[:user_enrollment] = @user_enrollment
|
39
|
+
end
|
33
40
|
end
|
34
41
|
|
35
42
|
layout :version, :uint8,
|
36
43
|
:oidc_client_id, :pointer,
|
37
44
|
:oidc_client_provider, :pointer,
|
38
45
|
:session_certificates, :pointer,
|
39
|
-
:preverified_verification, :pointer
|
46
|
+
:preverified_verification, :pointer,
|
47
|
+
:user_enrollment, :pointer
|
40
48
|
end
|
41
49
|
end
|
42
50
|
end
|
@@ -104,5 +104,32 @@ module Tanker
|
|
104
104
|
self[:version] = 5
|
105
105
|
end
|
106
106
|
end
|
107
|
+
|
108
|
+
class CVerificationList < FFI::Struct
|
109
|
+
layout :version, :uint8,
|
110
|
+
:verifications, :pointer,
|
111
|
+
:count, :uint32
|
112
|
+
|
113
|
+
def initialize(verifications)
|
114
|
+
super()
|
115
|
+
|
116
|
+
unless verifications.is_a?(Array)
|
117
|
+
raise TypeError, 'Verifications argument is not an Array[Tanker::Verification]'
|
118
|
+
end
|
119
|
+
|
120
|
+
self[:version] = 1
|
121
|
+
self[:count] = verifications.length
|
122
|
+
|
123
|
+
# NOTE: Instance variables are required to keep the CVerifications alive
|
124
|
+
@verifications = []
|
125
|
+
self[:verifications] = FFI::MemoryPointer.new(CVerification, self[:count])
|
126
|
+
verifications.each_with_index do |verification, idx|
|
127
|
+
@verifications.push(CVerification.new(verification))
|
128
|
+
# NOTE: memcopy
|
129
|
+
str = @verifications[idx].pointer.read_bytes CVerification.size
|
130
|
+
self[:verifications].put_bytes(idx * CVerification.size, str, 0, CVerification.size)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|
107
134
|
end
|
108
135
|
end
|
data/lib/tanker/c_tanker.rb
CHANGED
@@ -10,7 +10,6 @@ require_relative 'c_tanker/c_future'
|
|
10
10
|
require_relative 'c_tanker/c_verification'
|
11
11
|
require_relative 'c_tanker/c_verification_method'
|
12
12
|
require_relative 'c_tanker/c_log_record'
|
13
|
-
require_relative 'c_tanker/c_event'
|
14
13
|
require_relative 'c_tanker/c_device_info'
|
15
14
|
|
16
15
|
module FFI::Library
|
@@ -32,7 +31,6 @@ module Tanker
|
|
32
31
|
typedef :pointer, :read_operation_pointer
|
33
32
|
|
34
33
|
callback :log_handler_callback, [CLogRecord.by_ref], :void
|
35
|
-
callback :event_callback, [:pointer], :void
|
36
34
|
callback :stream_input_source_callback, [:pointer, :int64, :read_operation_pointer, :pointer], :void
|
37
35
|
|
38
36
|
blocking_attach_function :tanker_init, [], :void
|
@@ -40,6 +38,7 @@ module Tanker
|
|
40
38
|
blocking_attach_function :tanker_create, [Tanker::Core::Options], CFuture
|
41
39
|
blocking_attach_function :tanker_destroy, [:session_pointer], CFuture
|
42
40
|
blocking_attach_function :tanker_start, [:session_pointer, :string], CFuture
|
41
|
+
blocking_attach_function :tanker_enroll_user, [:session_pointer, :string, CVerificationList], CFuture
|
43
42
|
blocking_attach_function :tanker_register_identity, [:session_pointer, CVerification,
|
44
43
|
Tanker::VerificationOptions], CFuture
|
45
44
|
blocking_attach_function :tanker_verify_identity, [:session_pointer, CVerification,
|
@@ -51,7 +50,6 @@ module Tanker
|
|
51
50
|
blocking_attach_function :tanker_status, [:session_pointer], :uint32
|
52
51
|
blocking_attach_function :tanker_generate_verification_key, [:session_pointer], CFuture
|
53
52
|
blocking_attach_function :tanker_device_id, [:session_pointer], CFuture
|
54
|
-
blocking_attach_function :tanker_revoke_device, [:session_pointer, :string], CFuture
|
55
53
|
blocking_attach_function :tanker_get_device_list, [:session_pointer], CFuture
|
56
54
|
|
57
55
|
blocking_attach_function :tanker_attach_provisional_identity, [:session_pointer, :string], CFuture
|
@@ -97,7 +95,6 @@ module Tanker
|
|
97
95
|
blocking_attach_function :tanker_stream_close, [:stream_pointer], CFuture
|
98
96
|
|
99
97
|
blocking_attach_function :tanker_set_log_handler, [:log_handler_callback], :void
|
100
|
-
blocking_attach_function :tanker_event_connect, [:session_pointer, :uint32, :event_callback, :pointer], CFuture
|
101
98
|
|
102
99
|
blocking_attach_function :tanker_prehash_password, [:string], CFuture
|
103
100
|
|
data/lib/tanker/core/init.rb
CHANGED
@@ -3,8 +3,6 @@
|
|
3
3
|
module Tanker
|
4
4
|
# Main entry point for the Tanker SDK. Can open a Tanker session.
|
5
5
|
class Core
|
6
|
-
extend Gem::Deprecate
|
7
|
-
|
8
6
|
@log_handler_lock = Mutex.new
|
9
7
|
@log_handler_set = 0
|
10
8
|
|
@@ -33,7 +31,6 @@ module Tanker
|
|
33
31
|
# Do not spam the console of our users.
|
34
32
|
self.class.set_log_handler { |_| } unless self.class.test_and_set_log_handler == 1 # rubocop:disable Lint/EmptyBlock
|
35
33
|
|
36
|
-
@revoke_event_handlers = Set.new
|
37
34
|
@ctanker = CTanker.tanker_create(options).get
|
38
35
|
@freed = false
|
39
36
|
ctanker_addr = @ctanker.address
|
@@ -42,11 +39,6 @@ module Tanker
|
|
42
39
|
|
43
40
|
CTanker.tanker_destroy(FFI::Pointer.new(:void, ctanker_addr)).get
|
44
41
|
end
|
45
|
-
|
46
|
-
@device_revoked_handler = lambda { |_|
|
47
|
-
Thread.new { @revoke_event_handlers.each(&:call) }
|
48
|
-
}
|
49
|
-
CTanker.tanker_event_connect(@ctanker, CTanker::CTankerEvent::DEVICE_REVOKED, @device_revoked_handler, nil).get
|
50
42
|
end
|
51
43
|
|
52
44
|
def free
|
@@ -60,16 +52,6 @@ module Tanker
|
|
60
52
|
end
|
61
53
|
end
|
62
54
|
end
|
63
|
-
|
64
|
-
def connect_device_revoked_handler(&block)
|
65
|
-
@revoke_event_handlers.add block
|
66
|
-
end
|
67
|
-
|
68
|
-
deprecate :connect_device_revoked_handler, :none, 2021, 7
|
69
|
-
|
70
|
-
def disconnect_handler(&block)
|
71
|
-
@revoke_event_handlers.delete block
|
72
|
-
end
|
73
55
|
end
|
74
56
|
|
75
57
|
ASSERT_UTF8 = lambda do |str|
|
data/lib/tanker/core/session.rb
CHANGED
@@ -11,6 +11,11 @@ module Tanker
|
|
11
11
|
CTanker.tanker_start(@ctanker, identity).get.address
|
12
12
|
end
|
13
13
|
|
14
|
+
def enroll_user(identity, verifications)
|
15
|
+
cverifs = CTanker::CVerificationList.new(verifications)
|
16
|
+
CTanker.tanker_enroll_user(@ctanker, identity, cverifs).get
|
17
|
+
end
|
18
|
+
|
14
19
|
def generate_verification_key
|
15
20
|
CTanker.tanker_generate_verification_key(@ctanker).get_string
|
16
21
|
end
|
@@ -60,11 +65,8 @@ module Tanker
|
|
60
65
|
device_info_list
|
61
66
|
end
|
62
67
|
|
63
|
-
|
64
|
-
|
65
|
-
end
|
66
|
-
|
67
|
-
deprecate :revoke_device, :none, 2021, 7
|
68
|
+
deprecate :device_id, :none, 2022, 1
|
69
|
+
deprecate :device_list, :none, 2022, 1
|
68
70
|
|
69
71
|
def stop
|
70
72
|
CTanker.tanker_stop(@ctanker).get
|
data/lib/tanker/core/version.rb
CHANGED
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.27.0.alpha.1
|
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-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -142,7 +142,6 @@ files:
|
|
142
142
|
- lib/tanker/c_tanker.rb
|
143
143
|
- lib/tanker/c_tanker/c_backends.rb
|
144
144
|
- lib/tanker/c_tanker/c_device_info.rb
|
145
|
-
- lib/tanker/c_tanker/c_event.rb
|
146
145
|
- lib/tanker/c_tanker/c_future.rb
|
147
146
|
- lib/tanker/c_tanker/c_lib.rb
|
148
147
|
- lib/tanker/c_tanker/c_log_record.rb
|