pub struct BrokerLimits {
pub max_encrypt_size: usize,
pub max_payload_size: usize,
pub grace_versions: u32,
pub svid_ttl_secs: u64,
pub retain_versions: Option<u32>,
}Expand description
Broker-wide runtime limits + rotation policy, supplied by the binary at startup and shared (immutable) across connections.
These are broker knobs (not catalog/policy data): payload caps, SVID
lifetime, and the rotation grace/retention windows the manager applies on
rotate + the retention sweep (vault-xhq / vault-uo1).
Fields§
§max_encrypt_size: usizeCap (bytes) on the encrypt plaintext and the decrypt ciphertext;
over-limit → payload_too_large (wire §2.1). Default
DEFAULT_MAX_ENCRYPT_SIZE.
max_payload_size: usizeCap (bytes) on the set value and the import key material; over-limit →
payload_too_large (wire §2.1, “same mechanism” as the AEAD cap). This is
the broker-side max that replaces relying on the u32 frame ceiling
(vault-sao). Default DEFAULT_MAX_PAYLOAD_SIZE.
grace_versions: u32Rotation grace window in key versions: on rotate, the manager raises
the backend’s min_decryption_version to new_version - grace_versions
(clamped at 1), so versions older than the window stop decrypting/verifying
while the in-window ones still do. Default
DEFAULT_ROTATION_GRACE_VERSIONS.
svid_ttl_secs: u64Lifetime, in seconds, for SPIFFE SVIDs minted by the Workload API. Default
DEFAULT_SVID_TTL_SECS.
retain_versions: Option<u32>Retention floor in key versions: BrokerLimits::retention_floor
raises the backend’s min_available_version to
latest - retain_versions (clamped at 1), irreversibly pruning archived
key material below it. None disables the sweep (retain everything).
Implementations§
Source§impl BrokerLimits
impl BrokerLimits
Sourcepub const fn grace_floor(&self, latest: u32) -> u32
pub const fn grace_floor(&self, latest: u32) -> u32
The grace floor (min_decryption_version) for a key now at latest:
latest - grace_versions, clamped to at least 1.
Sourcepub const fn retention_floor(&self, latest: u32) -> Option<u32>
pub const fn retention_floor(&self, latest: u32) -> Option<u32>
The retention floor (min_available_version) for a key now at latest,
or None when retention is disabled. latest - retain_versions, clamped
to at least 1 (never prunes the only/last version).
Trait Implementations§
Source§impl Clone for BrokerLimits
impl Clone for BrokerLimits
Source§fn clone(&self) -> BrokerLimits
fn clone(&self) -> BrokerLimits
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for BrokerLimits
Source§impl Debug for BrokerLimits
impl Debug for BrokerLimits
Auto Trait Implementations§
impl Freeze for BrokerLimits
impl RefUnwindSafe for BrokerLimits
impl Send for BrokerLimits
impl Sync for BrokerLimits
impl Unpin for BrokerLimits
impl UnsafeUnpin for BrokerLimits
impl UnwindSafe for BrokerLimits
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request