Audit Event Emitter (audit/mod.rs)

vibe-kanban · crates/remote/src/audit/mod.rs · rust · Apache-2.0
security, auth, infra, lang:rust

Defines audit actions and emits structured audit events for authentication and member-management operations. Reuse for security-sensitive action logging and compliance trails.

// Source: https://github.com/BloopAI/vibe-kanban | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
use uuid::Uuid;

use crate::auth::RequestContext;

#[derive(Debug, Clone, Copy)]
pub enum AuditAction {
    AuthLogin,
    AuthLogout,
    AuthTokenRefresh,
    AuthTokenReuseDetected,
    AuthSessionRevoked,

    MemberInvite,
    MemberAcceptInvite,
    MemberRevokeInvite,
    MemberRemove,
    MemberRoleChange,
}

impl AuditAction {
    pub fn as_str(&self) -> &'static str {
        match self {
            Self::AuthLogin => "auth.login",
            Self::AuthLogout => "auth.logout",
            Self::AuthTokenRefresh => "auth.token_refresh",
            Self::AuthTokenReuseDetec

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key