Skip to main content

Config

Struct Config 

Source
pub struct Config {
Show 21 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 transport_auth: String, pub signer: String, pub pull_require_signed: 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§transport_auth: String

Write-auth scheme for mkit+https:// / mkit+http:// remotes (mkit-transport-connect::ConnectTransport). Empty/"bearer" (default) sends MKIT_API_TOKEN as a Bearer token, unchanged from #700/#701. "envelope" ADDITIONALLY signs every write RPC (UpdateRef/AdvanceRefs/UploadPack) with an Ed25519 write envelope, reusing the exact SAME signer resolution as commit signing — Self::signer / Self::signing_key / KeyConfig::ed25519_ref — see remote_dispatch::envelope_signer_from_config. Repo-safe: this selects a wire-auth MODE, the same class of connection-shape metadata as remote_type; the actual signer IDENTITY selectors (signer, signing_key, key.*) stay user-scoped-only (REPO_FORBIDDEN_KEYS, unchanged) so a hostile repo cannot redirect which key or backend does the signing — only whether the already-user-controlled commit-signing identity is also used to authenticate pushes to this remote.

§signer: String

Commit-signing selector. User-scoped only.

§pull_require_signed: String

pull.require_signed — gates whether clone/pull/fetch verify every newly-fetched commit/remix/tag’s Ed25519 signature before publishing the remote-tracking ref (issue #692). Empty (the documented default) and any value except "false"/"0"/"no"/ "off" mean “verify, fail closed”; see Config::pull_require_signed_or_default. User-scoped only — a hostile repo config must not be able to silently disable the check that protects the clone against exactly that repo (see REPO_FORBIDDEN_KEYS).

§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.

Source

pub fn pull_require_signed_or_default(&self) -> bool

Effective pull.require_signed (issue #692): true unless the user-scoped config explicitly disabled it. Empty (unset, the documented default) and any unrecognized value are treated as “verify” — only an explicit falsy spelling opts out, so a typo in the config file fails closed rather than silently disabling the check.

Source

pub fn transport_auth_envelope(&self) -> bool

true iff Self::transport_auth selects the Ed25519 write-envelope auth mode (case-insensitive "envelope"). Empty (the default) and any other value mean the unchanged bearer-token-only behavior.

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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