@wtfalch/keys 0.4.0 → 0.4.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.
package/README.md CHANGED
@@ -30,7 +30,7 @@ Held keys use active cache expiry (60 seconds by default) and retain at most 256
30
30
 
31
31
  ## Issued-key environments
32
32
 
33
- Every issued credential carries a built-in `environment`, `'live'` or `'test'` (default `'live'`), passed on `issue()` and reported by `check()` and `lineageOf()`. A credential can only mint a child in its own environment — `issue()` returns `{ ok: false, reason: 'environment_mismatch' }` otherwise. Apply `0005_keys_environment.sql` alongside `0004_keys_security.sql`.
33
+ Every issued credential carries a built-in `environment`, `'live'` or `'test'` (default `'live'`), passed on `issue()` and reported by `check()` and `lineageOf()`. A credential can only mint a child in its own environment — `issue()` returns `{ ok: false, reason: 'environment_mismatch' }` otherwise. Apply `0005_keys_environment.sql` alongside `0004_keys_security.sql`, and `0008_keys_environment_default.sql` in the same run: without it, containers still on 0.2.1 or older cannot issue keys between the migration and their redeploy.
34
34
 
35
35
  ## Issued-key usage tracking
36
36
 
@@ -0,0 +1,10 @@
1
+ -- Restores the `environment` default that 0005_keys_environment.sql dropped.
2
+ -- Additive; do not edit copied migrations.
3
+ --
4
+ -- Without it, a host that runs its migrations before redeploying breaks every
5
+ -- issue() on its still-running old containers: @wtfalch/keys 0.2.1 and older
6
+ -- insert rows with no `environment` column at all, and a NOT NULL column with
7
+ -- no default refuses them. 'live' is the value 0005 backfilled on every row
8
+ -- minted before it, so an old container's rows get what they always had.
9
+ -- New code passes `environment` explicitly and never relies on this default.
10
+ alter table keys_issued_credentials alter column environment set default 'live';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wtfalch/keys",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "The estate's own bearer keys, issued to callers and held on their behalf: two entries, issued and held, nothing stored in common.",
5
5
  "repository": {
6
6
  "type": "git",