proxybroker 0.4.1

Find, check, and serve public HTTP(S) and SOCKS4/5 proxies. Library + CLI.
Documentation
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
//! Per-protocol negotiation: turning a raw TCP connection to a proxy into a stream tunnelled
//! to a target (a judge), ready for an HTTP request.
//!
//! The set of protocols is closed (`NGTRS` is a fixed dict of six in `negotiators.py`), so
//! this dispatches on [`Proto`] rather than using trait objects — users extend *providers*,
//! never negotiators.
//!
//! - **HTTP** is a no-op: the request goes to the proxy with an absolute-form URI.
//! - **SOCKS4/5** go through `tokio-socks`, which takes our [`TcpStream`], performs the
//!   handshake, and hands the tunnelled stream back — composing exactly the way the Python
//!   negotiators compose, but with the byte-level protocol already tested upstream.
//! - **CONNECT:80/25** send a hand-rolled `CONNECT` and check the status (25 also reads the
//!   SMTP banner).
//! - **HTTPS** does `CONNECT` then upgrades the *same* connection to TLS in place — which is
//!   why the transport is an [`enum Stream`](Stream) swapped by value, not a `&mut`: a Rust
//!   TLS connector consumes the stream and returns a differently-typed one.

use crate::error::ProxyError;
use crate::proxy::Credentials;
use crate::types::Proto;
use crate::utils::{base64_encode, get_status_code};
use std::net::IpAddr;
use std::pin::Pin;
use std::sync::Arc;
use std::task::{Context, Poll};
use std::time::Duration;
use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt, ReadBuf};
use tokio::net::TcpStream;
use tokio_rustls::client::TlsStream;

/// SMTP "service ready" reply code — the banner a `CONNECT:25` tunnel must see.
const SMTP_READY: u16 = 220;

/// The target a negotiator tunnels to (a judge). `ip` is preferred where present (SOCKS4
/// requires it); `host` is the name used for TLS SNI and the `CONNECT` authority.
#[derive(Debug, Clone)]
pub struct Target {
    pub host: String,
    pub ip: Option<IpAddr>,
    pub port: u16,
}

/// A transport to a proxied target: either the plain TCP connection or that same connection
/// upgraded to TLS. Both variants are `Unpin`, so the `AsyncRead`/`AsyncWrite` impls are a
/// plain `match` — no pin-projection. The TLS variant is boxed because `TlsStream` is much
/// larger than `TcpStream` and every plain connection would otherwise pay that size.
pub enum Stream {
    Plain(TcpStream),
    Tls(Box<TlsStream<TcpStream>>),
}

impl std::fmt::Debug for Stream {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match self {
            Stream::Plain(_) => f.write_str("Stream::Plain"),
            Stream::Tls(_) => f.write_str("Stream::Tls"),
        }
    }
}

impl AsyncRead for Stream {
    fn poll_read(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>,
        buf: &mut ReadBuf<'_>,
    ) -> Poll<std::io::Result<()>> {
        match self.get_mut() {
            Stream::Plain(s) => Pin::new(s).poll_read(cx, buf),
            Stream::Tls(s) => Pin::new(s.as_mut()).poll_read(cx, buf),
        }
    }
}

impl AsyncWrite for Stream {
    fn poll_write(
        self: Pin<&mut Self>,
        cx: &mut Context<'_>,
        buf: &[u8],
    ) -> Poll<std::io::Result<usize>> {
        match self.get_mut() {
            Stream::Plain(s) => Pin::new(s).poll_write(cx, buf),
            Stream::Tls(s) => Pin::new(s.as_mut()).poll_write(cx, buf),
        }
    }
    fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<std::io::Result<()>> {
        match self.get_mut() {
            Stream::Plain(s) => Pin::new(s).poll_flush(cx),
            Stream::Tls(s) => Pin::new(s.as_mut()).poll_flush(cx),
        }
    }
    fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<std::io::Result<()>> {
        match self.get_mut() {
            Stream::Plain(s) => Pin::new(s).poll_shutdown(cx),
            Stream::Tls(s) => Pin::new(s.as_mut()).poll_shutdown(cx),
        }
    }
}

