tanker-core 2.32.0.beta.4 → 2.32.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b6a87a0e55967cc6690dac95fc6fb21356d9cbcf3bafa5f3e325f0858488fd35
4
- data.tar.gz: f29a033b3dc9ef052b36b13cf8bdd31a7727b92753933c111b83bb4d3fed0be8
3
+ metadata.gz: '09ea2547e9fd50850a5ac257da7af0bb0eac4b49043e92281bafa02918938ad6'
4
+ data.tar.gz: 9296955532224703ca0da8a383ef03a092a335d5a64494688ee85f0b32430333
5
5
  SHA512:
6
- metadata.gz: 06c4d77be9a510ea4e5815c264f0ee3b1a5cb825edc532c034fb9f51944d51ab1ba947e50a0ffe54b25c5f73a13a7433e25127ae3c22a5ca45dcd4cd7d9f4d06
7
- data.tar.gz: 31d8c012d342518a34ff72964e1139aba0185ffec881f8c672ee09b7bccb3add816d3a2d0890e6447bba4f433b1045f198de29e5df44c8fedbbbf65ca06e527d
6
+ metadata.gz: 3e1e041622b19ecdc0fc979508133cd3ecefe5ed2942ccd64a4863d87876fc6a882f7829493d70ebc7bcd14e8befe4fcffb99ee52cd218723172da25ad7e1eb7
7
+ data.tar.gz: 3120e9bb41a5065625b4cd0b640e7824212333c7560af8a9f24adf03238c1d4e11a103b812be907f60dff0a82f71ad29976661f15d478d00b3da5d857afae20c
@@ -14,7 +14,7 @@ end
14
14
  module Tanker
15
15
  module CTanker
16
16
  def self.get_path(name)
17
- File.expand_path "../../../vendor/tanker/#{FFI::Platform::OS}-#{FFI::Platform::ARCH}/"\
17
+ File.expand_path "../../../vendor/tanker/#{FFI::Platform::OS}-#{FFI::Platform::ARCH}/" \
18
18
  "#{FFI::Platform::LIBPREFIX}#{name}.#{FFI::Platform::LIBSUFFIX}", __dir__
19
19
  end
20
20
 
@@ -47,7 +47,7 @@ module Tanker
47
47
  blocking_attach_function :tanker_attach_provisional_identity, [:session_pointer, :string], CFuture
48
48
  blocking_attach_function :tanker_verify_provisional_identity, [:session_pointer, CVerification], CFuture
49
49
 
50
- blocking_attach_function :tanker_encrypted_size, [:uint64, :uint32], :uint64
50
+ blocking_attach_function :tanker_encrypted_size, [:uint64], :uint64
51
51
  blocking_attach_function :tanker_decrypted_size, [:pointer, :uint64], CFuture
52
52
  blocking_attach_function :tanker_get_resource_id, [:pointer, :uint64], CFuture
53
53
 
@@ -68,7 +68,7 @@ module Tanker
68
68
 
69
69
  blocking_attach_function :tanker_encryption_session_open, [:session_pointer, Tanker::EncryptionOptions], CFuture
70
70
  blocking_attach_function :tanker_encryption_session_close, [:enc_sess_pointer], CFuture
71
- blocking_attach_function :tanker_encryption_session_encrypted_size, [:enc_sess_pointer, :uint64], :uint64
71
+ blocking_attach_function :tanker_encryption_session_encrypted_size, [:uint64], :uint64
72
72
  blocking_attach_function :tanker_encryption_session_get_resource_id, [:enc_sess_pointer], CFuture
73
73
  blocking_attach_function :tanker_encryption_session_encrypt, [:enc_sess_pointer, :pointer,
74
74
  :pointer, :uint64], CFuture
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'tanker/c_tanker'
4
- require 'tanker/encryption_options'
5
4
  require_relative 'encryption_session'
6
5
 
7
6
  module Tanker
@@ -81,19 +80,17 @@ module Tanker
81
80
 
82
81
  private
83
82
 
84
- def encrypt_common(data, encryption_options)
85
- unless encryption_options.nil? || encryption_options.is_a?(EncryptionOptions)
83
+ def encrypt_common(data, encryption_options = nil)
84
+ unless !encryption_options || encryption_options.is_a?(EncryptionOptions)
86
85
  raise TypeError, "expected encryption_options to be a EncryptionOptions, but got a #{encryption_options.class}"
87
86
  end
88
87
 
89
88
  inbuf = FFI::MemoryPointer.from_string(data)
90
89
 
91
- options = encryption_options || EncryptionOptions.new
92
-
93
- encrypted_size = CTanker.tanker_encrypted_size(data.bytesize, options[:padding_step])
90
+ encrypted_size = CTanker.tanker_encrypted_size data.bytesize
94
91
  outbuf = FFI::MemoryPointer.new(:char, encrypted_size)
95
92
 
96
- CTanker.tanker_encrypt(@ctanker, outbuf, inbuf, data.bytesize, options).get
93
+ CTanker.tanker_encrypt(@ctanker, outbuf, inbuf, data.bytesize, encryption_options).get
97
94
 
98
95
  outbuf.read_string encrypted_size
99
96
  end
@@ -33,7 +33,7 @@ module Tanker
33
33
  def encrypt_common(data)
34
34
  inbuf = FFI::MemoryPointer.from_string(data)
35
35
 
36
- encrypted_size = CTanker.tanker_encryption_session_encrypted_size(@csession, data.bytesize)
36
+ encrypted_size = CTanker.tanker_encryption_session_encrypted_size data.bytesize
37
37
  outbuf = FFI::MemoryPointer.new(:char, encrypted_size)
38
38
 
39
39
  CTanker.tanker_encryption_session_encrypt(@csession, outbuf, inbuf, data.bytesize).get
