pub struct TreeState {
pub parked: ParkedKeys,
pub replay: Replay,
pub jwks: JwksCache,
top_edges: Mutex<HashMap<String, (bool, Instant)>>,
name_read_failed: Mutex<Option<Instant>>,
pub client: Client,
pub issuers: Vec<String>,
pub freshness: Duration,
pub loopback_fetches: bool,
pub reserved_labels: Vec<String>,
}Expand description
What the tree’s routes hold between requests.
Fields§
§parked: ParkedKeysKeys waiting for the operator; see ParkedKeys.
replay: ReplayProofs already presented; see Replay.
jwks: JwksCacheIssuers’ key sets; see JwksCache.
top_edges: Mutex<HashMap<String, (bool, Instant)>>The operator’s record for each root creator, as last re-read, and
when; see TOP_EDGE_TTL.
name_read_failed: Mutex<Option<Instant>>When a read of the operator’s record for a requested name last
failed; see refuse_operators_name.
client: ClientReaches the operator’s PDS and a DID directory.
issuers: Vec<String>The issuers whose tokens are accepted, as iss spells them. Empty
admits any issuer at a public HTTPS address.
freshness: DurationHow old a token’s iat may be; see DEFAULT_OIDC_FRESHNESS.
loopback_fetches: boolWhether this deployment may fetch from its own network: a
development stack’s posture, and a test’s. It covers an issuer on
this host over plain HTTP, and an operator whose repository answers
at a loopback address. Every deployment on the public internet
leaves it off, and didbot_http::REFUSED_BLOCKS then applies to
every URL a fetched document names.
reserved_labels: Vec<String>Labels no account may take directly under a zone; see
RESERVED_LABELS.
Implementations§
Source§impl TreeState
impl TreeState
Sourcepub fn new(park_ttl: Duration) -> Self
pub fn new(park_ttl: Duration) -> Self
Parks for park_ttl, with a fresh HTTP client and the defaults for
everything else.
Sourcepub fn with_spent_store(self, store: SpentStore) -> Result<Self, SideStoreError>
pub fn with_spent_store(self, store: SpentStore) -> Result<Self, SideStoreError>
Keeps the proof window in store, holding what it already had.
§Errors
The kept file is there and cannot be read. It stops the boot: see
didbot_pds::side_store.
Sourcepub fn with_reserved_labels(self, labels: Vec<String>) -> Self
pub fn with_reserved_labels(self, labels: Vec<String>) -> Self
Reserves labels directly under every zone instead of
RESERVED_LABELS.
Sourcepub fn with_loopback_fetches(self, allowed: bool) -> Self
pub fn with_loopback_fetches(self, allowed: bool) -> Self
Accepts issuers on this host over plain HTTP.
Sourcepub(crate) fn private_addresses(&self) -> PrivateAddresses
pub(crate) fn private_addresses(&self) -> PrivateAddresses
loopback_fetches as the guard reads it.
Sourcepub fn with_issuers(self, issuers: Vec<String>) -> Self
pub fn with_issuers(self, issuers: Vec<String>) -> Self
Accepts only issuers; empty admits any public HTTPS issuer.
Sourcepub fn with_freshness(self, freshness: Duration) -> Self
pub fn with_freshness(self, freshness: Duration) -> Self
Refuses a token whose iat is older than freshness.
Sourcefn top_edge(&self, did: &str) -> Option<bool>
fn top_edge(&self, did: &str) -> Option<bool>
Whether the operator’s record for did stood when last re-read
inside TOP_EDGE_TTL, or None when it is time to read again.
fn remember_top_edge(&self, did: &str, stands: bool)
Sourcefn name_read_failed_lately(&self) -> bool
fn name_read_failed_lately(&self) -> bool
Whether a read of the operator’s record for a name failed inside
TOP_EDGE_TTL.
fn remember_name_read_failed(&self)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TreeState
impl !RefUnwindSafe for TreeState
impl Send for TreeState
impl Sync for TreeState
impl Unpin for TreeState
impl UnsafeUnpin for TreeState
impl !UnwindSafe for TreeState
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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