tanker-core 2.11.0.beta.2 → 2.12.1.beta.5
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.rb +1 -1
- data/lib/tanker/admin/c_admin/c_app_update_options.rb +1 -0
- data/lib/tanker/c_tanker/c_string.rb +1 -1
- data/lib/tanker/c_tanker/c_verification.rb +6 -2
- data/lib/tanker/core/init.rb +1 -1
- data/lib/tanker/core/options.rb +3 -1
- data/lib/tanker/core/verification.rb +9 -1
- data/lib/tanker/core/verification_method.rb +1 -0
- data/lib/tanker/core/version.rb +1 -1
- data/lib/tanker/encryption_options.rb +2 -0
- data/lib/tanker/sharing_options.rb +2 -0
- data/lib/tanker/verification_options.rb +2 -0
- data/vendor/tanker/darwin-x86_64/libctanker.dylib +0 -0
- data/vendor/tanker/linux-x86_64/libctanker.so +0 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bd4f18770e5f9299a1a5b1be55000b28c645e8a51bd3ab372e357d4beea76e9
|
4
|
+
data.tar.gz: d61e61f71337407244ec0ad31671145589add283e8292797fd056577a9678c58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26eecff6d8a461574651ab0b73d72166286f043de5e9441ae3f909a38b5f015e889cb2ad7835cb15142f94ab33af145df68552774ebeff92ac9e603812439e8d
|
7
|
+
data.tar.gz: 9bc8439e3089adc455ebbc5210e968b7615ed7ff7ea5003b9ec8c808b29b8888a2c428141f727b4a4fa55b4a17043ef839e0bf09d652c6ad058ec96fb7eb85a7
|
data/lib/tanker/admin/c_admin.rb
CHANGED
@@ -13,7 +13,7 @@ module Tanker
|
|
13
13
|
ffi_lib Tanker::CTanker.get_path('tanker_admin-c')
|
14
14
|
typedef :pointer, :admin_pointer
|
15
15
|
|
16
|
-
#
|
16
|
+
# NOTE: We use those CFutures with the tanker_future_* functions exposed by CTanker,
|
17
17
|
# this is safe because we only do simple synchronous blocking calls, without using tanker_future_then.
|
18
18
|
|
19
19
|
attach_function :tanker_admin_connect, [:string, :string], CTanker::CFuture
|
@@ -7,6 +7,7 @@ module Tanker
|
|
7
7
|
class Admin
|
8
8
|
class AppUpdateOptions < FFI::Struct
|
9
9
|
def initialize(oidc_client_id: nil, oidc_client_provider: nil, session_certificates: nil)
|
10
|
+
super()
|
10
11
|
self[:version] = 1
|
11
12
|
unless oidc_client_id.nil?
|
12
13
|
@oidc_client_id = CTanker.new_cstring oidc_client_id
|
@@ -7,7 +7,7 @@ module Tanker::CTanker
|
|
7
7
|
# you can't just assign a string literal to a cstring.
|
8
8
|
# They'd rather not handle allocations transparently (lifetimes are tricky),
|
9
9
|
# so we have to take care of allocations and lifetimes ourselves.
|
10
|
-
def self.new_cstring(str_or_nil, manual = false)
|
10
|
+
def self.new_cstring(str_or_nil, manual = false) # rubocop:disable Style/OptionalBooleanParameter
|
11
11
|
return nil if str_or_nil.nil?
|
12
12
|
|
13
13
|
cstr = FFI::MemoryPointer.from_string(str_or_nil)
|
@@ -12,7 +12,9 @@ module Tanker
|
|
12
12
|
:verification_code, :pointer
|
13
13
|
|
14
14
|
def initialize(email, verification_code)
|
15
|
-
|
15
|
+
super()
|
16
|
+
|
17
|
+
# NOTE: Instance variables are required to keep the CStrings alive
|
16
18
|
@email = CTanker.new_cstring email
|
17
19
|
@verification_code = CTanker.new_cstring verification_code
|
18
20
|
|
@@ -36,11 +38,13 @@ module Tanker
|
|
36
38
|
TYPE_OIDC_ID_TOKEN = 4
|
37
39
|
|
38
40
|
def initialize(verification)
|
41
|
+
super()
|
42
|
+
|
39
43
|
unless verification.is_a? Tanker::Verification
|
40
44
|
raise TypeError, 'Verification argument is not a Tanker::Verification'
|
41
45
|
end
|
42
46
|
|
43
|
-
#
|
47
|
+
# NOTE: Instance variables are required to keep the CStrings alive
|
44
48
|
case verification
|
45
49
|
when Tanker::EmailVerification
|
46
50
|
self[:type] = TYPE_EMAIL
|
data/lib/tanker/core/init.rb
CHANGED
@@ -31,7 +31,7 @@ module Tanker
|
|
31
31
|
CTanker.tanker_init
|
32
32
|
|
33
33
|
# Do not spam the console of our users.
|
34
|
-
self.class.set_log_handler { |_| } unless self.class.test_and_set_log_handler == 1
|
34
|
+
self.class.set_log_handler { |_| } unless self.class.test_and_set_log_handler == 1 # rubocop:disable Lint/EmptyBlock
|
35
35
|
|
36
36
|
@revoke_event_handlers = Set.new
|
37
37
|
@ctanker = CTanker.tanker_create(options).get
|
data/lib/tanker/core/options.rb
CHANGED
@@ -17,7 +17,9 @@ module Tanker
|
|
17
17
|
SDK_VERSION = CTanker.new_cstring Core::VERSION
|
18
18
|
|
19
19
|
def initialize(app_id:, url: nil, sdk_type: SDK_TYPE, writable_path: nil)
|
20
|
-
|
20
|
+
super()
|
21
|
+
|
22
|
+
# NOTE: Instance variables are required to keep the CStrings alive
|
21
23
|
@app_id = CTanker.new_cstring app_id
|
22
24
|
@url = CTanker.new_cstring url
|
23
25
|
@writable_path = CTanker.new_cstring writable_path
|
@@ -4,12 +4,14 @@ require 'ffi'
|
|
4
4
|
require 'tanker/c_tanker/c_string'
|
5
5
|
|
6
6
|
module Tanker
|
7
|
-
class Verification; end
|
7
|
+
class Verification; end # rubocop:disable Lint/EmptyClass
|
8
8
|
|
9
9
|
class EmailVerification < Verification
|
10
10
|
attr_reader :email, :verification_code
|
11
11
|
|
12
12
|
def initialize(email, verif_code)
|
13
|
+
super()
|
14
|
+
|
13
15
|
ASSERT_UTF8.call(email)
|
14
16
|
ASSERT_UTF8.call(verif_code)
|
15
17
|
|
@@ -22,6 +24,8 @@ module Tanker
|
|
22
24
|
attr_reader :passphrase
|
23
25
|
|
24
26
|
def initialize(passphrase)
|
27
|
+
super()
|
28
|
+
|
25
29
|
ASSERT_UTF8.call(passphrase)
|
26
30
|
|
27
31
|
@passphrase = passphrase
|
@@ -32,6 +36,8 @@ module Tanker
|
|
32
36
|
attr_reader :verification_key
|
33
37
|
|
34
38
|
def initialize(verif_key)
|
39
|
+
super()
|
40
|
+
|
35
41
|
ASSERT_UTF8.call(verif_key)
|
36
42
|
|
37
43
|
@verification_key = verif_key
|
@@ -42,6 +48,8 @@ module Tanker
|
|
42
48
|
attr_reader :oidc_id_token
|
43
49
|
|
44
50
|
def initialize(oidc_id_token)
|
51
|
+
super()
|
52
|
+
|
45
53
|
ASSERT_UTF8.call(oidc_id_token)
|
46
54
|
|
47
55
|
@oidc_id_token = oidc_id_token
|
data/lib/tanker/core/version.rb
CHANGED
@@ -7,6 +7,8 @@ module Tanker
|
|
7
7
|
# Options that can be given when encrypting data
|
8
8
|
class EncryptionOptions < FFI::Struct
|
9
9
|
def initialize(share_with_users: [], share_with_groups: [], share_with_self: true)
|
10
|
+
super()
|
11
|
+
|
10
12
|
@users_objs = share_with_users.map { |id| CTanker.new_cstring id }
|
11
13
|
users = FFI::MemoryPointer.new(:pointer, share_with_users.length)
|
12
14
|
users.write_array_of_pointer(@users_objs)
|
@@ -7,6 +7,8 @@ module Tanker
|
|
7
7
|
# Options that can be given when sharing data
|
8
8
|
class SharingOptions < FFI::Struct
|
9
9
|
def initialize(share_with_users: [], share_with_groups: [])
|
10
|
+
super()
|
11
|
+
|
10
12
|
@users_objs = share_with_users.map { |id| CTanker.new_cstring id }
|
11
13
|
users = FFI::MemoryPointer.new(:pointer, share_with_users.length)
|
12
14
|
users.write_array_of_pointer(@users_objs)
|
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.1.beta.5
|
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-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: '1.13'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: '1.13'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rubygems-tasks
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|