/// Negotiate `proto` over a freshly-connected `tcp` to reach `target`, returning a stream
/// ready for an HTTP request. `deadline` bounds each network step.
pub async fn negotiate(
    proto: Proto,
    tcp: TcpStream,
    target: &Target,
    deadline: Duration,
    creds: Option<&Credentials>,
) -> Result<Stream, ProxyError> {
    match proto {
        // HTTP: nothing to negotiate. The checker sends an absolute-URI request to the proxy.
        Proto::Http => Ok(Stream::Plain(tcp)),
        // SOCKS4 has no username/password auth (RFC), so credentials are ignored here.
        Proto::Socks4 => socks4(tcp, target, deadline).await,
        Proto::Socks5 => socks5(tcp, target, deadline, creds).await,
        Proto::Connect80 | Proto::Connect25 => {
            let mut tcp = http_connect(tcp, target, deadline, creds).await?;
            if proto == Proto::Connect25 {
                read_smtp_banner(&mut tcp, deadline).await?;
            }
            Ok(Stream::Plain(tcp))
        }
        Proto::Https => {
            let tcp = http_connect(tcp, target, deadline, creds).await?;
            tls_upgrade(tcp, &target.host, deadline).await
        }
    }
}

/// Pick a protocol whose negotiation yields an **opaque byte tunnel** for `proxy` — the stream a
/// caller needs when it will run its own end-to-end TLS over the result. `None` if the proxy offers
/// none. Preference order matches [`negotiate`]'s cheapest-handshake-first ordering.
///
/// [`Proto::Https`] is deliberately never returned. [`negotiate`] implements it as `CONNECT` *plus a
/// TLS upgrade of its own*, verified by the checker's liveness-only [`AcceptAllVerifier`]. That is
/// right for probing whether a proxy can reach an HTTPS target and wrong for real client traffic
/// twice over: the caller's own `ClientHello` would be swallowed as application data inside our
/// session, and nobody would have checked the target's certificate. [`Proto::Connect25`] is
/// excluded for a duller reason — it reads an SMTP banner off the tunnel before yielding it.
///
/// Both tunnel consumers share this: the local server's CONNECT/SOCKS5 relay and the rotating
/// connector. Keeping one picker is what stops the two from drifting apart again.
#[cfg(any(feature = "server", feature = "connector"))] // its only two consumers
use crate::proxy::Proxy;

#[cfg(any(feature = "server", feature = "connector"))]
pub(crate) fn tunnel_proto(proxy: &Proxy) -> Option<Proto> {
    [Proto::Socks5, Proto::Socks4, Proto::Connect80]
        .into_iter()
        .find(|p| proxy.types().contains_key(p))
        // An `Https`-typed proxy has *proved* it speaks CONNECT: the checker only stamps that type
        // after `negotiate` completed a `CONNECT` and then a TLS upgrade over it. So the capability
        // is there even when `Connect80` was never separately checked — offer the tunnel half of it
        // and drop the TLS half. Discarding such a proxy would throw away a usable, proven tunnel.
        .or_else(|| {
            proxy
                .types()
                .contains_key(&Proto::Https)
                .then_some(Proto::Connect80)
        })
}

/// Lightweight liveness/reachability probe for the pool's verify-on-lease gate: dial `proxy` and
/// open a `CONNECT` tunnel to `target` (no TLS, no request), returning `true` iff the tunnel
/// establishes. Catches proxies that died since admission — the dominant "dead-by-lease" failure
/// for ephemeral (free) pools, where a proxy validated at admission is often dead seconds later.
/// The tunnel is dropped immediately. `timeout` bounds both the dial and the CONNECT.
#[cfg(feature = "server")] // only the pool's verify-on-lease gate uses it
pub(crate) async fn probe_tunnel(
    proxy_host: IpAddr,
    proxy_port: u16,
    target: &Target,
    timeout: Duration,
    creds: Option<&Credentials>,
) -> bool {
    let Ok(Ok(tcp)) =
        tokio::time::timeout(timeout, TcpStream::connect((proxy_host, proxy_port))).await
    else {
        return false;
    };
    negotiate(Proto::Connect80, tcp, target, timeout, creds)
        .await
        .is_ok()
}

async fn socks4(tcp: TcpStream, target: &Target, deadline: Duration) -> Result<Stream, ProxyError> {
    // SOCKS4 has no domain support; it needs an IPv4 destination.
    let ip = match target.ip {
        Some(IpAddr::V4(v4)) => v4,
        _ => return Err(ProxyError::BadResponse),
    };
    let fut = tokio_socks::tcp::Socks4Stream::connect_with_socket(tcp, (ip, target.port));
    let s = tokio::time::timeout(deadline, fut)
        .await
        .map_err(|_| ProxyError::Timeout)?
        .map_err(map_socks_err)?;
    Ok(Stream::Plain(s.into_inner()))
}

