-
Notifications
You must be signed in to change notification settings - Fork 14
feat : Action Log #6455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat : Action Log #6455
Conversation
🧪 Review environmenthttps://v3neitutwtf6l22nlrgcaedtru0ftdyr.lambda-url.ca-central-1.on.aws/ |
|
Do we potentially also need the detailed entities to be defined / captured bilingually as well? Are these currently outside the translation files? Options/Attributes:
|
i18n improvements Co-authored-by: Anik Brazeau <[email protected]>
Right! I'll add a small bit for translating params next. |
|
Another possible enhancement: If we wanted to potentially simplify our lives in the future, we could also store "objects"/"variables" to build out the strings. Option 1: [ User ] [ Action ] [Object ] [ Detail ] at [ Date ] [ Timestamp ] With [User] = [AccountEmailAddress] |
That's what we're doing for the most part.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good to me. Two small suggestions...
| }); | ||
| }; | ||
|
|
||
| export const getUsersEmails = async ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might suggest to move this to the auditLogs module and make it an internal function _getUserEmails. If another developer were to use the function for a different feature/context it could be problematic from a security perspective.
| subject: { type: keyof typeof AuditSubjectType; id?: string }, | ||
| event: AuditLogEventStrings, | ||
| description?: string | ||
| ...args: T extends keyof AllAuditParams |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we can move to a static signature for the logEvent function. The ...args collector is often used in funtions that can have multiple signatures and then goes through a type check to validate which signature to use. In this case we know the args so I'm wondering if there is a less complex way of typing this.
To access Audit Logs, simply go to the form settings page, and click download activity log!~ Events can take up to 5 minutes to be available in the dynamodb and thus appear in the log.
All audit log entries now require a matching type.
All audit log details entries now require typesafe parameters defined. These are then passed as JSON Params to be translated.
Closes #6283