WIP: Audit Logs #45

Draft
baaboe wants to merge 13 commits from wip/auditlog into main
Member
No description provided.
baaboe added 12 commits 2025-08-05 10:52:40 +00:00
feat: added audit logs table to the database
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
e8de96b2d0
feat: started on auditlog object
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
b49e5036be
Merge origin/main into wip/auditlog. Needed pagination
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
6017b7087f
style: cargo clippy --fix && cargo fmt
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
2b9a44c4f0
feat: added audit log on channel update
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
362e4bc2e8
audit log on ban and unban
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
ci/woodpecker/pr/build-and-publish Pipeline was successful
6afa78c8e8
baaboe self-assigned this 2025-08-05 10:52:57 +00:00
sauceyred reviewed 2025-08-07 05:03:42 +00:00
sauceyred left a comment
Owner

Some thoughts

Some thoughts
@ -55,7 +51,9 @@ pub async fn delete(
.check_permission(&mut conn, &app_state.cache_pool, Permissions::ManageChannel)
.await?;
let log_entrie = AuditLog::new(channel.guild_uuid, AuditLogId::ChannelDelete as i16, member.uuid, None, None, None, None, Some(channel.name.clone()), None, None).await;
Owner

log_entry*
There are several instances of this typo

`log_entry`* There are several instances of this typo
Author
Member

But if I want to type it with an ie

But if I want to type it with an ie
baaboe marked this conversation as resolved
@ -47,2 +48,4 @@
.route("/bans", get(bans::get))
.route("/bans/{uuid}", delete(bans::unban))
// Audit Logs
.route("/auditlogs", get(auditlogs::get))
Owner

I think we should use either audit-logs or just logs as the endpoint

I think we should use either `audit-logs` or just `logs` as the endpoint
Author
Member

Why?

Why?
@ -0,0 +11,4 @@
use serde::{Deserialize, Serialize};
use uuid::Uuid;
pub enum AuditLogId {
Owner

If we're gonna use OBJECT_ACTION format (e.g. MEMBER_BAN) for the WebSocket events, should we use it for audit logs as well instead of using integers?

If we're gonna use `OBJECT_ACTION` format (e.g. `MEMBER_BAN`) for the WebSocket events, should we use it for audit logs as well instead of using integers?
baaboe added 1 commit 2025-08-07 21:33:01 +00:00
style: spelling fix
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
ci/woodpecker/pr/build-and-publish Pipeline was successful
e663c1bbae
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
ci/woodpecker/pr/build-and-publish Pipeline was successful
This pull request is marked as a work in progress.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin wip/auditlog:wip/auditlog
git checkout wip/auditlog

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git checkout main
git merge --no-ff wip/auditlog
git checkout wip/auditlog
git rebase main
git checkout main
git merge --ff-only wip/auditlog
git checkout wip/auditlog
git rebase main
git checkout main
git merge --no-ff wip/auditlog
git checkout main
git merge --squash wip/auditlog
git checkout main
git merge --ff-only wip/auditlog
git checkout main
git merge wip/auditlog
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: gorb/backend#45
No description provided.