robust_server_socket 0.4.3 → 0.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff044b4a2d2364baf2c581be81f73397687d779efde763e083a16198618b529b
4
- data.tar.gz: 66f699aa84b5ee877cfb426802744f1cbc724cbc90c62d2240cf204144fc1610
3
+ metadata.gz: 1c77eac44af0afbbb67432e817f05adc22a1e181371e8745a26f9d9c6824ca0f
4
+ data.tar.gz: 24e89717e46931ab832bfd470dbe66554729a745952d93aa3116600c53ee85b5
5
5
  SHA512:
6
- metadata.gz: 9a395b140ba5a24704bf7ce028139aa44f159af0331e0a24448e68903e2977bcfcdad82094a20e8ec5bc3bd30bb97533365e47096cbecd442c89b22d22a10280
7
- data.tar.gz: 5bb9fe9c3da67766edd8b9d5e0121b27a71301d229e87a471a36e65214d097875f662bea8c8dd5f434c902622ecdf0c21fd953c059536952957affe28890fe43
6
+ metadata.gz: e39d06bab2870ae9afac302b71690bb6eda4658991dd96882f521c9624a23737188d117297a64df1abd987c33f67178cdf59258a18090d72675e7544d67192cd
7
+ data.tar.gz: 9787d2103577e6b1f50b0fbd0b4396511cb30a1979fcaa0ed4ce1ec915d4c7ee0494954aa22b0e0a4b9d6478bcb71266309faf66acbe098bcb6773bfcea1fab1
data/README.en.md CHANGED
@@ -23,7 +23,7 @@ When building microservice architecture, the server side faces:
23
23
 
24
24
  RobustServerSocket provides:
25
25
 
26
- - **RSA decryption**: Token authenticity verification
26
+ - **Token decryption**: X25519 + AES-256-GCM authenticity check
27
27
  - **Client whitelist**: Only authorized services allowed
28
28
  - **Replay protection**: Blacklist of used tokens in Redis
29
29
  - **Rate limiting**: Sliding window per-client request limits
@@ -39,7 +39,7 @@ Incoming request with Secure-Token
39
39
  ┌──────────────────────────────┐
40
40
  │ RobustServerSocket │
41
41
  │ │
42
- │ 1. RSA Decrypt │
42
+ │ 1. Open token (AES-GCM) │
43
43
  │ 2. Validate Format │
44
44
  │ 3. Check Client Whitelist │
45
45
  │ 4. Check Rate Limit │
@@ -55,7 +55,7 @@ Incoming request with Secure-Token
55
55
 
56
56
  ### Validation Flow
57
57
 
58
- 1. **Decryption**: Base64 decode → RSA decrypt with private key
58
+ 1. **Decryption**: Base64 decode → X25519 + AES-256-GCM with the service private key
59
59
  2. **Parsing**: Extract `{client_name}_{timestamp_ms}` from token
60
60
  3. **Whitelist**: Verify client_name is in `allowed_services`
61
61
  4. **Rate limit**: Sliding window — check request count within `rate_limit_window_seconds`
@@ -82,8 +82,10 @@ Checks are enabled via `using_modules`:
82
82
  RobustServerSocket implements a multi-layered protection system for inter-service communications:
83
83
 
84
84
  ### 1. Cryptographic Protection
85
- - **RSA-2048 Encryption**: Uses RSA key pairs with minimum 2048-bit length
86
- - **Key Validation**: Automatic key size verification during configuration
85
+ - **Scheme**: `c.cipher`, default `:x25519`, `:x448` is built in. Client and server must pick the same one
86
+ - **X25519 / X448 + AES-256-GCM**: the token is sealed with an ephemeral key to the service's static key pair
87
+ - **Your own scheme**: a `Base` subclass calls `register_cipher :name`. X25519 and X448 inherit `Ecdh`
88
+ - **Key validation**: only a private key of the selected scheme is accepted; RSA is rejected
87
89
 
88
90
  ### 2. Access Control
89
91
  - **Client Whitelist**: Only authorized services can connect, when `:client_auth_protection` module is enabled
@@ -106,7 +108,7 @@ RobustServerSocket implements a multi-layered protection system for inter-servic
106
108
 
107
109
  ### 6. Injection Protection
108
110
  - **Input Validation**: Type, length, and format verification of tokens
109
- - **Maximum Token Length**: 2048 character limit
111
+ - **Maximum Token Length**: 512 character limit
110
112
  - **Empty Value Checks**: Rejection of empty or malformed tokens
111
113
 
112
114
  ## 📦 Installation
@@ -132,8 +134,9 @@ RobustServerSocket.configure do |c|
132
134
  rate_limit_protection
133
135
  ]
134
136
 
135
- # Service private key (RSA-2048 or higher)
137
+ # Service private key (X25519 PEM, or X448 when cipher is :x448)
136
138
  c.private_key = ENV['ROBUST_SERVER_PRIVATE_KEY']
139
+ c.cipher = :x25519
137
140
 
138
141
  # Token lifetime in seconds (must match TTL on client side)
139
142
  c.token_expiration_time = 10
@@ -158,7 +161,8 @@ RobustServerSocket.load!
158
161
 
159
162
  | Parameter | Type | Required | Default | Description |
160
163
  |-----------------------------|---------|----------|-------------------------------------------------------------------------------------|-------------------------------------------------|
161
- | `private_key` | String | ✅ | — | Service private RSA key (RSA-2048 or higher) |
164
+ | `private_key` | String | ✅ | — | Private key of the selected scheme (PEM) |
165
+ | `cipher` | Symbol | ❌ | `:x25519` | Token scheme: `:x25519`, `:x448`, or your own |
162
166
  | `token_expiration_time` | Integer | ✅ | 10 | Token lifetime in seconds |
163
167
  | `allowed_services` | Array | ✅ | — | Allowed services whitelist |
164
168
  | `redis_url` | String | ✅ | — | Redis connection URL |
@@ -171,7 +175,7 @@ RobustServerSocket.load!
171
175
 
172
176
  ### Compatibility with RobustClientSocket
173
177
 
174
- The token contains a timestamp in **milliseconds**. RobustClientSocket starting from version X.X must generate:
178
+ The token contains a timestamp in **milliseconds**. RobustClientSocket starting from version 0.5.3 must generate:
175
179
 
