Isolate standalone key wallet handling

This commit is contained in:
fawney19
2026-04-27 12:54:59 +08:00
parent 3b542434a2
commit 1d23bf4ecb
12 changed files with 240 additions and 16 deletions

View File

@@ -1,5 +1,9 @@
use serde::{Deserialize, Serialize};
fn is_false(value: &bool) -> bool {
!*value
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct ExecutionRuntimeAuthContext {
pub user_id: String,
@@ -10,4 +14,6 @@ pub struct ExecutionRuntimeAuthContext {
pub api_key_name: Option<String>,
pub balance_remaining: Option<f64>,
pub access_allowed: bool,
#[serde(default, skip_serializing_if = "is_false")]
pub api_key_is_standalone: bool,
}

View File

@@ -268,6 +268,7 @@ mod tests {
api_key_name: None,
balance_remaining: Some(12.5),
access_allowed: true,
api_key_is_standalone: false,
}),
);