async fn socks5(
    tcp: TcpStream,
    target: &Target,
    deadline: Duration,
    creds: Option<&Credentials>,
) -> Result<Stream, ProxyError> {
    use tokio_socks::tcp::Socks5Stream;
    // SOCKS5 supports IPv4/IPv6/domain; prefer the resolved IP, fall back to the name. With creds,
    // do the RFC 1929 username/password exchange (`connect_with_password_*`).
    let fut = async {
        match (target.ip, creds) {
            (Some(ip), None) => Socks5Stream::connect_with_socket(tcp, (ip, target.port)).await,
            (None, None) => {
                Socks5Stream::connect_with_socket(tcp, (target.host.as_str(), target.port)).await
            }
            (Some(ip), Some(c)) => {
                Socks5Stream::connect_with_password_and_socket(
                    tcp,
                    (ip, target.port),
                    &c.username,
                    &c.password,
                )
                .await
            }
            (None, Some(c)) => {
                Socks5Stream::connect_with_password_and_socket(
                    tcp,
                    (target.host.as_str(), target.port),
                    &c.username,
                    &c.password,
                )
                .await
            }
        }
    };
    let s = tokio::time::timeout(deadline, fut)
        .await
        .map_err(|_| ProxyError::Timeout)?
        .map_err(map_socks_err)?;
    Ok(Stream::Plain(s.into_inner()))
}

/// Send a `CONNECT` and require a 200. Returns the tunnelled TCP stream.
async fn http_connect(
    mut tcp: TcpStream,
    target: &Target,
    deadline: Duration,
    creds: Option<&Credentials>,
) -> Result<TcpStream, ProxyError> {
    let req = connect_request(&target.host, target.port, creds);
    tokio::time::timeout(deadline, tcp.write_all(&req))
        .await
        .map_err(|_| ProxyError::Timeout)?
        .map_err(|_| ProxyError::Reset)?;
    let head = read_head(&mut tcp, deadline).await?;
    // Status is in "HTTP/1.1 200 ...": bytes 9..12. get_status_code returns 400 on garbage.
    if get_status_code(&head, 9, 12) != 200 {
        return Err(ProxyError::BadStatus);
    }
    Ok(tcp)
}

/// Read up to the end of the HTTP head (`\r\n\r\n`). A hand-rolled byte loop rather than a
/// `BufReader`: buffering would swallow bytes past the header that belong to the tunnel.
async fn read_head(tcp: &mut TcpStream, deadline: Duration) -> Result<Vec<u8>, ProxyError> {
    let mut buf = Vec::with_capacity(256);
    let mut byte = [0u8; 1];
    let read = async {
        loop {
            let n = tcp.read(&mut byte).await.map_err(|_| ProxyError::Reset)?;
            if n == 0 {
                return if buf.is_empty() {
                    Err(ProxyError::EmptyRecv)
                } else {
                    Err(ProxyError::Reset)
                };
            }
            buf.push(byte[0]);
            if buf.ends_with(b"\r\n\r\n") {
                return Ok(buf);
            }
            if buf.len() > 8192 {
                return Err(ProxyError::BadResponse); // runaway head
            }
        }
    };
    tokio::time::timeout(deadline, read)
        .await
        .map_err(|_| ProxyError::Timeout)?
}

/// After a `CONNECT:25` tunnel, the SMTP server sends a `220` banner. `negotiators.py` reads
/// three bytes and checks for `220`.
async fn read_smtp_banner(tcp: &mut TcpStream, deadline: Duration) -> Result<(), ProxyError> {
    let mut buf = [0u8; 3];
    tokio::time::timeout(deadline, tcp.read_exact(&mut buf))
        .await
        .map_err(|_| ProxyError::Timeout)?
        .map_err(|_| ProxyError::Reset)?;
    if get_status_code(&buf, 0, 3) != SMTP_READY {
        return Err(ProxyError::BadStatus);
    }
    Ok(())
}

async fn tls_upgrade(tcp: TcpStream, host: &str, deadline: Duration) -> Result<Stream, ProxyError> {
    let connector = tokio_rustls::TlsConnector::from(tls_config());
    // Proxies connect to whatever server they front — often expired/self-signed/mismatched
    // certs — so the verifier accepts everything. Named and isolated, as in proxy.py's
    // `_make_unverified_ssl_context_for_proxy_testing`.
    let server_name = rustls::pki_types::ServerName::try_from(host.to_owned())
        .map_err(|_| ProxyError::BadResponse)?;
    let fut = connector.connect(server_name, tcp);
    let tls = tokio::time::timeout(deadline, fut)
        .await
        .map_err(|_| ProxyError::Timeout)?
        .map_err(|_| ProxyError::BadResponse)?;
    Ok(Stream::Tls(Box::new(tls)))
}

