Skip to main content
Glama
audit_log.rs1.25 kB
use chrono::Utc; use serde::{ Deserialize, Serialize, }; use v1::{ AuditLogKindV1, AuditLogMetadataV1, AuditLogV1, }; use crate::{ Actor, AuthenticationMethod, ChangeSetId, }; mod v1; pub use v1::PropValueSource; pub type AuditLogKind = AuditLogKindV1; pub type AuditLogMetadata = AuditLogMetadataV1; // TODO(nick): switch to something like "acceptable" crate to avoid sizing issues. #[derive(Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] pub enum AuditLog { V1(Box<AuditLogV1>), } impl AuditLog { /// Creates a new [`AuditLog`] with a mandatory [`ChangeSetId`]. /// /// _Note:_ [`ChangeSetId`] is required for almost all kinds of audit logging except for /// workspace management and authentication. pub fn new( actor: Actor, kind: AuditLogKind, entity_name: String, change_set_id: ChangeSetId, authentication_method: AuthenticationMethod, ) -> Self { Self::V1(Box::new(AuditLogV1 { actor, kind, entity_name, timestamp: Utc::now().to_rfc3339(), change_set_id: Some(change_set_id), authentication_method: Some(authentication_method), })) } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/systeminit/si'

If you have feedback or need assistance with the MCP directory API, please join our Discord server