@things-factory/auth-base 10.1.265 → 10.1.269

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/auth-base",
3
- "version": "10.1.265",
3
+ "version": "10.1.269",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -35,10 +35,10 @@
35
35
  "@reduxjs/toolkit": "^2.2.5",
36
36
  "@simplewebauthn/browser": "^13.0.0",
37
37
  "@simplewebauthn/server": "^13.0.0",
38
- "@things-factory/email-base": "^10.1.265",
38
+ "@things-factory/email-base": "^10.1.267",
39
39
  "@things-factory/env": "^10.1.149",
40
- "@things-factory/shell": "^10.1.265",
41
- "@things-factory/task-lease": "^10.1.265",
40
+ "@things-factory/shell": "^10.1.267",
41
+ "@things-factory/task-lease": "^10.1.267",
42
42
  "@things-factory/utils": "^10.1.179",
43
43
  "@types/webappsec-credential-management": "^0.6.9",
44
44
  "jsonwebtoken": "^9.0.0",
@@ -50,5 +50,5 @@
50
50
  "passport-jwt": "^4.0.0",
51
51
  "passport-local": "^1.0.0"
52
52
  },
53
- "gitHead": "c192450de7dba8d27ec97c34e57d9b9860ebb317"
53
+ "gitHead": "d4fbddbb97458c60e7c32a2b3c8e4d04bab95464"
54
54
  }
@@ -340,6 +340,22 @@ describe('reading the audit (§5 · §6)', () => {
340
340
  expect(people.find((one: any) => one.user.id === lee.id)).toMatchObject({ granted: 0, denied: 0, checkins: 0 })
341
341
  })
342
342
 
343
+ it("each member's last use is their latest request to this domain, and none before any", async () => {
344
+ allow(true)
345
+ await getRepository(AuditRequest).save([
346
+ { id: '00000000-0000-4000-8000-000000000001', domain, actor: kim, channel: 'graphql', createdAt: new Date(Date.now() - 3 * 60 * 60 * 1000) },
347
+ { id: '00000000-0000-4000-8000-000000000002', domain: other, actor: kim, channel: 'graphql', createdAt: new Date(Date.now() + 60 * 60 * 1000) }
348
+ ])
349
+ await request(kim, '{ payslip(employeeId: "e1") }')
350
+
351
+ const people = await new AuditQuery().auditPeople(from, to, context())
352
+ const row = people.find((one: any) => one.user.id === kim.id)
353
+ expect(row.lastUsedAt).toBeInstanceOf(Date)
354
+ /* The latest of this domain's - not the older one here, nor the later one in another domain. */
355
+ expect(Math.abs(row.lastUsedAt.getTime() - Date.now())).toBeLessThan(60_000)
356
+ expect(people.find((one: any) => one.user.id === lee.id).lastUsedAt).toBeUndefined()
357
+ })
358
+
343
359
  it('every declared door, one with no record in the period too', async () => {
344
360
  await getRepository(Privilege).save([
345
361
  { name: 'query', category: 'payroll' },