@nxgt/janus-mongo 0.3.0 → 0.3.2

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
@@ -72,8 +72,8 @@ encoded. A document read in a shell reads like the record in the code.
72
72
 
73
73
  No secret is stored: sessions and tokens hold `sha256` of the secret,
74
74
  passwords a self-describing hash, and a user's `secondFactor.secret` a TOTP
75
- secret the store keeps byte for byte, which `@nxgt/janus` will seal with your
76
- application's key before the store sees it, once the second factor ships.
75
+ secret `@nxgt/janus` has already sealed with your application's key —
76
+ `v1.<key id>.…` — which the store keeps byte for byte.
77
77
 
78
78
  `countAttempt` counts an attempt at a code in one `findOneAndUpdate` with
79
79
  `$inc`, so twenty concurrent attempts answer twenty distinct counts.
@@ -100,9 +100,11 @@ encoded: a document read in a shell reads like the record in the code.
100
100
 
101
101
  - **No secret is stored.** Sessions and tokens hold the `sha256` of the
102
102
  secret; passwords a self-describing hash (`$scrypt$…`, `$argon2id$…`); a
103
- second factor's `secret` a TOTP secret kept byte for byte, which
104
- `@nxgt/janus` will seal with your application's key before the store sees
105
- it, once the second factor ships.
103
+ second factor's `secret` a TOTP secret `@nxgt/janus` has already sealed
104
+ with your application's key, kept byte for byte. Its key id is the second
105
+ part of the value, so `{ 'secondFactor.secret': { $regex: '^v1\\.<id>\\.' } }`
106
+ finds the secrets still sealed with a key being
107
+ [rotated out](https://github.com/softistx/nxgt-janus/blob/develop/packages/janus/docs/guide/second-factor.md#rotating-the-keys).
106
108
  - **Documents written by an earlier version need no migration.** A user
107
109
  without `secondFactor` reads as having none; a token without `codeHash` or
108
110
  `attempts` reads as `null` and `0`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxgt/janus-mongo",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "The MongoDB adapter for @nxgt/janus: users, sessions, one-time tokens and permission tuples",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -48,7 +48,7 @@
48
48
  ]
49
49
  },
50
50
  "devDependencies": {
51
- "@nxgt/janus": "^0.4.0",
51
+ "@nxgt/janus": "^0.6.0",
52
52
  "@nxgt/mongo": "^0.17.1",
53
53
  "@types/bun": "^1.4.2",
54
54
  "mongodb": "^7.6.0",
@@ -56,7 +56,7 @@
56
56
  "zod": "^4.6.5"
57
57
  },
58
58
  "peerDependencies": {
59
- "@nxgt/janus": "^0.4.0",
59
+ "@nxgt/janus": "^0.6.0",
60
60
  "@nxgt/mongo": ">=0.17.0 <1",
61
61
  "mongodb": ">=7.0.0 <8",
62
62
  "typescript": "^6.0.3",