blest 1.0.1 → 1.0.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 +4 -4
- data/README.md +5 -10
- data/lib/blest.rb +3 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb15eb80f38f62587b534d5ce5e5a81a0a8995050033745b2f100fede9557794
|
4
|
+
data.tar.gz: b7e758f3d3396af0f14952b3512c5e2550f7a35089add6aaf479994bb4ed778a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c18640e749fb37f65d380ac18966002662b652081bafb908e9e7a1771dbae30348272888ae60bdf4f254fefeec6f4c2c822b2fc47341a4469312413c03f45d9
|
7
|
+
data.tar.gz: 731fedd0800a8e82a9ab3d7bd07e1bd6b29b88145ce8d43054f7d52b2519a6e46f8472273c8bfa85b5aaf7451d6821b19c698a3f97319b823b7c78947a47bbfd
|
data/README.md
CHANGED
@@ -26,7 +26,7 @@ gem install blest
|
|
26
26
|
|
27
27
|
### Router
|
28
28
|
|
29
|
-
The following example uses Sinatra.
|
29
|
+
The following example uses Sinatra, but you can find examples with other frameworks [here](examples).
|
30
30
|
|
31
31
|
```ruby
|
32
32
|
require 'sinatra'
|
@@ -38,14 +38,9 @@ router = Router.new(timeout: 1000)
|
|
38
38
|
|
39
39
|
# Create some middleware (optional)
|
40
40
|
router.before do |body, context|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
}
|
45
|
-
nil
|
46
|
-
else
|
47
|
-
raise RuntimeError, "Unauthorized"
|
48
|
-
end
|
41
|
+
context['user'] = {
|
42
|
+
# user info for example
|
43
|
+
}
|
49
44
|
end
|
50
45
|
|
51
46
|
# Create a route controller
|
@@ -81,7 +76,7 @@ client = HttpClient.new('http://localhost:8080', max_batch_size = 25, buffer_del
|
|
81
76
|
|
82
77
|
# Send a request
|
83
78
|
begin
|
84
|
-
result = client.request('greet', { 'name': 'Steve' }
|
79
|
+
result = client.request('greet', { 'name': 'Steve' }).value
|
85
80
|
# Do something with the result
|
86
81
|
rescue => error
|
87
82
|
# Do something in case of error
|
data/lib/blest.rb
CHANGED
@@ -542,8 +542,9 @@ def route_reducer(handler, request, context, timeout = nil)
|
|
542
542
|
end
|
543
543
|
|
544
544
|
# if request[:selector]
|
545
|
-
|
546
|
-
|
545
|
+
if request&.headers&._s
|
546
|
+
result = filter_object(result, request.headers._s)
|
547
|
+
end
|
547
548
|
|
548
549
|
[request[:id], request[:route], result, nil]
|
549
550
|
rescue => error
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JHunt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: The Ruby reference implementation of BLEST (Batch-able, Lightweight,
|
14
14
|
Encrypted State Transfer), an improved communication protocol for web APIs which
|
@@ -36,7 +36,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '0'
|
39
|
+
version: '3.0'
|
40
40
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
41
41
|
requirements:
|
42
42
|
- - ">="
|