Skip to content

Home > @opengovsg/logging > UserManagementAudit

UserManagementAudit interface ​

User & permission management audit events (category userManagement).

These act on a *target* account that is usually distinct from the *actor*: the actor is the authenticated request's user_id (read from scope), the target is targetUserId in the payload (emitted as context.target_user_id). They coincide only for self-service actions (self-signup, self password reset).

Events log *what changed*, never the changed values — field/role names and id references only — so secrets and PII stay unrepresentable.

Signature:

typescript
export interface UserManagementAudit

Methods ​

MethodDescription
accountCreated(input)An account was created (admin-created or self-signup). Fires at notice.
accountDeactivated(input)An account was deactivated/suspended. Fires at notice.
accountDeleted(input)An account was deleted. Fires at notice.
accountModified(input)An account's attributes were changed. Fires at notice.
apiKeyChanged(input)An account's API key was created, rotated, or revoked. Fires at notice.
mfaSettingChanged(input)An account's MFA settings changed. Fires at notice.
passwordReset(input)An account's password was reset (self-service or admin). Fires at notice.
roleChanged(input)An account's roles/permissions changed. Fires at notice.