CLI app for developers prototyping atproto functionality
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove things from the library API that are not needed for tests

+31 -31
+1 -1
src/cli.rs
··· 16 16 about = "Diagnostics and conformance tooling for atproto services.", 17 17 long_about = None, 18 18 )] 19 - pub struct Cli { 19 + struct Cli { 20 20 /// Enable verbose (DEBUG-level) logging to stderr. 21 21 #[arg(long, global = true)] 22 22 verbose: bool,
+2 -2
src/commands.rs
··· 9 9 use self::test::TestCmd; 10 10 11 11 #[derive(Debug, Subcommand)] 12 - pub enum Command { 12 + pub(crate) enum Command { 13 13 /// Conformance and diagnostic checks against atproto services. 14 14 #[command(subcommand)] 15 15 Test(TestCmd), 16 16 } 17 17 18 18 impl Command { 19 - pub async fn run(self, no_color: bool) -> Result<ExitCode, Report> { 19 + pub(crate) async fn run(self, no_color: bool) -> Result<ExitCode, Report> { 20 20 match self { 21 21 Command::Test(cmd) => cmd.run(no_color).await, 22 22 }
+2 -2
src/commands/test.rs
··· 9 9 use self::labeler::LabelerCmd; 10 10 11 11 #[derive(Debug, Subcommand)] 12 - pub enum TestCmd { 12 + pub(crate) enum TestCmd { 13 13 /// Run the labeler conformance suite against an atproto labeler. 14 14 Labeler(LabelerCmd), 15 15 } 16 16 17 17 impl TestCmd { 18 - pub async fn run(self, no_color: bool) -> Result<ExitCode, Report> { 18 + pub(crate) async fn run(self, no_color: bool) -> Result<ExitCode, Report> { 19 19 match self { 20 20 TestCmd::Labeler(cmd) => cmd.run(no_color).await, 21 21 }
+13 -13
src/commands/test/labeler.rs
··· 29 29 30 30 /// Run the labeler conformance suite against a handle, DID, or endpoint URL. 31 31 #[derive(Debug, Args)] 32 - pub struct LabelerCmd { 32 + pub(crate) struct LabelerCmd { 33 33 /// Handle (`alice.example`), DID (`did:plc:...` / `did:web:...`), or labeler endpoint URL. 34 - pub target: String, 34 + target: String, 35 35 36 36 /// Explicit DID override. Required (and combined with the target URL) when 37 37 /// `target` is a raw endpoint URL and you want identity/crypto checks to run. 38 38 #[arg(long)] 39 - pub did: Option<String>, 39 + did: Option<String>, 40 40 41 41 /// Per-connection time budget for the subscription-layer checks. 42 42 /// ··· 46 46 default_value = "5s", 47 47 value_parser = parse_subscribe_timeout, 48 48 )] 49 - pub subscribe_timeout: Duration, 49 + subscribe_timeout: Duration, 50 50 51 51 /// Whether to suppress colored output. 52 52 #[arg(long)] 53 - pub no_color: bool, 53 + no_color: bool, 54 54 55 55 /// Whether to emit verbose diagnostics. 56 56 #[arg(long)] 57 - pub verbose: bool, 57 + verbose: bool, 58 58 59 59 /// Commit: opt in to actually POSTing report bodies to the labeler and 60 60 /// assert reporting conformance (missing `LabelerPolicies` becomes a 61 61 /// SpecViolation rather than a stage-skip). 62 62 #[arg(long)] 63 - pub commit_report: bool, 63 + commit_report: bool, 64 64 65 65 /// Force self-mint checks to run even when the labeler endpoint is 66 66 /// classified as non-local by the hostname heuristic. Use when 67 67 /// running against a LAN-reachable labeler that the heuristic misses. 68 68 #[arg(long)] 69 - pub force_self_mint: bool, 69 + force_self_mint: bool, 70 70 71 71 /// Curve to use for self-mint JWTs. 72 72 #[arg(long, value_enum, default_value_t = SelfMintCurve::default())] 73 - pub self_mint_curve: SelfMintCurve, 73 + self_mint_curve: SelfMintCurve, 74 74 75 75 /// Override the default computed subject DID for committing checks. 76 76 /// Passed through to `self_mint_accepted`, `pds_service_auth_accepted`, 77 77 /// and `pds_proxied_accepted` bodies. 78 78 #[arg(long)] 79 - pub report_subject_did: Option<String>, 79 + report_subject_did: Option<String>, 80 80 81 81 /// User handle for PDS-mediated report modes. Must be supplied together 82 82 /// with --app-password; enables `pds_service_auth_accepted` and 83 83 /// `pds_proxied_accepted` checks when combined with --commit-report. 84 84 #[arg(long, requires = "app_password")] 85 - pub handle: Option<String>, 85 + handle: Option<String>, 86 86 87 87 /// App password for PDS-mediated report modes. Must be supplied 88 88 /// together with --handle. 89 89 #[arg(long, requires = "handle")] 90 - pub app_password: Option<String>, 90 + app_password: Option<String>, 91 91 } 92 92 93 93 impl LabelerCmd { 94 - pub async fn run(self, no_color: bool) -> Result<ExitCode, Report> { 94 + pub(crate) async fn run(self, no_color: bool) -> Result<ExitCode, Report> { 95 95 // Parse the target. 96 96 let target = 97 97 target::parse(&self.target, self.did.as_deref()).map_err(|e| miette::miette!("{e}"))?;
+11 -11
src/commands/test/labeler/report.rs
··· 23 23 24 24 impl CheckStatus { 25 25 /// Plain-text glyph for this status. 26 - pub fn glyph(self) -> &'static str { 26 + fn glyph(self) -> &'static str { 27 27 match self { 28 28 CheckStatus::Pass => "[OK]", 29 29 CheckStatus::SpecViolation => "[FAIL]", ··· 43 43 /// reachability failures don't blur into spec warnings). 44 44 /// * `Advisory` — bold yellow. 45 45 /// * `Skipped` — dim. 46 - pub fn styled_glyph(self, no_color: bool) -> &'static str { 46 + fn styled_glyph(self, no_color: bool) -> &'static str { 47 47 if no_color { 48 48 return self.glyph(); 49 49 } ··· 97 97 98 98 impl Stage { 99 99 /// Human-readable heading for this stage. 100 - pub fn label(self) -> &'static str { 100 + fn label(self) -> &'static str { 101 101 match self { 102 102 Stage::Identity => "Identity", 103 103 Stage::Http => "HTTP", ··· 110 110 111 111 /// Summary counts of check results by severity. 112 112 #[derive(Debug, Clone, PartialEq, Eq)] 113 - pub struct SummaryCounts { 114 - pub pass: usize, 115 - pub spec_violation: usize, 116 - pub network_error: usize, 117 - pub advisory: usize, 118 - pub skipped: usize, 113 + struct SummaryCounts { 114 + pass: usize, 115 + spec_violation: usize, 116 + network_error: usize, 117 + advisory: usize, 118 + skipped: usize, 119 119 } 120 120 121 121 impl SummaryCounts { 122 122 /// Count results by severity. 123 - pub fn from_results(results: &[CheckResult]) -> Self { 123 + fn from_results(results: &[CheckResult]) -> Self { 124 124 let mut counts = SummaryCounts { 125 125 pass: 0, 126 126 spec_violation: 0, ··· 230 230 } 231 231 232 232 /// Get summary counts of all results. 233 - pub fn summary_counts(&self) -> SummaryCounts { 233 + fn summary_counts(&self) -> SummaryCounts { 234 234 SummaryCounts::from_results(&self.results) 235 235 } 236 236
+2 -2
src/common.rs
··· 1 1 //! Cross-feature primitives shared by every `atproto-devtool` subcommand. 2 2 3 - pub mod diagnostics; 3 + pub(crate) mod diagnostics; 4 4 pub mod identity; 5 - pub mod jwt; 5 + pub(crate) mod jwt; 6 6 7 7 pub(crate) static APP_USER_AGENT: &str = 8 8 concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"),);