Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 4 additions & 1 deletion crates/cognitum-gate-kernel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,10 @@ pub unsafe extern "C" fn ingest_delta(ptr: *const u8, len: usize) -> i32 {
///
/// Returns 1 on success, 0 if buffer is full or tile not initialized.
#[no_mangle]
#[deprecated(since = "0.1.2", note = "Use ingest_delta(ptr, len) with bounds checking")]
#[deprecated(
since = "0.1.2",
note = "Use ingest_delta(ptr, len) with bounds checking"
)]
#[must_use]
pub unsafe extern "C" fn ingest_delta_unchecked(ptr: *const u8) -> i32 {
// Use Delta size as implied length
Expand Down
5 changes: 4 additions & 1 deletion crates/cognitum-gate-kernel/tests/security_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@ fn test_buffer_full_behavior() {
}

// Buffer should now be full
assert_eq!(tile.delta_count as usize, cognitum_gate_kernel::MAX_DELTA_BUFFER);
assert_eq!(
tile.delta_count as usize,
cognitum_gate_kernel::MAX_DELTA_BUFFER
);

// Next insert should fail
let delta = Delta::edge_add(999, 1000, 100);
Expand Down
9 changes: 7 additions & 2 deletions crates/mcp-brain-server/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ use axum::{
extract::FromRequestParts,
http::{request::Parts, StatusCode},
};
use sha3::{Shake256, digest::{Update, ExtendableOutput, XofReader}};
use sha3::{
digest::{ExtendableOutput, Update, XofReader},
Shake256,
};
use subtle::ConstantTimeEq;

/// Authenticated contributor extracted from request
Expand Down Expand Up @@ -53,7 +56,9 @@ const MIN_API_KEY_LEN: usize = 8;
/// If BRAIN_SYSTEM_KEY is unset, system key authentication is disabled entirely
/// (no hardcoded fallback).
static SYSTEM_KEY: std::sync::LazyLock<Option<String>> = std::sync::LazyLock::new(|| {
std::env::var("BRAIN_SYSTEM_KEY").ok().filter(|k| !k.is_empty())
std::env::var("BRAIN_SYSTEM_KEY")
.ok()
.filter(|k| !k.is_empty())
});

#[axum::async_trait]
Expand Down
Loading
Loading