tanker-core 4.2.1 → 4.3.0.alpha.2

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: 45642288b534e67519487f9da9b697f21875ee66831e4ee91fe587b9748fdfdf
4
- data.tar.gz: ae8bc7f15ef328d1185d48086b177424b4182f37b61c182dc9c394ad8836584a
3
+ metadata.gz: 6f707da22c3fe58482a8324ef101febd1404a981e3c0edb3d852caaffd445233
4
+ data.tar.gz: 1aef05aa1997a2f161fc54771d9bbae03a50d42c6cd000bfa2681ee75b077dcb
5
5
  SHA512:
6
- metadata.gz: eb6bcdfdc78d70a201039c4980ec55b954315ade3682c0933b2b07f65e27725a01a7b1248c3b5d90554eb1f301301bcdd8a513cca5e36137e5075c09df2b4c9e
7
- data.tar.gz: 31b3656945dca2d7e4e77f9f8234c34a3db115f3fac0b1f0c1cfa34412bed316922dc9429e694ab07583e4ce645f3ca8a7779f4b27b084b85b2d468530f0a6d3
6
+ metadata.gz: eb99d079a0bd15a60f15488f0924678fa0725b22f286e03bcdca41fc329e1bc7e49fc33a0b8015e722469c8008d86c90d6bd320a5dc3dc5e67ad3499f173be41
7
+ data.tar.gz: 3a770be3e676a9a922a6621dcc77b735b4c5e87223a5a34dccb3d726332bccf8894c1123d57684bfc0383618e678267178d561fcbba44df649e36bf902e41cf4
@@ -93,7 +93,8 @@ module Tanker
93
93
  :preverified_email, :pointer,
94
94
  :preverified_phone_number, :pointer,
95
95
  :preverified_oidc, COIDCVerification,
96
- :oidc_authorization_code_verification, COIDCAuthorizationCodeVerification
96
+ :oidc_authorization_code_verification, COIDCAuthorizationCodeVerification,
97
+ :prehashed_and_encrypted_passphrase, :pointer
97
98
 
98
99
  TYPE_EMAIL = 1
99
100
  TYPE_PASSPHRASE = 2
@@ -105,6 +106,7 @@ module Tanker
105
106
  TYPE_E2E_PASSPHRASE = 8
106
107
  TYPE_PREVERIFIED_OIDC = 9
107
108
  TYPE_OIDC_AUTHORIZATION_CODE = 10
109
+ TYPE_PREHASHED_AND_ENCRYPTED_PASSPHRASE = 11
108
110
 
109
111
  def initialize(verification) # rubocop:disable Metrics/MethodLength, Metrics/CyclomaticComplexity Not relevant for a case/when
110
112
  super()
@@ -157,11 +159,15 @@ module Tanker
157
159
  verification.authorization_code,
158
160
  verification.state
159
161
  )
162
+ when Tanker::PrehashedAndEncryptedPassphraseVerification
163
+ @prehashed_and_encrypted_passphrase = CTanker.new_cstring verification.prehashed_and_encrypted_passphrase
164
+ self[:type] = TYPE_PREHASHED_AND_ENCRYPTED_PASSPHRASE
165
+ self[:prehashed_and_encrypted_passphrase] = @prehashed_and_encrypted_passphrase
160
166
  else
161
167
  raise ArgumentError, 'Unknown Tanker::Verification type!'
162
168
  end
163
169
 
164
- self[:version] = 8
170
+ self[:version] = 9
165
171
  end
166
172
  end
167
173
 
@@ -90,6 +90,7 @@ module Tanker
90
90
  blocking_attach_function :tanker_http_handle_response, [CHttpRequest, CHttpResponse], :void
91
91
 
92
92
  blocking_attach_function :tanker_prehash_password, [:string], CFuture
93
+ blocking_attach_function :tanker_prehash_and_encrypt_password, [:string, :string], CFuture
93
94
 
