Skip to content
Snippets Groups Projects
Commit bf567b5a authored by David Huss's avatar David Huss :speech_balloon:
Browse files

Add regex section

parent 369ef629
No related branches found
No related tags found
No related merge requests found
......@@ -40,3 +40,18 @@ In production it makes sense to run stechuhr with gunicorn:
source env/bin/activate
gunicorn stechuhr_server.server:app
```
# Configuration
## ID verification
in `config.toml` you can add a list of regex patterns that stechuhr (*both on server and on client!*) uses to verify the Card IDs. These two patterns for example allow upper/lowercase hex strings with lengths either between 6 and 16 characters OR exactly 24 characters:
```toml
id_patterns = [
"^[A-Fa-f0-9]{24}$",
"^[A-Fa-f0-9]{6,16}$",
]
```
If in doubt consider [testing your regexes here](https://regexplained.com/)
\ No newline at end of file
#! /bin/bash
curl --header "Content-Type: application/json" --request POST --data '{"location":"lerchenfeld", "entrance":"haupteingang", "direction":"in", "id":"543GFDHG"}' http://localhost:8000/
curl --header "Content-Type: application/json" --request POST --data '{"location":"lerchenfeld", "entrance":"haupteingang", "direction":"in", "id":"DEADBEEF42"}' http://localhost:8000/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment