CLI app for developers prototyping atproto functionality
1
fork

Configure Feed

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

feat(labeler): add --handle and --app-password with clap requires

Add symmetric clap requires constraint: --handle and --app-password must
be supplied together. AC8.1 tests verify parse failure when only one flag
is supplied. Implementation enables PDS-mediated report modes (modes 2 and 3)
when combined with --commit-report.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

authored by

Jack Grigg
Claude Haiku 4.5
and committed by
Tangled
fdb731e8 581d1190

+56
+11
src/commands/test/labeler.rs
··· 74 74 /// and `pds_proxied_accepted` bodies. 75 75 #[arg(long)] 76 76 pub report_subject_did: Option<String>, 77 + 78 + /// User handle for PDS-mediated report modes. Must be supplied together 79 + /// with --app-password; enables `pds_service_auth_accepted` and 80 + /// `pds_proxied_accepted` checks when combined with --commit-report. 81 + #[arg(long, requires = "app_password")] 82 + pub handle: Option<String>, 83 + 84 + /// App password for PDS-mediated report modes. Must be supplied 85 + /// together with --handle. 86 + #[arg(long, requires = "handle")] 87 + pub app_password: Option<String>, 77 88 } 78 89 79 90 impl LabelerCmd {
+45
tests/labeler_cli.rs
··· 98 98 "Stderr should contain DEBUG tracing output with --verbose, got:\n{stderr}", 99 99 ); 100 100 } 101 + 102 + /// AC8.1: `--handle` without `--app-password` produces a parse error. 103 + #[test] 104 + fn ac8_1_handle_without_app_password_fails() { 105 + let output = Command::cargo_bin("atproto-devtool") 106 + .expect("bin") 107 + .args([ 108 + "test", 109 + "labeler", 110 + "alice.bsky.social", 111 + "--handle", 112 + "alice.bsky.social", 113 + ]) 114 + .output() 115 + .expect("run"); 116 + assert!( 117 + !output.status.success(), 118 + "expected parse failure when --handle supplied without --app-password" 119 + ); 120 + let stderr = String::from_utf8_lossy(&output.stderr); 121 + assert!( 122 + stderr.contains("--app-password") || stderr.contains("app_password"), 123 + "stderr should mention missing --app-password, got: {stderr}" 124 + ); 125 + } 126 + 127 + /// AC8.1: `--app-password` without `--handle` produces a parse error. 128 + #[test] 129 + fn ac8_1_app_password_without_handle_fails() { 130 + let output = Command::cargo_bin("atproto-devtool") 131 + .expect("bin") 132 + .args([ 133 + "test", 134 + "labeler", 135 + "alice.bsky.social", 136 + "--app-password", 137 + "xxxx-xxxx-xxxx-xxxx", 138 + ]) 139 + .output() 140 + .expect("run"); 141 + assert!( 142 + !output.status.success(), 143 + "expected parse failure when --app-password supplied without --handle" 144 + ); 145 + }