@@ -14,7 +14,7 @@ module Tanker
14
14
  end
15
15
  end
16
16
 
17
- def self.set_log_handler(&block) # rubocop:disable Naming/AccessorMethodName
17
+ def self.set_log_handler(&block)
18
18
  @log_handler_set = 1
19
19
  @log_handler = lambda do |clog|
20
20
  block.call LogRecord.new clog[:category], clog[:level], clog[:file], clog[:line], clog[:message]
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Tanker
4
4
  class Core
5
- VERSION = '2.32.0.beta.4'
5
+ VERSION = '2.32.0'
6
6
 
7
7
  def self.native_version
8
8
  CTanker.tanker_version_string
@@ -6,8 +6,7 @@ require 'tanker/c_tanker/c_string'
6
6
  module Tanker
7
7
  # Options that can be given when encrypting data
8
8
  class EncryptionOptions < FFI::Struct
9
- def initialize(share_with_users: [], share_with_groups: [], share_with_self: true,
10
- padding_step: Padding::AUTO)
9
+ def initialize(share_with_users: [], share_with_groups: [], share_with_self: true)
11
10
  super()
12
11
 
13
12
  @users_objs = share_with_users.map { |id| CTanker.new_cstring id }
@@ -18,13 +17,12 @@ module Tanker
18
17
  groups = FFI::MemoryPointer.new(:pointer, share_with_groups.length)
19
18
  groups.write_array_of_pointer(@groups_objs)
20
19
 
21
- self[:version] = 4
20
+ self[:version] = 3
22
21
  self[:recipient_public_identities] = users
23
22
  self[:nb_recipient_public_identities] = share_with_users.length
24
23
  self[:recipient_group_ids] = groups
25
24
  self[:nb_recipient_group_ids] = share_with_groups.length
26
25
  self[:share_with_self] = share_with_self
27
- self[:padding_step] = padding_step.native_value
28
26
  end
29
27
 
30
28
  layout :version, :uint8,
@@ -32,33 +30,6 @@ module Tanker
32
30
  :nb_recipient_public_identities, :uint32,
33
31
  :recipient_group_ids, :pointer,
34
32
  :nb_recipient_group_ids, :uint32,
35
- :share_with_self, :bool,
36
- :padding_step, :uint32
37
- end
38
-
39
- class Padding
40
- private_class_method :new
41
- attr_reader :native_value
42
-
43
- def initialize(native_value)
44
- super()
45
- @native_value = native_value
46
- end
47
-
48
- AUTO = new 0
49
- OFF = new 1
50
-
51
- def self.step(value)
52
- unless value.is_a?(Integer)
53
- raise TypeError,
54
- "expected step to be an Integer >= 2, but got a #{value.class}"
55
- end
56
- unless value >= 2
57
- raise ArgumentError,
58
- "expected step to be an Integer >= 2, but got #{value}"
59
- end
60
-
61
- new(value)
62
- end
33
+ :share_with_self, :bool
63
34
  end
64
35
  end
metadata CHANGED
@@ -1,127 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tanker-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.32.0.beta.4
4
+ version: 2.32.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: 2022-07-07 00:00:00.000000000 Z
11
+ date: 2022-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: ffi
14
+ name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.13'
19
+ version: 0.17.5
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.13'
27
- - !ruby/object:Gem::Dependency
28
- name: bundler
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '2.0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '2.0'
41
- - !ruby/object:Gem::Dependency
42
- name: bundler-audit
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '0.7'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '0.7'
55
- - !ruby/object:Gem::Dependency
56
- name: rake
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '13.0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '13.0'
69
- - !ruby/object:Gem::Dependency
70
- name: rspec
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '3.0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '3.0'
26
+ version: 0.17.5
83
27
  - !ruby/object:Gem::Dependency
84
- name: rubocop
28
+ name: ffi
85
29
  requirement: !ruby/object:Gem::Requirement
86
30
  requirements:
87
31
  - - "~>"
88
32
  - !ruby/object:Gem::Version
89
33
  version: '1.13'
90
- type: :development
34
+ type: :runtime
91
35
  prerelease: false
92
36
  version_requirements: !ruby/object:Gem::Requirement
93
37
  requirements:
94
38
  - - "~>"
95
39
  - !ruby/object:Gem::Version
96
40
  version: '1.13'
97
- - !ruby/object:Gem::Dependency
98
- name: rubygems-tasks
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: 0.2.5
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: 0.2.5
111
- - !ruby/object:Gem::Dependency
112
- name: tanker-identity
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '0.1'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: '0.1'
125
41
  description: |
126
42
  Ruby bindings for the Tanker SDK.
127
43
  Tanker is a platform as a service that allows you to easily protect your users' data with end-to-end encryption through a SDK
@@ -172,8 +88,8 @@ licenses:
172
88
  - Apache-2.0
173
89
  metadata:
174
90
  homepage_uri: https://tanker.io
175
- source_code_uri: https://github.com/TankerHQ/sdk-ruby
176
91
  rubygems_mfa_required: 'true'
92
+ source_code_uri: https://github.com/TankerHQ/sdk-ruby
177
93
  post_install_message:
178
94
  rdoc_options: []
179
95
  require_paths:
@@ -182,12 +98,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
182
98
  requirements:
183
99
  - - ">="
184
100
  - !ruby/object:Gem::Version
185
- version: 2.6.0
101
+ version: 2.7.0
186
102
  required_rubygems_version: !ruby/object:Gem::Requirement
187
103
  requirements:
188
- - - ">"
104
+ - - ">="
189
105
  - !ruby/object:Gem::Version
190
- version: 1.3.1
106
+ version: '0'
191
107
  requirements: []
192
108
  rubygems_version: 3.3.7
193
109
  signing_key: