robust_server_socket 0.3.1 → 0.3.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: 37064c5a03f119d17df76cb2eba1bd14b91d0cb4732f0d4aa29505614131966f
4
- data.tar.gz: b18b44079588faf7a38979174971f928f50eb5c1535f0fc6ade2980ace6ed771
3
+ metadata.gz: 5ab7c243900b7f5a64995876c99501a830670a1dfddc217c5f49ec2699fac503
4
+ data.tar.gz: 5c7552b5d17afae304cf186b5025b874a6a04b7afe80cd4c47092478a809689a
5
5
  SHA512:
6
- metadata.gz: 91e42034b36683bfb0d7c481e9f9ef0e3acfae64d43214c0631bf797dbcbd94756e57288cf9a23f2cff2fccea307f019f0ffa93bfea5f86df2f4e751b171fd87
7
- data.tar.gz: cd15f31a2c698f54684912f1ba3a1b87e8cca074ae0e0967b3374e861484d8bd45a546df35f42781beb651f4505d439ffbff643c3bb6db662fbe4666a87a7a83
6
+ metadata.gz: 9faa202465b8c25c0ec07fee1a4ea9f18531488a1f6f6eb4717bb29e5424ddb8266912e1eaf7dda84c366ed276beede43b740eadb5fdde9a146f14b3b99b601b
7
+ data.tar.gz: 410d43f438f999b0474d939319c65647ecc617c7a3313be38d0b7eb567cc20bc64d3f766bdca60089131c55fbd868849f3ba1f1cddf04bb4623f51e50c813f1c
@@ -17,6 +17,5 @@ module RobustServerSocket
17
17
 
18
18
  require_relative 'robust_server_socket/rate_limiter'
19
19
  require_relative 'robust_server_socket/client_token'
20
- require_relative 'robust_server_socket/private_message'
21
20
  end
22
21
  end
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RobustServerSocket
4
- VERSION = '0.3.1'
4
+ VERSION = '0.3.2'
5
5
  end
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.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - tee_zed
@@ -75,7 +75,6 @@ files:
75
75
  - ".rspec"
76
76
  - CODE_OF_CONDUCT.md
77
77
  - LICENSE.txt
78
- - README.md
79
78
  - Rakefile
80
79
  - lib/robust_server_socket.rb
81
80
  - lib/robust_server_socket/client_token.rb
data/README.md DELETED
@@ -1,59 +0,0 @@
1
- # RobustServerSocket
2
-
3
- Gem for in-service Authorization for using with RobustClientSocket
4
-
5
- ## Security
6
-
7
- - RSA-2048 key pair is used for authorization.
8
- - Authorized client names are stored in token and config
9
- - Token is staleable
10
- - Token if one-time use only
11
- - Blacklist for tokens in redis
12
-
13
- ## Usage
14
-
15
- 'config/initializers/robust_server_socket.rb'
16
-
17
- ```ruby
18
- RobustServerSocket.configure do |c|
19
- c.private_key = '-----PRIVATE KEY-----[...]' # private key of the service, from pair of keys by RobustServerSocket
20
- c.token_expiration_time = 10.minutes # time in seconds for token expiration
21
- c.allowed_services = %w(core) # list of services allowed to use this service, must be same as service name in keychain in RobustClientSocket
22
- # so if we have
23
- # RobustClientSocket.configure do |c|
24
- # c.keychain = {
25
- # core: { <<< service name
26
- # base_uri: 'https://core.payrent.com',
27
- # public_key: '-----BEGIN PUBLIC KEY-----[...]'
28
- # },
29
- # we should add 'core' to allowed_services
30
- c.redis_url = 'redis://localhost:6379' # redis url for storing tokens
31
- c.redis_pass = 'password' # redis password
32
-
33
- # Optional: Rate Limiting (disabled by default)
34
- c.rate_limit_enabled = true # enable rate limiting per client
35
- c.rate_limit_max_requests = 100 # maximum requests per window (default: 100)
36
- c.rate_limit_window_seconds = 60 # time window in seconds (default: 60)
37
- end
38
-
39
- RobustServerSocket.load!
40
- ```
41
-
42
- and then
43
-
44
- ```ruby
45
- token = RobustServerSocket::ClientToken.new(token) # token - is a Bearer from secure-token header
46
- token.valid? #Boolean check if token is not expired and client is allowed to use this service, main authorization check
47
- token.client #String name of the client
48
-
49
- RobustServerSocket::ClientToken.validate!(token) # shortcut for token.valid? and raises specific errors
50
- ```
51
- ## Errors
52
-
53
- `RobustServerSocket::ClientToken::UnauthorizedClient` - client is not allowed to use this service you should add it to allowed_services
54
- `RobustServerSocket::ClientToken::UsedToken` - token is already used
55
- `RobustServerSocket::ClientToken::StaleToken` - token is stale over the expiration time
56
- `RobustServerSocket::ClientToken::InvalidToken` - token decryption failed
57
- `RobustServerSocket::ClientToken::RateLimitExceeded` - client exceeded rate limit (only when rate limiting is enabled)
58
-
59
-