176
180
  ```ruby
177
181
  Process.clock_gettime(Process::CLOCK_REALTIME, :millisecond)
@@ -291,7 +295,7 @@ end
291
295
 
292
296
  **Without RobustServerSocket (plain HTTP controller):**
293
297
  - Real time: ~2.5 seconds
294
- - No token verification, no RSA decryption, no Redis checks
298
+ - No token verification, no AES-GCM open, no Redis checks
295
299
 
296
300
  **With RobustServerSocket (full protection):**
297
301
  - Real time: ~2.77 seconds
@@ -301,7 +305,7 @@ end
301
305
 
302
306
  | Operation | Time | % of Request |
303
307
  |------------------------|-------------|-------------|
304
- | RSA Decryption | ~0.1–0.2ms | 3–7% |
308
+ | AES-256-GCM open | ~0.05ms | 1–3% |
305
309
  | Redis Token Check | ~0.05–0.1ms | 2–3% |
306
310
  | Rate Limiting | ~0.02–0.05ms| 1% |
307
311
  | Whitelist Validation | <0.01ms | <1% |
@@ -316,7 +320,7 @@ Up to 1000 req/s — excellent performance. Higher loads require Redis Sentinel/
316
320
  ## 📚 Additional Resources
317
321
 
318
322
  - [RobustClientSocket](https://github.com/tee0zed/robust_client_socket)
319
- - [RSA encryption best practices](https://www.openssl.org/docs/)
323
+ - [X25519](https://www.rfc-editor.org/rfc/rfc7748) and [AES-GCM](https://www.rfc-editor.org/rfc/rfc5116)
320
324
  - [Redis security guide](https://redis.io/topics/security)
321
325
 
322
326
  ## 📝 License
data/README.md CHANGED
@@ -23,7 +23,7 @@ Gem для межсервисной аутентификации, использ
23
23
 
24
24
  RobustServerSocket предоставляет:
25
25
 
26
- - **RSA-дешифрование**: Проверка подлинности токенов
26
+ - **Расшифровка токена**: X25519 + AES-256-GCM, проверка подлинности
27
27
  - **Whitelist клиентов**: Только разрешённые сервисы
28
28
  - **Защиту от replay**: Блэклист использованных токенов в Redis
29
29
  - **Rate limiting**: Скользящее окно запросов на клиента
@@ -39,7 +39,7 @@ RobustServerSocket предоставляет:
39
39
  ┌──────────────────────────────┐
40
40
  │ RobustServerSocket │
41
41
  │ │
42
- │ 1. RSA Decrypt │
42
+ │ 1. Open token (AES-GCM) │
43
43
  │ 2. Validate Format │
44
44
  │ 3. Check Client Whitelist │
45
45
  │ 4. Check Rate Limit │
@@ -55,7 +55,7 @@ RobustServerSocket предоставляет:
55
55
 
56
56
  ### Поток валидации
57
57
 
58
- 1. **Расшифровка**: Base64 decode → RSA decrypt с приватным ключом
58
+ 1. **Расшифровка**: Base64 decode → X25519 + AES-256-GCM с приватным ключом сервиса
59
59
  2. **Парсинг**: Извлечение `{client_name}_{timestamp_ms}` из токена
60
60
  3. **Whitelist**: Проверка client_name в `allowed_services`
61
61
  4. **Rate limit**: Скользящее окно — проверка количества запросов за `rate_limit_window_seconds`
@@ -82,8 +82,10 @@ RobustServerSocket предоставляет:
82
82
  RobustServerSocket реализует многоуровневую систему защиты для межсервисных коммуникаций:
83
83
 
84
84
  ### 1. Криптографическая защита
85
- - **RSA-2048 шифрование**: Используется пара ключей RSA с минимальной длиной 2048 бит
86
- - **Валидация ключей**: Автоматическая проверка размера ключа при конфигурации
85
+ - **Схема**: `c.cipher`, по умолчанию `:x25519`, встроен ещё `:x448`. Клиент и сервер должны выбрать одну
86
+ - **X25519 / X448 + AES-256-GCM**: токен запечатан эфемерным ключом на статическую пару сервиса
87
+ - **Своя схема**: наследник `Base` вызывает `register_cipher :name`. X25519 и X448 наследуют `Ecdh`
88
+ - **Валидация ключей**: принимается только приватный ключ выбранной схемы, RSA отвергается
87
89
 
88
90
  ### 2. Контроль доступа
89
91
  - **Whitelist клиентов**: Только авторизованные сервисы могут подключаться, при включенном модуле `:client_auth_protection`
@@ -127,8 +129,9 @@ RobustServerSocket.configure do |c|
127
129
  rate_limit_protection
128
130
  ]
129
131
 
130
- # Приватный ключ сервиса (RSA-2048 или выше)
132
+ # Приватный ключ сервиса (X25519, PEM). Для :x448 — ключ X448.
131
133
  c.private_key = ENV['ROBUST_SERVER_PRIVATE_KEY']
134
+ c.cipher = :x25519
132
135
 
133
136
  # Время жизни токена в секундах (должно совпадать с TTL на клиенте)
134
137
  c.token_expiration_time = 10
@@ -153,7 +156,8 @@ RobustServerSocket.load!
153
156
 
154
157
  | Параметр | Тип | Обязательный | Default | Описание |
155
158
  |-----------------------------|---------|-------------|-------------------------------------------------------------------------------------|-------------------------------------------------|
156
- | `private_key` | String | ✅ | — | Приватный RSA ключ сервиса (RSA-2048 или выше) |
159
+ | `private_key` | String | ✅ | — | Приватный ключ выбранной схемы (PEM) |
160
+ | `cipher` | Symbol | ❌ | `:x25519` | Схема токена: `:x25519`, `:x448` или своя |
157
161
  | `token_expiration_time` | Integer | ✅ | 10 | Время жизни токена в секундах |
158
162
  | `allowed_services` | Array | ✅ | — | Список разрешённых сервисов (whitelist) |
159
163
  | `redis_url` | String | ✅ | — | URL для подключения к Redis |
@@ -166,7 +170,7 @@ RobustServerSocket.load!
166
170
 
167
171
  ### Совместимость с RobustClientSocket
168
172
 
169
- Токен содержит таймстамп в **миллисекундах**. RobustClientSocket начиная с версии X.X должен генерировать:
173
+ Токен содержит таймстамп в **миллисекундах**. RobustClientSocket начиная с версии 0.5.3 должен генерировать:
170
174
 
171
175
  ```ruby