fn tls_config() -> Arc<rustls::ClientConfig> {
    let cfg = rustls::ClientConfig::builder()
        .dangerous()
        .with_custom_certificate_verifier(Arc::new(AcceptAllVerifier))
        .with_no_client_auth();
    Arc::new(cfg)
}

/// The bytes of a `CONNECT host:port HTTP/1.1` request, with IPv6 authority/Host bracketing
/// per RFC 3986. Mirrors `negotiators.py:_CONNECT_request`, including not double-bracketing a
/// caller-supplied `[v6]`. Pinned by the byte-level tests below.
pub fn connect_request(host: &str, port: u16, creds: Option<&Credentials>) -> Vec<u8> {
    let bare = host
        .strip_prefix('[')
        .and_then(|h| h.strip_suffix(']'))
        .unwrap_or(host);
    let (authority, host_hdr) = if bare.contains(':') {
        (format!("[{bare}]:{port}"), format!("[{bare}]"))
    } else {
        (format!("{bare}:{port}"), bare.to_owned())
    };
    // Upstream Proxy-Authorization (B8), only when the proxy carries credentials.
    let auth = match creds {
        Some(c) => format!(
            "Proxy-Authorization: Basic {}\r\n",
            base64_encode(format!("{}:{}", c.username, c.password).as_bytes())
        ),
        None => String::new(),
    };
    format!(
        "CONNECT {authority} HTTP/1.1\r\nHost: {host_hdr}\r\n\
         User-Agent: PxBroker/{}/\r\n{auth}Connection: keep-alive\r\n\r\n",
        env!("CARGO_PKG_VERSION"),
    )
    .into_bytes()
}

/// Map a `tokio-socks` error to the per-proxy error bucket. The library's rich reply-code
/// enum collapses to the Python-compatible buckets: a timeout stays a timeout, everything
/// else is a bad response (Python raised `BadResponseError` for all SOCKS failures).
fn map_socks_err(e: tokio_socks::Error) -> ProxyError {
    match e {
        tokio_socks::Error::Io(io) if io.kind() == std::io::ErrorKind::TimedOut => {
            ProxyError::Timeout
        }
        _ => ProxyError::BadResponse,
    }
}

/// A `rustls` verifier that accepts any certificate. Isolated and named so the unsafe choice
/// is auditable in one place. Correct for proxy testing: the endpoint is whatever server the
/// proxy fronts, and its certificate is not something we can or should validate.
#[derive(Debug)]
struct AcceptAllVerifier;

