crudjt 1.0.0.pre.beta.0 → 1.0.0.pre.beta.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 +4 -4
- data/.github/workflows/build.yml +1 -1
- data/Gemfile.lock +1 -1
- data/README.md +58 -13
- data/lib/crudjt/version.rb +1 -1
- data/lib/crudjt.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 53225a9b4b8f73fdd347e17b8ee1c63a146629fc3168d4da0ff1f1025ae31e48
|
|
4
|
+
data.tar.gz: 12c993a56ccd2de647a5a2ea5de40e44da1788261ca387b44426dc0dec5001c7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8c9af5f6503ae801cceb6f957d56ca0be7a73d894e8c9c70f07c71ffb9523df4194778cecaa78e99b68277d0118d01d47374e22a76c4db4c5b8997881bb255c0
|
|
7
|
+
data.tar.gz: 8e277f2b24da368ab4867c07642b45b578d5ce9e402b8c77c63ff5373ef6cbdf02189aea2fef91dce73b58e9e7fc40a2769532de66f7bf06d13ef89a947d9272
|
data/.github/workflows/build.yml
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<picture>
|
|
3
|
-
<source media="(prefers-color-scheme: dark)" srcset="logos/crudjt_logo_white_on_dark.svg">
|
|
4
|
-
<source media="(prefers-color-scheme: light)" srcset="logos/crudjt_logo_dark_on_white.svg">
|
|
5
|
-
<img alt="Shows a dark logo" src="logos/crudjt_logo_dark.png">
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/crudjt/crudjt/refs/heads/master/logos/crudjt_logo_white_on_dark.svg">
|
|
4
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/crudjt/crudjt/refs/heads/master/logos/crudjt_logo_dark_on_white.svg">
|
|
5
|
+
<img alt="Shows a dark logo" src="https://raw.githubusercontent.com/crudjt/crudjt/refs/heads/master/logos/crudjt_logo_dark.png">
|
|
6
6
|
</picture>
|
|
7
7
|
</br>
|
|
8
8
|
Ruby SDK for the fast, file-backed, scalable JSON token engine
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
12
|
<a href="https://www.patreon.com/crudjt">
|
|
13
|
-
<img src="logos/buy_me_a_coffee_orange.svg" alt="Buy Me a Coffee"/>
|
|
13
|
+
<img src="https://raw.githubusercontent.com/crudjt/crudjt/refs/heads/master/logos/buy_me_a_coffee_orange.svg" alt="Buy Me a Coffee"/>
|
|
14
14
|
</a>
|
|
15
15
|
</p>
|
|
16
16
|
|
|
@@ -25,11 +25,11 @@ Optimized for vertical scaling on a single server
|
|
|
25
25
|
|
|
26
26
|
With Bundler:
|
|
27
27
|
```sh
|
|
28
|
-
bundle add crudjt
|
|
28
|
+
bundle add crudjt --pre
|
|
29
29
|
```
|
|
30
30
|
Or via RubyGems:
|
|
31
31
|
```sh
|
|
32
|
-
gem install crudjt
|
|
32
|
+
gem install crudjt --pre
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
## How to use
|
|
@@ -46,6 +46,8 @@ Only **one process** can do this for a **single token storage**
|
|
|
46
46
|
The master process manages sessions and coordination
|
|
47
47
|
All functions can also be used directly from it
|
|
48
48
|
|
|
49
|
+
For containerized deployments, see: [Start CRUDJT master in Docker](#start-crudjt-master-in-docker)
|
|
50
|
+
|
|
49
51
|
### Generate a new secret key (terminal)
|
|
50
52
|
|
|
51
53
|
```sh
|
|
@@ -66,8 +68,34 @@ CRUDJT::Config.start_master(
|
|
|
66
68
|
|
|
67
69
|
*Important: Use the same `secret_key` across all sessions. If the key changes, previously stored tokens cannot be decrypted and will return `nil` or `false`*
|
|
68
70
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
+
### Start CRUDJT master in Docker
|
|
72
|
+
Create a `docker-compose.yml` file:
|
|
73
|
+
|
|
74
|
+
```yml
|
|
75
|
+
services:
|
|
76
|
+
crudjt-server:
|
|
77
|
+
image: crudjt/crudjt-server:beta
|
|
78
|
+
restart: unless-stopped
|
|
79
|
+
|
|
80
|
+
ports:
|
|
81
|
+
- "${CRUDJT_CLIENT_PORT:-50051}:50051"
|
|
82
|
+
|
|
83
|
+
volumes:
|
|
84
|
+
- "${STORE_JT:-./store_jt}:/app/store_jt"
|
|
85
|
+
- "${CRUDJT_SECRETS:-./crudjt_secrets}:/app/secrets"
|
|
86
|
+
|
|
87
|
+
environment:
|
|
88
|
+
CRUDJT_DOCKER_HOST: 0.0.0.0
|
|
89
|
+
CRUDJT_DOCKER_PORT: 50051
|
|
90
|
+
```
|
|
91
|
+
Start the server:
|
|
92
|
+
```bash
|
|
93
|
+
docker-compose up -d
|
|
94
|
+
```
|
|
95
|
+
*Ensure the secrets directory contains your secret key file at `./crudjt_secrets/secret_key.txt`*
|
|
96
|
+
|
|
97
|
+
For configuration details and image versions, see the
|
|
98
|
+
[CRUDJT Server on Docker Hub](https://hub.docker.com/r/crudjt/crudjt-server)
|
|
71
99
|
|
|
72
100
|
## Connect to an existing CRUDJT master
|
|
73
101
|
|
|
@@ -158,12 +186,29 @@ result = CRUDJT.delete('HBmKFXoXgJ46mCqer1WXyQ')
|
|
|
158
186
|
```
|
|
159
187
|
|
|
160
188
|
# Performance
|
|
161
|
-
|
|
189
|
+
**40 000** requests up to **256 bytes** — median over 10 runs
|
|
190
|
+
macOS 15.7.4, ARM64 (Apple M1)
|
|
191
|
+
Ruby 3.4.4
|
|
192
|
+
In-process benchmark; Redis accessed via localhost TCP
|
|
193
|
+
|
|
194
|
+
| Function | CRUDJT (Ruby) | JWT (Ruby) | redis-session-store (Ruby, Rails 8.0.2.1) |
|
|
195
|
+
|----------|-------|------|------|
|
|
196
|
+
| C | `0.279 second` <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/crudjt/crudjt/refs/heads/master/logos/crudjt_favicon_160x160_white_on_dark.svg" width=16 height=16> <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/crudjt/crudjt/refs/heads/master/logos/crudjt_favicon_160x160_dark_on_white.svg" width=16 height=16> <img alt="Shows a favicon black on white color" src="https://raw.githubusercontent.com/crudjt/crudjt/refs/heads/master/logos/crudjt_favicon_white_on_dark.png" width=16 height=16> </picture> | 0.644 second | 2.909 seconds |
|
|
197
|
+
| R | `0.134 second` <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/crudjt/crudjt/refs/heads/master/logos/crudjt_favicon_160x160_white_on_dark.svg" width=16 height=16> <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/crudjt/crudjt/refs/heads/master/logos/crudjt_favicon_160x160_dark_on_white.svg" width=16 height=16> <img alt="Shows a favicon black on white color" src="https://raw.githubusercontent.com/crudjt/crudjt/refs/heads/master/logos/crudjt_favicon_white_on_dark.png" width=16 height=16> </picture> | 0.972 second | 4.436 seconds |
|
|
198
|
+
| U | `0.410 second` <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/crudjt/crudjt/refs/heads/master/logos/crudjt_favicon_160x160_white_on_dark.svg" width=16 height=16> <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/crudjt/crudjt/refs/heads/master/logos/crudjt_favicon_160x160_dark_on_white.svg" width=16 height=16> <img alt="Shows a favicon black on white color" src="https://raw.githubusercontent.com/crudjt/crudjt/refs/heads/master/logos/crudjt_favicon_white_on_dark.png" width=16 height=16> </picture> | X | 2.124 seconds |
|
|
199
|
+
| D | `0.172 second` <picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/crudjt/crudjt/refs/heads/master/logos/crudjt_favicon_160x160_white_on_dark.svg" width=16 height=16> <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/crudjt/crudjt/refs/heads/master/logos/crudjt_favicon_160x160_dark_on_white.svg" width=16 height=16> <img alt="Shows a favicon black on white color" src="https://raw.githubusercontent.com/crudjt/crudjt/refs/heads/master/logos/crudjt_favicon_white_on_dark.png" width=16 height=16> </picture> | X | 3.984 seconds |
|
|
200
|
+
|
|
201
|
+
[Full benchmark results](https://github.com/crudjt/benchmarks)
|
|
162
202
|
|
|
163
203
|
# Storage (File-backed)
|
|
164
204
|
|
|
165
205
|
## Disk footprint
|
|
166
|
-
|
|
206
|
+
**40 000** tokens of **256 bytes** each — median over 10 creates
|
|
207
|
+
darwin23, APFS
|
|
208
|
+
|
|
209
|
+
`48 MB`
|
|
210
|
+
|
|
211
|
+
[Full disk footprint results](https://github.com/crudjt/disk_footprint)
|
|
167
212
|
|
|
168
213
|
## Path Lookup Order
|
|
169
214
|
Stored tokens are placed in the **file system** according to the following order
|
|
@@ -194,9 +239,9 @@ The library has the following limits and requirements
|
|
|
194
239
|
# Contact & Support
|
|
195
240
|
<p align="center">
|
|
196
241
|
<picture>
|
|
197
|
-
<source media="(prefers-color-scheme: dark)" srcset="logos/crudjt_favicon_160x160_white_on_dark.svg" width=160 height=160>
|
|
198
|
-
<source media="(prefers-color-scheme: light)" srcset="logos/crudjt_favicon_160x160_dark_on_white.svg" width=160 height=160>
|
|
199
|
-
<img alt="Shows a dark favicon in light color mode and a white one in dark color mode" src="logos/crudjt_favicon_160x160_white.png" width=160 height=160>
|
|
242
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/crudjt/crudjt/refs/heads/master/logos/crudjt_favicon_160x160_white_on_dark.svg" width=160 height=160>
|
|
243
|
+
<source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/crudjt/crudjt/refs/heads/master/logos/crudjt_favicon_160x160_dark_on_white.svg" width=160 height=160>
|
|
244
|
+
<img alt="Shows a dark favicon in light color mode and a white one in dark color mode" src="https://raw.githubusercontent.com/crudjt/crudjt/refs/heads/master/logos/crudjt_favicon_160x160_white.png" width=160 height=160>
|
|
200
245
|
</picture>
|
|
201
246
|
</p>
|
|
202
247
|
|
data/lib/crudjt/version.rb
CHANGED
data/lib/crudjt.rb
CHANGED