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: StringHex-encoded Identity: [kind:u8][len:u16 LE][bytes]. Empty =
derive from the signing key’s public key at commit time.
user_name: StringGit-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: StringGit-compatibility alias user.email. Non-authoritative, exactly
like user_name — never feeds the signed author.
trusted_remote_endpoint: StringExact 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: StringWrite-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: StringCommit-signing selector. User-scoped only.
pull_require_signed: Stringpull.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: StringObject-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
impl Config
Sourcepub fn with_defaults() -> Self
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.
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.
Sourcepub fn object_sync_policy(&self) -> SyncPolicy
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.
Sourcepub fn pull_require_signed_or_default(&self) -> bool
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.
Sourcepub fn transport_auth_envelope(&self) -> bool
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§
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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<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<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§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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