pub struct CodeModeSection {Show 14 fields
pub enabled: bool,
pub server_id: Option<String>,
pub allow_writes: bool,
pub allow_deletes: bool,
pub allow_ddl: bool,
pub require_limit: bool,
pub max_limit: Option<u64>,
pub blocked_tables: Vec<String>,
pub sensitive_columns: Vec<String>,
pub auto_approve_levels: Vec<String>,
pub token_ttl_seconds: Option<u64>,
pub token_secret: Option<String>,
pub allow_inline_token_secret_for_dev: bool,
pub limits: Option<CodeModeLimits>,
}Expand description
[code_mode] section — code-mode policy + complexity limits.
The toolkit uses unprefixed field names (REF-01 invariant); the mapping
to pmcp_code_mode::CodeModeConfig’s prefixed names (sql_allow_writes,
etc.) is handled by Plan 06’s executor wiring.
Fields§
§enabled: boolMaster enable flag for code-mode.
server_id: Option<String>Server identifier used by AVP / Cedar policy resolution.
allow_writes: boolWhether INSERT / UPDATE / MERGE statements are allowed.
allow_deletes: boolWhether DELETE statements are allowed.
allow_ddl: boolWhether DDL (CREATE / ALTER / DROP) is allowed.
require_limit: boolWhether SELECT queries must declare a LIMIT.
max_limit: Option<u64>Maximum allowed LIMIT value.
blocked_tables: Vec<String>Table names blocked from any query (denylist).
sensitive_columns: Vec<String>table.column strings stripped from query output.
auto_approve_levels: Vec<String>Risk levels eligible for auto-approval (e.g. ["low"]).
token_ttl_seconds: Option<u64>Token TTL, in seconds, for HMAC-signed approval tokens.
token_secret: Option<String>Secret reference (e.g. "${CODE_MODE_SECRET}") for HMAC signing — resolved
at runtime by SecretsProvider. NEVER a raw secret value (review R6 +
T-83-04-04 in the plan threat model).
allow_inline_token_secret_for_dev: boolPer Phase 83 review R9: inline token_secret = "raw-string" is REJECTED
by default to prevent secrets from being committed to source-controlled
configs. Set this flag to true ONLY in dev/test configs where the
operator explicitly accepts the risk. NEVER set this in a committed
production config — production must use the env:VAR_NAME syntax that
resolves at runtime through SecretsProvider.
limits: Option<CodeModeLimits>[code_mode.limits] — query-complexity caps.
Trait Implementations§
Source§impl Clone for CodeModeSection
impl Clone for CodeModeSection
Source§fn clone(&self) -> CodeModeSection
fn clone(&self) -> CodeModeSection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CodeModeSection
impl Debug for CodeModeSection
Source§impl Default for CodeModeSection
impl Default for CodeModeSection
Source§fn default() -> CodeModeSection
fn default() -> CodeModeSection
Source§impl<'de> Deserialize<'de> for CodeModeSection
impl<'de> Deserialize<'de> for CodeModeSection
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for CodeModeSection
impl PartialEq for CodeModeSection
Source§fn eq(&self, other: &CodeModeSection) -> bool
fn eq(&self, other: &CodeModeSection) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for CodeModeSection
impl Serialize for CodeModeSection
impl Eq for CodeModeSection
impl StructuralPartialEq for CodeModeSection
Auto Trait Implementations§
impl Freeze for CodeModeSection
impl RefUnwindSafe for CodeModeSection
impl Send for CodeModeSection
impl Sync for CodeModeSection
impl Unpin for CodeModeSection
impl UnsafeUnpin for CodeModeSection
impl UnwindSafe for CodeModeSection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more