impl rustls::client::danger::ServerCertVerifier for AcceptAllVerifier {
    fn verify_server_cert(
        &self,
        _end_entity: &rustls::pki_types::CertificateDer<'_>,
        _intermediates: &[rustls::pki_types::CertificateDer<'_>],
        _server_name: &rustls::pki_types::ServerName<'_>,
        _ocsp: &[u8],
        _now: rustls::pki_types::UnixTime,
    ) -> Result<rustls::client::danger::ServerCertVerified, rustls::Error> {
        Ok(rustls::client::danger::ServerCertVerified::assertion())
    }
    fn verify_tls12_signature(
        &self,
        _message: &[u8],
        _cert: &rustls::pki_types::CertificateDer<'_>,
        _dss: &rustls::DigitallySignedStruct,
    ) -> Result<rustls::client::danger::HandshakeSignatureValid, rustls::Error> {
        Ok(rustls::client::danger::HandshakeSignatureValid::assertion())
    }
    fn verify_tls13_signature(
        &self,
        _message: &[u8],
        _cert: &rustls::pki_types::CertificateDer<'_>,
        _dss: &rustls::DigitallySignedStruct,
    ) -> Result<rustls::client::danger::HandshakeSignatureValid, rustls::Error> {
        Ok(rustls::client::danger::HandshakeSignatureValid::assertion())
    }
    fn supported_verify_schemes(&self) -> Vec<rustls::SignatureScheme> {
        rustls::crypto::ring::default_provider()
            .signature_verification_algorithms
            .supported_schemes()
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[cfg(any(feature = "server", feature = "connector"))]
    fn typed(types: &[Proto]) -> Proxy {
        let mut p = Proxy::new(
            "1.1.1.1".parse().unwrap(),
            80,
            std::collections::BTreeSet::new(),
        );
        for t in types {
            p.add_type(*t, None);
        }
        p
    }

    /// The invariant the whole picker exists for: whatever the proxy offers, the result never
    /// terminates TLS to the target.
    #[test]
    #[cfg(any(feature = "server", feature = "connector"))]
    fn tunnel_proto_never_yields_a_tls_terminating_proto() {
        for types in [
            vec![Proto::Https],
            vec![Proto::Https, Proto::Socks5],
            vec![Proto::Https, Proto::Connect80],
            vec![Proto::Connect25],
            vec![Proto::Http],
            vec![],
        ] {
            let got = tunnel_proto(&typed(&types));
            assert_ne!(got, Some(Proto::Https), "types {types:?}");
            assert_ne!(got, Some(Proto::Connect25), "types {types:?}");
        }
    }

    #[test]
    #[cfg(any(feature = "server", feature = "connector"))]
    fn tunnel_proto_prefers_cheapest_handshake_first() {
        assert_eq!(
            tunnel_proto(&typed(&[Proto::Socks5, Proto::Socks4, Proto::Connect80])),
            Some(Proto::Socks5)
        );
        assert_eq!(
            tunnel_proto(&typed(&[Proto::Socks4, Proto::Connect80])),
            Some(Proto::Socks4)
        );
    }

    /// An `Https`-typed proxy proved its CONNECT works during checking, so it is usable as a raw
    /// tunnel rather than discarded.
    #[test]
    #[cfg(any(feature = "server", feature = "connector"))]
    fn tunnel_proto_reuses_a_proven_connect_from_an_https_type() {
        assert_eq!(
            tunnel_proto(&typed(&[Proto::Https])),
            Some(Proto::Connect80)
        );
    }

    /// No tunnel capability at all — a forward-HTTP-only proxy is not a tunnel and must not be
    /// dressed up as one.
    #[test]
    #[cfg(any(feature = "server", feature = "connector"))]
    fn tunnel_proto_is_none_without_any_tunnel_capability() {
        assert_eq!(tunnel_proto(&typed(&[Proto::Http])), None);
        assert_eq!(tunnel_proto(&typed(&[])), None);
    }

    #[test]
    fn connect_request_ipv4_unbracketed() {
        let req = String::from_utf8(connect_request("198.51.100.1", 443, None)).unwrap();
        assert!(
            req.starts_with("CONNECT 198.51.100.1:443 HTTP/1.1\r\n"),
            "{req}"
        );
        assert!(req.contains("\r\nHost: 198.51.100.1\r\n"), "{req}");
    }

    #[test]
    fn connect_request_ipv6_brackets_authority_and_host() {
        let req = String::from_utf8(connect_request("2001:db8::1", 443, None)).unwrap();
        assert!(
            req.starts_with("CONNECT [2001:db8::1]:443 HTTP/1.1\r\n"),
            "{req}"
        );
        assert!(req.contains("\r\nHost: [2001:db8::1]\r\n"), "{req}");
    }

    #[test]
    fn connect_request_does_not_double_bracket() {
        let req = String::from_utf8(connect_request("[2001:db8::1]", 443, None)).unwrap();
        assert!(
            req.contains("CONNECT [2001:db8::1]:443 HTTP/1.1\r\n"),
            "{req}"
        );
        assert!(!req.contains("[["), "{req}");
        assert!(!req.contains("]]"), "{req}");
        assert!(req.contains("\r\nHost: [2001:db8::1]\r\n"), "{req}");
    }

    #[test]
    fn connect_request_ports_25_80_443() {
        for port in [25u16, 80, 443] {
            let req = String::from_utf8(connect_request("fe80::abcd", port, None)).unwrap();
            assert!(
                req.contains(&format!("CONNECT [fe80::abcd]:{port} HTTP/1.1\r\n")),
                "{req}"
            );
        }
    }

    #[test]
    fn connect_request_includes_proxy_authorization() {
        // With creds, a `Proxy-Authorization: Basic base64(user:pass)` header is present; without,
        // it is absent (byte-identical to before B8).
        let creds = Credentials {
            username: "user".into(),
            password: "pass".into(),
        };
        let with = String::from_utf8(connect_request("h", 443, Some(&creds))).unwrap();
        assert!(
            with.contains("\r\nProxy-Authorization: Basic dXNlcjpwYXNz\r\n"),
            "{with}"
        );
        let without = String::from_utf8(connect_request("h", 443, None)).unwrap();
        assert!(!without.contains("Proxy-Authorization"), "{without}");
    }
}