@orthacms/activity-server 0.3.0 → 0.4.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"audit-event-mapping.d.ts","sourceRoot":"","sources":["../../../../src/lib/activity/infrastructure/audit-event-mapping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGtD;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACrB,uEAAuE;IACvE,EAAE,EAAE,MAAM,CAAC;IACX,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,WAAW,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,8CAA8C;IAC9C,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACrC,qDAAqD;IACrD,EAAE,EAAE,IAAI,CAAC;CACZ;AAgKD;;;;;;;;;;;GAWG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;gBACpC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM;CAMjD;AA+OD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAE3B,SAAS,MAAM,EAAE,CAAC;AAgBvB;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,QAAQ,GAAG,IAAI,CAiB9D"}
1
+ {"version":3,"file":"audit-event-mapping.d.ts","sourceRoot":"","sources":["../../../../src/lib/activity/infrastructure/audit-event-mapping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGtD;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACrB,uEAAuE;IACvE,EAAE,EAAE,MAAM,CAAC;IACX,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,WAAW,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,8CAA8C;IAC9C,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACrC,qDAAqD;IACrD,EAAE,EAAE,IAAI,CAAC;CACZ;AAgKD;;;;;;;;;;;GAWG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;gBACpC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM;CAMjD;AAkRD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAE3B,SAAS,MAAM,EAAE,CAAC;AAgBvB;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,QAAQ,GAAG,IAAI,CAiB9D"}
@@ -315,8 +315,35 @@ const FACET_MAPPERS = {
315
315
  // itself went from `pending` to `active` and gained a credential. Those are
316
316
  // different facts and a security review wants the first one.
317
317
  'user.activated': (e) => userSubject(e, USER_AUDIT_KINDS.ACTIVATED, null),
318
- 'auth.signed_in': (e) => userSubject(e, identity_server_1.IDENTITY_ACTIVITY_KINDS.USER_SIGNED_IN, null),
318
+ // The sign-in itself, plus **how** it happened. A password sign-in carries
319
+ // no method and reads as it always has; an SSO one records the provider, so
320
+ // the log can answer "which of these people came in through the directory,
321
+ // and which still hold a password?" — which is the first question after a
322
+ // provider is misconfigured or retired.
323
+ 'auth.signed_in': (e) => userSubject(e, identity_server_1.IDENTITY_ACTIVITY_KINDS.USER_SIGNED_IN, e.payload.method === 'sso'
324
+ ? {
325
+ method: 'sso',
326
+ provider: nullableString(e.payload.provider)
327
+ }
328
+ : null),
319
329
  'auth.signed_out': (e) => userSubject(e, identity_server_1.IDENTITY_ACTIVITY_KINDS.USER_SIGNED_OUT, null),
330
+ // Single sign-on. Three separate facts, deliberately not folded into the
331
+ // sign-in above: a link means a second way into the account now exists, a
332
+ // provisioned account is the only kind this product creates without an
333
+ // invite, and a mapped role is an authorization change that an
334
+ // administrator did not make. A reviewer asking "where did this user come
335
+ // from?" is asking for the middle one, and a sign-in row cannot answer it.
336
+ 'user.sso_linked': (e) => userSubject(e, identity_server_1.IDENTITY_ACTIVITY_KINDS.USER_SSO_LINKED, {
337
+ provider: nullableString(e.payload.provider)
338
+ }),
339
+ 'user.sso_provisioned': (e) => userSubject(e, identity_server_1.IDENTITY_ACTIVITY_KINDS.USER_SSO_PROVISIONED, {
340
+ provider: nullableString(e.payload.provider),
341
+ role: nullableString(e.payload.role)
342
+ }),
343
+ 'user.sso_role_mapped': (e) => userSubject(e, identity_server_1.IDENTITY_ACTIVITY_KINDS.USER_SSO_ROLE_MAPPED, {
344
+ provider: nullableString(e.payload.provider),
345
+ role: nullableString(e.payload.role)
346
+ }),
320
347
  // External-API bearer tokens. Nothing mapped these before, so minting and
321
348
  // revoking a long-lived key to workspace content left the log completely
322
349
  // silent (BUG-identity-server-01) — the audit trail could not answer "who
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orthacms/activity-server",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "@orthacms/activity-server — part of Ortha CMS.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/ortha-source/ortha-cms/tree/main/packages/activity/server",
@@ -28,13 +28,13 @@
28
28
  "dependencies": {
29
29
  "@nestjs/common": "^11.0.0",
30
30
  "@nestjs/swagger": "^11.4.6",
31
- "@orthacms/bootstrap-server": "^0.3.0",
32
- "@orthacms/copilot-domain": "^0.3.0",
33
- "@orthacms/copilot-server": "^0.3.0",
34
- "@orthacms/database": "^0.3.0",
35
- "@orthacms/identity-server": "^0.3.0",
36
- "@orthacms/tools-server": "^0.3.0",
37
- "@orthacms/utils-server": "^0.3.0",
31
+ "@orthacms/bootstrap-server": "^0.4.0",
32
+ "@orthacms/copilot-domain": "^0.4.0",
33
+ "@orthacms/copilot-server": "^0.4.0",
34
+ "@orthacms/database": "^0.4.0",
35
+ "@orthacms/identity-server": "^0.4.0",
36
+ "@orthacms/tools-server": "^0.4.0",
37
+ "@orthacms/utils-server": "^0.4.0",
38
38
  "class-transformer": "^0.5.1",
39
39
  "class-validator": "^0.15.1",
40
40
  "drizzle-orm": "^0.45.0",