1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//! The receive side of a push: the policy and the sessions of a server.
//!
//! This module needs the `receive` feature. These are its entry items:
//!
//! - [`ReceivePolicy`] states what a push session of one client group can
//! read and change, and how the server verifies and signs its commits.
//! [`ReceivePolicies::from_config`] builds the policy of each client group
//! of the repository config. [`TrustedKeys`] holds the keys that a policy
//! verifies a commit against.
//! - [`Repo::receive`](crate::Repo::receive) runs one push session over a
//! pair of streams. Its doc lists the checks of `Commit` in order.
//! - [`ReceiveService`] runs a push session as steps, one step for each
//! request of a transport such as HTTP. [`ReceiveService::commit`] states
//! the condition of each wire code of `Commit`.
//! - [`ReceiveHooks`] are the calls of the host that run before and after the
//! ref update of a session.
//! - [`Repo::receive_stream`](crate::Repo::receive_stream) reads one one-way
//! stream: the messages of a session in one direction, with no reply.
//! [`Repo::receive_stream_to_commit`](crate::Repo::receive_stream_to_commit)
//! reads it and stops at `Commit`, for a channel with no end of input. A
//! [`StreamPolicy`] states what the stream accepts.
//! - [`ClientAccess`] reads the client groups and the server settings. The
//! module re-exports it and the other types of [`access`](crate::access).
mod ancestry;
mod core;
mod finish;
mod hooks;
mod ingest;
mod merge;
mod pattern;
mod policy;
mod reader;
mod server_commit;
mod service;
mod session;
mod signer;
mod stream;
mod stream_policy;
mod trust;
mod walk;
pub use crate::access::{
AccessModes, AccessRules, AllowItem, AuthItem, ClientAccess, ClientGroup, IpNet, Namespace,
NamespaceRules, ServerSettings,
};
pub use crate::verify::TrustedKeys;
pub use hooks::{
HookFuture, HookRefusal, HostEntry, ReceiveHooks, ReceiveRefUpdate, ReceiveServerCommit,
UpdatePlan,
};
pub use pattern::ReceivePattern;
pub use policy::{ReceivePolicies, ReceivePolicy, ReceiveVerify};
pub use service::ReceiveService;
pub use session::{ReceiveCommit, ReceiveRefOutcome, ReceiveReport, ReceiveStep, ReceiveWarning};
pub use signer::ServerSigner;
pub use stream_policy::{StreamPolicy, StreamRule};
pub(crate) use merge::merge_detached;
/// The receive types move freely across tasks and threads, so one policy can
/// serve every session of a server.
const _: fn() = || {
fn assert_send_sync<T: Send + Sync>() {}
assert_send_sync::<ReceivePolicy>();
assert_send_sync::<ReceivePolicies>();
assert_send_sync::<ReceiveVerify>();
assert_send_sync::<StreamPolicy>();
assert_send_sync::<StreamRule>();
assert_send_sync::<ReceivePattern>();
assert_send_sync::<TrustedKeys>();
assert_send_sync::<ServerSigner>();
assert_send_sync::<ReceiveReport>();
assert_send_sync::<ReceiveWarning>();
assert_send_sync::<ReceiveService>();
assert_send_sync::<HostEntry>();
assert_send_sync::<HookRefusal>();
fn assert_send<T: Send>() {}
assert_send::<UpdatePlan>();
};