Skip to main content

Config

Struct Config 

Source
pub struct Config {
Show 19 fields pub user_identity: String, pub user_name: String, pub user_email: String, pub trusted_remote_endpoint: String, pub signing_key: String, pub default_branch: String, pub remote_endpoint: String, pub remote_bucket: String, pub remote_type: String, pub ssh_strict_host_key_checking: String, pub ssh_user_known_hosts_file: String, pub ssh_identity_file: String, pub signer: String, pub key: KeyConfig, pub attest: AttestConfig, pub remotes: BTreeMap<String, RemoteEntry>, pub branch_upstreams: BTreeMap<String, Upstream>, pub durability_objects: String, pub core: BTreeMap<String, String>,
}
Expand description

Full in-memory representation of merged config (user + repo + defaults). All fields default to empty / documented defaults; readers that want a known-good default file should call read_or_default.

Fields§

§user_identity: String

Hex-encoded Identity: [kind:u8][len:u16 LE][bytes]. Empty = derive from the signing key’s public key at commit time.

§user_name: String

Git-compatibility alias user.name. Non-authoritative: stored and round-tripped for parity with git config user.name, but it NEVER feeds the cryptographic commit author (which is user_identity / the signing key). Repo-safe.

§user_email: String

Git-compatibility alias user.email. Non-authoritative, exactly like user_name — never feeds the signed author.

§trusted_remote_endpoint: String

Exact remote endpoint the user has explicitly trusted for ambient HTTP/S3 environment credentials. User-scoped only.

§signing_key: String§default_branch: String§remote_endpoint: String§remote_bucket: String§remote_type: String§ssh_strict_host_key_checking: String§ssh_user_known_hosts_file: String§ssh_identity_file: String§signer: String

Commit-signing selector. User-scoped only.

§key: KeyConfig

[key] section. User-scoped keystore selectors.

§attest: AttestConfig

[attest] section. Separate struct so new attest knobs don’t balloon the flat Config.

§remotes: BTreeMap<String, RemoteEntry>

Named remotes keyed by name (remote.<name>.url / remote.<name>.type). Repo-safe — addresses, same class as the flat remote_endpoint. The legacy flat remote_endpoint / remote_type act as the implicit default remote.

§branch_upstreams: BTreeMap<String, Upstream>

Per-branch upstream tracking keyed by local branch name (branch.<branch>.remote / branch.<branch>.merge). Repo-safe.

§durability_objects: String

Object-store durability schedule: empty/batch (default) = batched commit-time flushes; per-object = strict historical full-flush-per-object schedule (SPEC-OBJECTS §10.1’s stricter conforming option). Repo-safe: the non-default value only STRENGTHENS durability (and slows writes); it cannot weaken anything.

§core: BTreeMap<String, String>

Allowlisted, inert core.* git-compat keys (see CORE_ALLOWED_KEYS). Accepted and round-tripped for parity but not honored by mkit — they are cosmetic settings git stores per-repo. Dangerous core.* keys (CORE_DENIED_KEYS) are rejected rather than stored. Keyed by the bare suffix (e.g. autocrlf).

Implementations§

Source§

impl Config

Source

pub fn with_defaults() -> Self

Return a Config with documented defaults filled in.

Source§

impl Config

Validate that a key-file path (signing_key, attest.*_key_path, ssh.*_file) cannot escape via .. traversal. Empty strings pass — callers fall back to the documented default.

Source

pub fn object_sync_policy(&self) -> SyncPolicy

Map durability.objects onto the object-store sync policy. Unknown values fall back to the batched default rather than erroring — config load must not brick the repo.

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Config

Source§

fn default() -> Config

Returns the “default value” for a type. Read more
Source§

impl Eq for Config

Source§

impl PartialEq for Config

Source§

fn eq(&self, other: &Config) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Config

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> NoneValue for T
where T: Default,

Source§

type NoneType = T

Source§

fn null_value() -> T

The none-equivalent value.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more