172
176
  Process.clock_gettime(Process::CLOCK_REALTIME, :millisecond)
@@ -287,7 +291,7 @@ end
287
291
  ## 📚 Дополнительные ресурсы
288
292
 
289
293
  - [RobustClientSocket](https://github.com/tee0zed/robust_client_socket)
290
- - [RSA encryption best practices](https://www.openssl.org/docs/)
294
+ - [X25519](https://www.rfc-editor.org/rfc/rfc7748) и [AES-GCM](https://www.rfc-editor.org/rfc/rfc5116)
291
295
  - [Redis security guide](https://redis.io/topics/security)
292
296
 
293
297
  ## 📝 Лицензия
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RobustServerSocket
4
+ module Ciphers
5
+ class Base
6
+ UnknownCipher = Class.new(SecurityError)
7
+ CIPHERS = []
8
+
9
+ class << self
10
+ def ciphers
11
+ CIPHERS
12
+ end
13
+
14
+ def register_cipher(name)
15
+ raise ArgumentError, 'cipher name must be a Symbol' unless name.is_a?(Symbol)
16
+
17
+ CIPHERS.delete(self)
18
+ @cipher_name = name
19
+ CIPHERS << self
20
+ name
21
+ end
22
+
23
+ def cipher_name
24
+ @cipher_name
25
+ end
26
+
27
+ def fetch(name)
28
+ found = ciphers.find { |cipher| cipher.cipher_name == name.to_sym }
29
+ return found if found
30
+
31
+ raise UnknownCipher, "Unknown cipher: #{name}"
32
+ end
33
+
34
+ def seal(_plaintext, _public_key_pem)
35
+ raise NotImplementedError
36
+ end
37
+
38
+ def open(_token, _private_key_pem)
39
+ raise NotImplementedError
40
+ end
41
+
42
+ def read_private_key(_pem)
43
+ raise NotImplementedError
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,110 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'openssl'
4
+ require 'base64'
5
+ require_relative 'base'
6
+
7
+ module RobustServerSocket
8
+ module Ciphers
9
+ class Ecdh < Base
10
+ MAX_BLOB_BYTES = 1024
11
+ IV_LENGTH = 12
12
+ TAG_LENGTH = 16
13
+ KEY_LENGTH = 32
14
+
15
+ class << self
16
+ def seal(plaintext, public_key_pem)
17
+ recipient = OpenSSL::PKey.read(public_key_pem)
18
+ raise SecurityError, 'Invalid public key' unless recipient.oid == self::ALGORITHM
19
+
20
+ ephemeral = OpenSSL::PKey.generate_key(self::ALGORITHM)
21
+ blob = ephemeral.public_to_der.b + gcm_seal(derive_key(ephemeral.derive(recipient)), plaintext)
22
+
23
+ ::Base64.strict_encode64(blob)
24
+ end
25
+
26
+ def open(token, private_key_pem)
27
+ ephemeral_der, iv, tag, ciphertext = split(token)
28
+ key = derive_key(read_private_key(private_key_pem).derive(read_ephemeral(ephemeral_der)))
29
+
30
+ gcm_open(key, iv, tag, ciphertext)
31
+ rescue OpenSSL::PKey::PKeyError, OpenSSL::Cipher::CipherError, ArgumentError
32
+ raise SecureToken::InvalidToken, 'Invalid token'
33
+ end
34
+
35
+ def read_private_key(pem)
36
+ key = OpenSSL::PKey.read(pem)
37
+ raise SecurityError, 'Invalid private key' unless private_key?(key)
38
+
39
+ key
40
+ rescue OpenSSL::PKey::PKeyError => e
41
+ raise SecurityError, "Invalid private key: #{e.message}"
42
+ end
43
+
44
+ private
45
+
46
+ def split(token)
47
+ raise SecureToken::InvalidToken, 'Invalid token format' unless token.is_a?(String) && token.match?(SecureToken::BASE64_REGEXP)
48
+
49
+ decoded = ::Base64.strict_decode64(token)
50
+ raise SecureToken::InvalidToken, 'Token too large' if decoded.bytesize > MAX_BLOB_BYTES
51
+ raise SecureToken::InvalidToken, 'Invalid token' if decoded.bytesize <= header_length
52
+
53
+ [
54
+ decoded.byteslice(0, self::EPHEMERAL_DER_LENGTH),
55
+ decoded.byteslice(self::EPHEMERAL_DER_LENGTH, IV_LENGTH),
56
+ decoded.byteslice(self::EPHEMERAL_DER_LENGTH + IV_LENGTH, TAG_LENGTH),
57
+ decoded.byteslice(header_length..-1)
58
+ ]
59
+ end
60
+
61
+ def header_length
62
+ self::EPHEMERAL_DER_LENGTH + IV_LENGTH + TAG_LENGTH
63
+ end
64
+
65
+ def private_key?(key)
66
+ key.oid == self::ALGORITHM && holds_private_key?(key)
67
+ end
68
+
69
+ def holds_private_key?(key)
70
+ !key.raw_private_key.nil?
71
+ rescue OpenSSL::PKey::PKeyError
72
+ false
73
+ end
74
+
75
+ def read_ephemeral(der)
76
+ key = OpenSSL::PKey.read(der)
77
+ raise OpenSSL::PKey::PKeyError, 'invalid ephemeral key' unless key.oid == self::ALGORITHM && !holds_private_key?(key)
78
+
79
+ key
80
+ end
81
+
82
+ def derive_key(shared_secret)
83
+ OpenSSL::KDF.hkdf(shared_secret, salt: '', info: self::INFO, length: KEY_LENGTH, hash: 'SHA256')
84
+ end
85
+
86
+ def gcm_seal(key, plaintext)
87
+ cipher = OpenSSL::Cipher.new('aes-256-gcm')
88
+ cipher.encrypt
89
+ cipher.key = key
90
+ iv = cipher.random_iv
91
+ cipher.auth_data = self::INFO
92
+ ciphertext = cipher.update(plaintext) + cipher.final
93
+
94
+ iv + cipher.auth_tag + ciphertext
95
+ end
96
+
97
+ def gcm_open(key, iv, tag, ciphertext)
98
+ cipher = OpenSSL::Cipher.new('aes-256-gcm')
99
+ cipher.decrypt
100
+ cipher.key = key
101
+ cipher.iv = iv
102
+ cipher.auth_tag = tag
103
+ cipher.auth_data = self::INFO
104
+
105
+ (cipher.update(ciphertext) + cipher.final).force_encoding('UTF-8')
106
+ end
107
+ end
108
+ end
109
+ end
110
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'ecdh'
4
+
5
+ module RobustServerSocket
6
+ module Ciphers
7
+ class X25519 < Ecdh
8
+ ALGORITHM = 'X25519'
9
+ EPHEMERAL_DER_LENGTH = 44
10
+ INFO = 'robust-socket-token-v1-x25519'
11
+ end
12
+
13
+ X25519.register_cipher :x25519
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'ecdh'
4
+
5
+ module RobustServerSocket
6
+ module Ciphers
7
+ class X448 < Ecdh
8
+ ALGORITHM = 'X448'
9
+ EPHEMERAL_DER_LENGTH = 68
10
+ INFO = 'robust-socket-token-v1-x448'
11
+ end
12
+
13
+ X448.register_cipher :x448
14
+ end
15
+ end
@@ -84,7 +84,7 @@ module RobustServerSocket
84
84
  # Validate token input to prevent injection
85
85
  raise InvalidToken, 'Token must be a string' unless token.is_a?(String)
86
86
  raise InvalidToken, 'Token cannot be empty' if token.empty?
87
- raise InvalidToken, 'Token too long' if token.length > 2048
87
+ raise InvalidToken, 'Token too long' if token.length > 512
88
88
 
89
89
  # Check for null-byte injection
90
90
  raise InvalidToken, 'Token contains invalid characters' if token.include?("\x00")
@@ -2,8 +2,6 @@
2
2
 
3
3
  module RobustServerSocket
4
4
  module Configuration
5
- MIN_KEY_SIZE = 2048
6
-
7
5
  ConfigurationError = Class.new(StandardError)
8
6
 
9
7
  attr_reader :configuration, :configured
@@ -55,21 +53,13 @@ module RobustServerSocket
55
53
  end
56
54
 
57
55
  def validate_key_security!
58
- key = ::OpenSSL::PKey::RSA.new(configuration.private_key)
59
- key_bits = key.n.num_bits
60
-
61
- if key_bits < MIN_KEY_SIZE
62
- raise SecurityError,
63
- "RSA key size (#{key_bits} bits) below minimum (#{MIN_KEY_SIZE} bits)"
64
- end
65
- rescue ::OpenSSL::PKey::RSAError => e
66
- raise SecurityError, "Invalid private key: #{e.message}"
56
+ Ciphers::Base.fetch(configuration.cipher).read_private_key(configuration.private_key)
67
57
  end
68
58
  end
69
59
 
70
60
  class ConfigStore
71
61
  attr_accessor :allowed_services, :private_key, :token_expiration_time,
72
- :redis_url, :redis_pass,
62
+ :redis_url, :redis_pass, :cipher,
73
63
  :rate_limit_max_requests, :rate_limit_window_seconds, :using_modules
74
64
 
75
65
  attr_reader :_modules_check_rows, :_bang_modules_check_rows
@@ -78,6 +68,7 @@ module RobustServerSocket
78
68
  @rate_limit_max_requests = 100
79
69
  @rate_limit_window_seconds = 60
80
70
  @token_expiration_time = 10
71
+ @cipher = :x25519
81
72
  @using_modules = %i[client_auth_protection rate_limit_protection replay_attack_protection]
82
73
  @_modules_check_rows = []
83
74
  @_bang_modules_check_rows = []
@@ -2,34 +2,21 @@
2
2
 
3
3
  module RobustServerSocket
4
4
  module SecureToken
5
- BASE64_REGEXP = %r{\A[A-Za-z0-9+/]+={0,2}\z}.freeze
6
- InvalidToken = Class.new(StandardError)
7
-
8
5
  module Decrypt
9
6
  class << self
10
7
  def call(token)
11
- raise InvalidToken, 'Invalid token format' unless token.is_a?(String) && token.match?(BASE64_REGEXP)
12
-
13
- decoded_token = ::Base64.strict_decode64(token)
14
-
15
- raise InvalidToken, 'Token too large' if decoded_token.bytesize > 1024
16
-
17
- private_key.private_decrypt(decoded_token, OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING).force_encoding('UTF-8')
18
- rescue ::OpenSSL::PKey::RSAError, ArgumentError
19
- raise InvalidToken, 'Invalid token'
8
+ Ciphers::Base.fetch(RobustServerSocket.configuration.cipher).open(token, private_key_pem)
20
9
  end
21
10
 
22
11
  # Clear cached private key (useful for hot reloading in development)
23
12
  def clear_private_key_cache!
24
- @private_key = nil
13
+ @private_key_pem = nil
25
14
  end
26
15
 
27
16
  private
28
17
 
29
- # Cache RSA private key at module level for the lifetime of the Rails process
30
- # This avoids recreating the RSA object on every token decryption
31
- def private_key
32
- @private_key ||= ::OpenSSL::PKey::RSA.new(RobustServerSocket.configuration.private_key)
18
+ def private_key_pem
19
+ @private_key_pem ||= RobustServerSocket.configuration.private_key
33
20
  end
34
21
  end
35
22
  end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RobustServerSocket
4
+ module SecureToken
5
+ BASE64_REGEXP = %r{\A[A-Za-z0-9+/]+={0,2}\z}.freeze
6
+ InvalidToken = Class.new(StandardError)
7
+ end
8
+ end
@@ -6,6 +6,9 @@ require 'redis'
6
6
  require 'connection_pool'
7
7
 
8
8
  require_relative 'robust_server_socket/configuration'
9
+ require_relative 'robust_server_socket/secure_token'
10
+ require_relative 'robust_server_socket/ciphers/x25519'
11
+ require_relative 'robust_server_socket/ciphers/x448'
9
12
  require_relative 'robust_server_socket/secure_token/decrypt'
10
13
  require_relative 'robust_server_socket/client_token'
11
14
 
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RobustServerSocket
4
- VERSION = '0.4.3'
4
+ VERSION = '0.6.1'
5
5
  end
@@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.bindir = 'exe'
24
24
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
25
25
  spec.require_paths = ['lib']
26
+ spec.add_dependency 'base64'
26
27
  spec.add_dependency 'hiredis'
27
28
  spec.add_dependency 'rake'
28
29
  spec.add_dependency 'redis'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: robust_server_socket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - tee_zed
@@ -9,6 +9,20 @@ bindir: exe
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: base64
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
12
26
  - !ruby/object:Gem::Dependency
13
27
  name: hiredis
14
28
  requirement: !ruby/object:Gem::Requirement
@@ -82,12 +96,17 @@ files:
82
96
  - Rakefile
83
97
  - lib/robust_server_socket.rb
84
98
  - lib/robust_server_socket/cacher.rb
99
+ - lib/robust_server_socket/ciphers/base.rb
100
+ - lib/robust_server_socket/ciphers/ecdh.rb
101
+ - lib/robust_server_socket/ciphers/x25519.rb
102
+ - lib/robust_server_socket/ciphers/x448.rb
85
103
  - lib/robust_server_socket/client_token.rb
86
104
  - lib/robust_server_socket/configuration.rb
87
105
  - lib/robust_server_socket/modules/client_auth_protection.rb
88
106
  - lib/robust_server_socket/modules/rate_limit_protection.rb
89
107
  - lib/robust_server_socket/modules/replay_attack_protection.rb
90
108
  - lib/robust_server_socket/rate_limiter.rb
109
+ - lib/robust_server_socket/secure_token.rb
91
110
  - lib/robust_server_socket/secure_token/decrypt.rb
92
111
  - lib/version.rb
93
112
  - robust_server_socket.gemspec