nix: add loadtest with unique JWTs

This loadtests the jwt decoding logic. For this it adds an optional
`-k`(kind) parameter to `postgrest-loadtest` and
`postgrest-loadtest-against`.

Old kind (default):

```
postgrest-loadtest -k mixed
postgrest-loadtest-against -k mixed
```

New kind:

```
postgrest-loadtest -k jwt
postgrest-loadtest-against -k jwt
```

Internally it uses a dynamically generated targets file using python
which looks like:

```
GET http://postgrest/authors_only
Authorization: Bearer <jwt>

GET http://postgrest/authors_only
Authorization: Bearer <another-jwt>
...
```

Then this is used to run vegeta with the `-lazy` option.
This commit is contained in:
steve-chavez
2025-04-17 23:11:33 -05:00
committed by Steve Chavez
parent a37ec1e1a5
commit 608f7ca45a
5 changed files with 122 additions and 14 deletions
+1
View File
@@ -24,3 +24,4 @@ coverage
loadtest
.history
.docs-build
test/load/gen_targets.http