94
95
  blocking_attach_function :tanker_authenticate_with_idp, [:session_pointer, :string, :string], CFuture
95
96
  blocking_attach_function :tanker_free_authenticate_with_idp_result, [:pointer], :void
@@ -79,6 +79,13 @@ module Tanker
79
79
  CTanker.tanker_prehash_password(str).get_string
80
80
  end
81
81
 
82
+ def self.prehash_and_encrypt_password(password, public_key)
83
+ ASSERT_UTF8.call(password)
84
+ ASSERT_UTF8.call(public_key)
85
+
86
+ CTanker.tanker_prehash_and_encrypt_password(password, public_key).get_string
87
+ end
88
+
82
89
  private
83
90
 
84
91
  def encrypt_common(data, encryption_options)
@@ -139,4 +139,16 @@ module Tanker
139
139
  @e2e_passphrase = e2e_passphrase
140
140
  end
141
141
  end
142
+
143
+ class PrehashedAndEncryptedPassphraseVerification < Verification
144
+ attr_reader :prehashed_and_encrypted_passphrase
145
+
146
+ def initialize(prehashed_and_encrypted_passphrase)
147
+ super()
148
+
149
+ ASSERT_UTF8.call(prehashed_and_encrypted_passphrase)
150
+
151
+ @prehashed_and_encrypted_passphrase = prehashed_and_encrypted_passphrase
152
+ end
153
+ end
142
154
  end
@@ -78,4 +78,6 @@ module Tanker
78
78
  end
79
79
 
80
80
  class E2ePassphraseVerificationMethod < VerificationMethod; end
81
+
82
+ class PrehashedAndEncryptedPassphraseVerificationMethod < VerificationMethod; end
81
83
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Tanker
4
4
  class Core
5
- VERSION = '4.2.1'
5
+ VERSION = '4.3.0.alpha.2'
6
6
 
7
7
  def self.native_version
8
8
  CTanker.tanker_version_string
data/lib/tanker/core.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'set'
4
3
  # always keep this file first, it defines the module and the class
5
4
  require_relative 'core/version'
6
5
  require_relative 'c_tanker'
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tanker-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.1
4
+ version: 4.3.0.alpha.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanker team
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-09-13 00:00:00.000000000 Z
10
+ date: 2025-01-03 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: faraday
@@ -47,7 +46,6 @@ dependencies:
47
46
  description: |
48
47
  Ruby bindings for the Tanker SDK.
49
48
  Tanker is a platform as a service that allows you to easily protect your users' data with end-to-end encryption through a SDK
50
- email:
51
49
  executables: []
52
50
  extensions: []
53
51
  extra_rdoc_files: []
@@ -87,13 +85,11 @@ files:
87
85
  - vendor/tanker/darwin-aarch64/libctanker.dylib
88
86
  - vendor/tanker/darwin-x86_64/libctanker.dylib
89
87
  - vendor/tanker/linux-x86_64/libctanker.so
90
- homepage:
91
88
  licenses:
92
89
  - Apache-2.0
93
90
  metadata:
94
91
  rubygems_mfa_required: 'true'
95
92
  source_code_uri: https://github.com/TankerHQ/sdk-ruby
96
- post_install_message:
97
93
  rdoc_options: []
98
94
  require_paths:
99
95
  - lib
@@ -101,15 +97,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
101
97
  requirements:
102
98
  - - ">="
103
99
  - !ruby/object:Gem::Version
104
- version: 3.1.0
100
+ version: 3.2.0
105
101
  required_rubygems_version: !ruby/object:Gem::Requirement
106
102
  requirements:
107
103
  - - ">="
108
104
  - !ruby/object:Gem::Version
109
105
  version: '0'
110
106
  requirements: []
111
- rubygems_version: 3.4.10
112
- signing_key:
107
+ rubygems_version: 3.6.2
113
108
  specification_version: 4
114
109
  summary: Ruby SDK for Tanker
115
110
  test_files: []