-
Notifications
You must be signed in to change notification settings - Fork 0
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
Monitor users authority changes #49
Conversation
…authority_monitoring, compatibility fixes.
…key of AUTHORITIES_MONITOR
…authority_monitoring Due to messy automatic merge it was actually performed in the previous commit
…authority_monitoring
…onfigRepository get to script use case. Removed info log from MSTeams repo.
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.
thanks @nshandra
I've reviewed from technical point of view without execute the script.
There is a good job in Clean Architecture, you have added tests and concepts viewed in coding dojos, congratulations!
However, you have added vite and vitest and this provokes errors in other tests using jest mocks when I use yarn test
.
Changes requested:
-
Two possible solutions here: remove vite and vitest and use only jest or try fix all tests and remove jest.
-
Please add github action file to the project, so it's easy to know when other tests are failing to do a new PR
- some packages were needed for the test to work, they are all added as dev dependencies - added jsdom as a test environment because of the use of window in some of the tested code - created a *.data.ts test exclude rule for AuthoritiesMonitoringTests.data.ts (former data.ts)
… multiple monitored authorities as intended. Update tests.
@xurxodev As mentioned, requested changes done. |
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.
thanks @nshandra
Now we have github action and works execute all test
📌 References
Issue: Log any modification to a admin user and send a notification to MS Teams
📝 Implementation
Script to monitor users by their assigned authorities. Right now we monitor the "ALL" authority, but its possible to monitor several auths. The script logs the changes to stdout and to a MS Teams channel.
The changes are split into two categories:
Execution:
Parameters:
--config-file
: Connection and webhook config file.-s
|--set-datastore
: Write users data to datastore, use in script setup. It assumes there is a monitoring config in d2-tools/authorities-monitor.Requirements:
Check README.md for more info.
Notes:
We had to use
feature/report_user_without_2factor
branch as a base for this script.