diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..615cbcb --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,15 @@ +name: Verify +on: [push, pull_request] +permissions: + contents: read +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - run: python -m pip install cryptography + - run: python -m unittest test_gate -v diff --git a/README.md b/README.md index 8f6a64d..c673db3 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,12 @@ The gate rereads the keyset file when it changes. Spent tokens are held in memory only, in one set per key, and a key's set is dropped when the key leaves the keyset. Requests are not logged. +**Restart boundary:** a previously spent token can be redeemed again after a +restart while its signing key is still valid. Separate gate processes also +have independent spent sets. This implementation deliberately avoids durable +request state; it does not provide restart-safe or multi-process single use. +Do not use it for that requirement without designing a shared redemption store. + ## Keys python3 keyrotate.py init # create the first key