tanker-core 2.10.1 → 2.12.0
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.rb +3 -2
- data/lib/tanker/admin/c_admin.rb +3 -1
- data/lib/tanker/admin/c_admin/c_app_update_options.rb +33 -0
- data/lib/tanker/c_tanker.rb +7 -3
- data/lib/tanker/c_tanker/c_future.rb +11 -0
- data/lib/tanker/core.rb +1 -0
- data/lib/tanker/core/session.rb +6 -6
- data/lib/tanker/core/version.rb +1 -1
- data/lib/tanker/verification_options.rb +16 -0
- data/vendor/tanker/darwin-x86_64/libctanker.dylib +0 -0
- data/vendor/tanker/linux-x86_64/libctanker.so +0 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6fa1761b23b1663e30de70ad32db2a522430a806ccdaeb8bc465cc86e0e7e142
|
4
|
+
data.tar.gz: 588e1249598597396d27ecc13ffd3cc4fefec6ff894f3602a446dd1dea45d5d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89bdc810ebd686e6c86eb8abd3fe1a24bba301a632761b6420d5130b1ddddff6477c299dfca609a9cd60c84988c409e9627790fa6916ea957e09de9f658ec3b7
|
7
|
+
data.tar.gz: 6689f376dc356ebf715c80eb21d99d500766a6b9a44d7a46c52612c025baa70b8f30c134cf5e9079186085b1eca11aeae00d0f5ae8598ab9f473b73d2effad62
|
data/lib/tanker/admin.rb
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
require 'ffi'
|
4
4
|
require_relative 'admin/c_admin'
|
5
5
|
require_relative 'admin/c_admin/c_app_descriptor'
|
6
|
+
require_relative 'admin/c_admin/c_app_update_options'
|
6
7
|
require_relative 'admin/app'
|
7
8
|
|
8
9
|
module Tanker
|
@@ -41,9 +42,9 @@ module Tanker
|
|
41
42
|
CAdmin.tanker_admin_delete_app(@cadmin, app_id).get
|
42
43
|
end
|
43
44
|
|
44
|
-
def app_update(app_id,
|
45
|
+
def app_update(app_id, app_update_options)
|
45
46
|
assert_connected
|
46
|
-
CAdmin.tanker_admin_app_update(@cadmin, app_id,
|
47
|
+
CAdmin.tanker_admin_app_update(@cadmin, app_id, app_update_options).get
|
47
48
|
end
|
48
49
|
|
49
50
|
private
|
data/lib/tanker/admin/c_admin.rb
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
require 'ffi'
|
4
4
|
require 'tanker/c_tanker/c_future'
|
5
5
|
require 'tanker/c_tanker/c_lib'
|
6
|
+
require_relative 'c_admin/c_app_update_options'
|
6
7
|
|
7
8
|
module Tanker
|
8
9
|
class Admin
|
@@ -20,7 +21,8 @@ module Tanker
|
|
20
21
|
attach_function :tanker_admin_delete_app, [:admin_pointer, :string], CTanker::CFuture
|
21
22
|
attach_function :tanker_admin_destroy, [:admin_pointer], CTanker::CFuture
|
22
23
|
attach_function :tanker_admin_app_descriptor_free, [:pointer], :void
|
23
|
-
attach_function :tanker_admin_app_update, [:admin_pointer, :string,
|
24
|
+
attach_function :tanker_admin_app_update, [:admin_pointer, :string,
|
25
|
+
Tanker::Admin::AppUpdateOptions], CTanker::CFuture
|
24
26
|
attach_function :tanker_get_verification_code, [:string, :string, :string, :string], CTanker::CFuture
|
25
27
|
end
|
26
28
|
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'ffi'
|
4
|
+
require 'tanker/c_tanker/c_string'
|
5
|
+
|
6
|
+
module Tanker
|
7
|
+
class Admin
|
8
|
+
class AppUpdateOptions < FFI::Struct
|
9
|
+
def initialize(oidc_client_id: nil, oidc_client_provider: nil, session_certificates: nil)
|
10
|
+
self[:version] = 1
|
11
|
+
unless oidc_client_id.nil?
|
12
|
+
@oidc_client_id = CTanker.new_cstring oidc_client_id
|
13
|
+
self[:oidc_client_id] = @oidc_client_id
|
14
|
+
end
|
15
|
+
unless oidc_client_provider.nil?
|
16
|
+
@oidc_client_provider = CTanker.new_cstring oidc_client_provider
|
17
|
+
self[:oidc_client_provider] = @oidc_client_provider
|
18
|
+
end
|
19
|
+
unless session_certificates.nil? # rubocop:disable Style/GuardClause no different than the other two above
|
20
|
+
boolptr = FFI::MemoryPointer.new(:bool, 1)
|
21
|
+
boolptr.put(:bool, 0, session_certificates)
|
22
|
+
@session_certificates = boolptr
|
23
|
+
self[:session_certificates] = @session_certificates
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
layout :version, :uint8,
|
28
|
+
:oidc_client_id, :pointer,
|
29
|
+
:oidc_client_provider, :pointer,
|
30
|
+
:session_certificates, :pointer
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/tanker/c_tanker.rb
CHANGED
@@ -4,6 +4,7 @@ require 'ffi'
|
|
4
4
|
require_relative 'core/options'
|
5
5
|
require_relative 'sharing_options'
|
6
6
|
require_relative 'encryption_options'
|
7
|
+
require_relative 'verification_options'
|
7
8
|
require_relative 'c_tanker/c_lib'
|
8
9
|
require_relative 'c_tanker/c_future'
|
9
10
|
require_relative 'c_tanker/c_verification'
|
@@ -39,10 +40,13 @@ module Tanker
|
|
39
40
|
blocking_attach_function :tanker_create, [Tanker::Core::Options], CFuture
|
40
41
|
blocking_attach_function :tanker_destroy, [:session_pointer], CFuture
|
41
42
|
blocking_attach_function :tanker_start, [:session_pointer, :string], CFuture
|
42
|
-
blocking_attach_function :tanker_register_identity, [:session_pointer, CVerification
|
43
|
-
|
43
|
+
blocking_attach_function :tanker_register_identity, [:session_pointer, CVerification,
|
44
|
+
Tanker::VerificationOptions], CFuture
|
45
|
+
blocking_attach_function :tanker_verify_identity, [:session_pointer, CVerification,
|
46
|
+
Tanker::VerificationOptions], CFuture
|
44
47
|
blocking_attach_function :tanker_get_verification_methods, [:session_pointer], CFuture
|
45
|
-
blocking_attach_function :tanker_set_verification_method, [:session_pointer, CVerification
|
48
|
+
blocking_attach_function :tanker_set_verification_method, [:session_pointer, CVerification,
|
49
|
+
Tanker::VerificationOptions], CFuture
|
46
50
|
blocking_attach_function :tanker_stop, [:session_pointer], CFuture
|
47
51
|
blocking_attach_function :tanker_status, [:session_pointer], :uint32
|
48
52
|
blocking_attach_function :tanker_generate_verification_key, [:session_pointer], CFuture
|
@@ -37,6 +37,17 @@ module Tanker
|
|
37
37
|
CTanker.tanker_free_buffer str_ptr
|
38
38
|
str
|
39
39
|
end
|
40
|
+
|
41
|
+
def get_maybe_string # rubocop:disable Naming/AccessorMethodName (this is not a getter)
|
42
|
+
str_ptr = get
|
43
|
+
if str_ptr.null?
|
44
|
+
nil
|
45
|
+
else
|
46
|
+
str = str_ptr.get_string(0).force_encoding(Encoding::UTF_8)
|
47
|
+
CTanker.tanker_free_buffer str_ptr
|
48
|
+
str
|
49
|
+
end
|
50
|
+
end
|
40
51
|
end
|
41
52
|
end
|
42
53
|
end
|
data/lib/tanker/core.rb
CHANGED
@@ -10,6 +10,7 @@ require_relative 'core/verification'
|
|
10
10
|
require_relative 'core/encryption'
|
11
11
|
require_relative 'core/stream'
|
12
12
|
require_relative 'sharing_options'
|
13
|
+
require_relative 'verification_options'
|
13
14
|
require_relative 'core/group'
|
14
15
|
require_relative 'core/encryption_session'
|
15
16
|
require_relative 'core/log_record'
|
data/lib/tanker/core/session.rb
CHANGED
@@ -15,19 +15,19 @@ module Tanker
|
|
15
15
|
CTanker.tanker_generate_verification_key(@ctanker).get_string
|
16
16
|
end
|
17
17
|
|
18
|
-
def register_identity(verification)
|
18
|
+
def register_identity(verification, options = nil)
|
19
19
|
cverif = CTanker::CVerification.new(verification)
|
20
|
-
CTanker.tanker_register_identity(@ctanker, cverif).
|
20
|
+
CTanker.tanker_register_identity(@ctanker, cverif, options).get_maybe_string
|
21
21
|
end
|
22
22
|
|
23
|
-
def verify_identity(verification)
|
23
|
+
def verify_identity(verification, options = nil)
|
24
24
|
cverif = CTanker::CVerification.new(verification)
|
25
|
-
CTanker.tanker_verify_identity(@ctanker, cverif).
|
25
|
+
CTanker.tanker_verify_identity(@ctanker, cverif, options).get_maybe_string
|
26
26
|
end
|
27
27
|
|
28
|
-
def set_verification_method(verification
|
28
|
+
def set_verification_method(verification, options = nil)
|
29
29
|
cverif = CTanker::CVerification.new(verification)
|
30
|
-
CTanker.tanker_set_verification_method(@ctanker, cverif).
|
30
|
+
CTanker.tanker_set_verification_method(@ctanker, cverif, options).get_maybe_string
|
31
31
|
end
|
32
32
|
|
33
33
|
def get_verification_methods # rubocop:disable Naming/AccessorMethodName
|
data/lib/tanker/core/version.rb
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'ffi'
|
4
|
+
|
5
|
+
module Tanker
|
6
|
+
# Options that can be given when using a verification method
|
7
|
+
class VerificationOptions < FFI::Struct
|
8
|
+
def initialize(with_session_token: false)
|
9
|
+
self[:version] = 1
|
10
|
+
self[:with_session_token] = with_session_token ? 1 : 0
|
11
|
+
end
|
12
|
+
|
13
|
+
layout :version, :uint8,
|
14
|
+
:with_session_token, :uint8
|
15
|
+
end
|
16
|
+
end
|
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.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tanker team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -138,6 +138,7 @@ files:
|
|
138
138
|
- lib/tanker/admin/app.rb
|
139
139
|
- lib/tanker/admin/c_admin.rb
|
140
140
|
- lib/tanker/admin/c_admin/c_app_descriptor.rb
|
141
|
+
- lib/tanker/admin/c_admin/c_app_update_options.rb
|
141
142
|
- lib/tanker/c_tanker.rb
|
142
143
|
- lib/tanker/c_tanker/c_device_info.rb
|
143
144
|
- lib/tanker/c_tanker/c_event.rb
|
@@ -165,6 +166,7 @@ files:
|
|
165
166
|
- lib/tanker/encryption_options.rb
|
166
167
|
- lib/tanker/error.rb
|
167
168
|
- lib/tanker/sharing_options.rb
|
169
|
+
- lib/tanker/verification_options.rb
|
168
170
|
- vendor/tanker/darwin-x86_64/libctanker.dylib
|
169
171
|
- vendor/tanker/linux-x86_64/libctanker.so
|
170
172
|
homepage: https://tanker.io
|