axiam-sdk 1.2.2

Official Rust client SDK for AXIAM IAM
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
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
//! UMA 2.0 — Protection API and ticket grant. CONTRACT.md §20 (contract 1.10).
//!
//! The **resource-server** side of User-Managed Access: register the resources
//! you guard, ask AXIAM what a caller would need, and exchange the resulting
//! permission ticket for a Requesting Party Token.
//!
//! # The rule this module exists to not paper over
//!
//! **A permission ticket is single-use and is not retryable** (§20.2 rule 6).
//! Every other refusal in this SDK can be re-sent once the caller fixes
//! something; this one cannot. The ticket is consumed *before* the request is
//! evaluated, so a failed exchange has already spent it.
//!
//! That alone would make retrying useless. What makes it unsafe is that
//! single-use is a property of the *server's deployment* rather than of the
//! protocol (ilpanich/axiam#302): the server decides the race with a
//! transaction its storage engine must arbitrate, plus a redemption nonce read
//! back after that transaction commits. That holds on a persistent engine —
//! but this SDK is talking to a server it did not deploy and **cannot attest**,
//! and against one running an in-memory datastore the guarantee does not hold,
//! so a client that retries is deliberately generating a concurrent redemption
//! such a server can admit twice.
//! [`AxiamClient::uma_exchange_ticket`] therefore issues **exactly one** request
//! and is excluded from the §16 retry runner, on every failure class including
//! timeout and `5xx`.
//!
//! # What a PAT is
//!
//! A Protection API Token is an ordinary client-credentials access token that
//! carries the `uma_protection` scope. It is passed **explicitly** to every
//! Protection API method rather than taken from the client's own session: the
//! client's session is frequently a *user* session, and §20.2 rule 1 forbids
//! silently offering one as a PAT — a ticket is bound to the `client_id` that
//! minted it, and a user token names no client to bind to.

use serde::{Deserialize, Serialize};
use uuid::Uuid;

use crate::client::AxiamClient;
use crate::error::AxiamError;
use crate::oidc::discovery::OidcConfiguration;
use crate::oidc::exchange::oauth2_error_or_fallback;
use crate::rest::auth::CsrfHeaderExt;
use crate::sensitive::Sensitive;

/// `grant_type` of the UMA ticket grant (UMA 2.0 §3.3.1).
pub const UMA_TICKET_GRANT_TYPE: &str = "urn:ietf:params:oauth:grant-type:uma-ticket";

/// The scope that makes an access token a Protection API Token.
pub const UMA_PROTECTION_SCOPE: &str = "uma_protection";

/// The only `claim_token_format` AXIAM v1 accepts.
pub const UMA_CLAIM_TOKEN_FORMAT: &str = "urn:ietf:params:oauth:token-type:access_token";

// ---------------------------------------------------------------------------
// Resource registration (FedAuthz §2.2)
// ---------------------------------------------------------------------------

/// A UMA resource set — an AXIAM resource seen through the Protection API.
///
/// `id` is **the AXIAM resource id**, not a parallel identifier: the same UUID
/// works as the `resource_id` of a later [`RequestedPermission`], and as the
/// resource id anywhere else in this SDK.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ResourceSet {
    /// Assigned by the server on registration; absent on the way out.
    #[serde(rename = "_id", default, skip_serializing_if = "Option::is_none")]
    pub id: Option<Uuid>,
    /// Human-readable name, shown in the admin UI.
    pub name: String,
    /// Free-form resource type. Defaults server-side to `uma_resource` when
    /// empty, so a resource server that omits it does not produce a row that
    /// sorts oddly next to hand-made ones.
    #[serde(rename = "type", default, skip_serializing_if = "String::is_empty")]
    pub resource_type: String,
    /// The scope names a resource server may ask for on this resource.
    ///
    /// **Replaced wholesale by an update, never merged** (§20.2 rule 8). This
    /// SDK does not read the current scopes and fold them into an update
    /// payload as a convenience, because that would make removing a scope
    /// impossible through the SDK.
    #[serde(default)]
    pub resource_scopes: Vec<String>,
}

impl ResourceSet {
    /// A registration payload. `type` and scopes default to empty.
    pub fn new(name: impl Into<String>) -> Self {
        Self {
            id: None,
            name: name.into(),
            resource_type: String::new(),
            resource_scopes: Vec::new(),
        }
    }

    /// Set the resource type.
    pub fn with_type(mut self, resource_type: impl Into<String>) -> Self {
        self.resource_type = resource_type.into();
        self
    }

    /// Set the complete declared scope set. On an update this **replaces**
    /// whatever the server holds (§20.2 rule 8).
    pub fn with_scopes<I, S>(mut self, scopes: I) -> Self
    where
        I: IntoIterator<Item = S>,
        S: Into<String>,
    {
        self.resource_scopes = scopes.into_iter().map(Into::into).collect();
        self
    }
}

// ---------------------------------------------------------------------------
// Permission tickets
// ---------------------------------------------------------------------------

/// One `(resource, scopes)` pair a resource server requires.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct RequestedPermission {
    /// The AXIAM resource id — the same UUID the Protection API returned as
    /// `_id`.
    pub resource_id: Uuid,
    /// Scope names, each of which the resource must already declare. Matched
    /// exactly: no prefix or wildcard semantics in either direction.
    pub resource_scopes: Vec<String>,
}

impl RequestedPermission {
    /// One pair: a resource and the scopes required on it.
    pub fn new<I, S>(resource_id: Uuid, scopes: I) -> Self
    where
        I: IntoIterator<Item = S>,
        S: Into<String>,
    {
        Self {
            resource_id,
            resource_scopes: scopes.into_iter().map(Into::into).collect(),
        }
    }
}

/// Not `Debug`: it holds the ticket until it is wrapped (§7 rule 1).
#[derive(Deserialize)]
struct TicketResponseWire {
    ticket: String,
}

/// One entry of an RPT's `permissions` claim.
///
/// **A record of a decision already made, not a live authorization answer**
/// (§20.2 rule 7). These are the pairs the engine allowed when the RPT was
/// minted; a grant revoked afterwards does not empty a live RPT. Do not cache
/// them beyond the token's own expiry — which is why that expiry is short.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct RptPermission {
    /// The resource the engine allowed.
    pub resource_id: Uuid,
    /// The scopes it allowed on that resource.
    pub resource_scopes: Vec<String>,
    /// Absolute expiry, seconds since the epoch.
    pub exp: i64,
}

/// Not `Debug`: it holds the RPT until it is wrapped (§7 rule 1).
#[derive(Deserialize)]
struct RptResponseWire {
    access_token: String,
    token_type: String,
    expires_in: u64,
}

/// A Requesting Party Token.
///
/// **There is no `refresh_token` field, and that is deliberate** (§20.2
/// rule 5). The grant issues none, so an RPT cannot outlive the ticket that
/// authorised it; an application that wants a fresh one re-runs the grant. This
/// result never enters the §9 single-flight refresh guard — there is nothing
/// for it to refresh.
#[derive(Debug, Clone)]
pub struct RequestingPartyToken {
    /// The RPT itself (§20.6 secret).
    pub access_token: Sensitive<String>,
    /// Always `Bearer`.
    pub token_type: String,
    /// `min(claim_token remaining, server ceiling, 300 s)`.
    pub expires_in: u64,
}

// ---------------------------------------------------------------------------
// The WWW-Authenticate: UMA challenge (§20.3)
// ---------------------------------------------------------------------------

/// A parsed `WWW-Authenticate: UMA` challenge (UMA 2.0 §3.2).
///
/// Deliberately not `PartialEq`: the ticket is a `Sensitive<String>`, and
/// comparing two challenges would mean comparing two live credentials — a
/// timing-unsafe operation this type has no reason to offer.
#[derive(Debug, Clone)]
pub struct UmaChallenge {
    /// The protection realm the resource server named.
    pub realm: Option<String>,
    /// The authorization server the resource server nominates.
    ///
    /// **Not automatically trusted.** See [`uma_parse_challenge`].
    pub as_uri: Option<String>,
    /// The ticket to exchange — a bearer credential for its 60-second life.
    pub ticket: Option<Sensitive<String>>,
}

/// Parse a `WWW-Authenticate: UMA …` header value (§20.3).
///
/// # This deliberately does not exchange the ticket
///
/// Parsing a challenge and acting on it are separate decisions. The `as_uri`
/// names an authorization server this client has not necessarily chosen to
/// trust, and auto-exchanging would send the requesting party's `claim_token`
/// to whatever host answered the 403. The caller decides.
///
/// Returns `None` when the header is not a UMA challenge.
pub fn uma_parse_challenge(header: &str) -> Option<UmaChallenge> {
    let rest = header.trim().strip_prefix("UMA")?;
    // "UMA" alone is a valid, if useless, challenge; anything else must be
    // separated by whitespace so `UMAX realm="…"` is not read as UMA.
    if !rest.is_empty() && !rest.starts_with(char::is_whitespace) {
        return None;
    }

    let mut challenge = UmaChallenge {
        realm: None,
        as_uri: None,
        ticket: None,
    };

    for part in rest.split(',') {
        let Some((key, value)) = part.split_once('=') else {
            continue;
        };
        let value = value.trim().trim_matches('"').to_string();
        match key.trim() {
            "realm" => challenge.realm = Some(value),
            "as_uri" => challenge.as_uri = Some(value),
            "ticket" => challenge.ticket = Some(Sensitive::new(value)),
            _ => {}
        }
    }

    Some(challenge)
}

/// Format a `WWW-Authenticate: UMA` header value (§20.3, emit half).
///
/// The resource-server side: having obtained a ticket from
/// [`AxiamClient::uma_request_ticket`], tell the caller where to redeem it.
pub fn uma_challenge_header(realm: &str, as_uri: &str, ticket: &Sensitive<String>) -> String {
    format!(
        "UMA realm=\"{realm}\", as_uri=\"{as_uri}\", ticket=\"{}\"",
        ticket.expose()
    )
}

// ---------------------------------------------------------------------------
// Client methods
// ---------------------------------------------------------------------------

#[derive(Serialize)]
struct UmaTicketForm<'a> {
    grant_type: &'a str,
    ticket: &'a str,
    claim_token: &'a str,
    claim_token_format: &'a str,
    client_id: &'a str,
    client_secret: &'a str,
}

impl AxiamClient {
    /// `POST /uma2/rreg/resource_set` — register a resource set (§20.1).
    ///
    /// Returns the set with its server-assigned `_id`, which **is** the AXIAM
    /// resource id.
    pub async fn uma_register_resource(
        &self,
        pat: &Sensitive<String>,
        resource: &ResourceSet,
    ) -> Result<ResourceSet, AxiamError> {
        self.uma_protection_json("POST", "/uma2/rreg/resource_set", pat, Some(resource))
            .await
    }

    /// `GET /uma2/rreg/resource_set/{id}` — read a resource set (§20.1).
    pub async fn uma_read_resource(
        &self,
        pat: &Sensitive<String>,
        id: Uuid,
    ) -> Result<ResourceSet, AxiamError> {
        let path = format!("/uma2/rreg/resource_set/{id}");
        self.uma_protection_json::<ResourceSet, ResourceSet>("GET", &path, pat, None)
            .await
    }

    /// `PUT /uma2/rreg/resource_set/{id}` — replace a resource set (§20.1).
    ///
    /// **The scope list is replaced, not merged** (§20.2 rule 8). Whatever
    /// `resource.resource_scopes` contains becomes the resource's complete
    /// declared set; omitting a scope removes it, which is how a resource
    /// server drops an authority.
    pub async fn uma_update_resource(
        &self,
        pat: &Sensitive<String>,
        id: Uuid,
        resource: &ResourceSet,
    ) -> Result<ResourceSet, AxiamError> {
        let path = format!("/uma2/rreg/resource_set/{id}");
        self.uma_protection_json("PUT", &path, pat, Some(resource))
            .await
    }

    /// `DELETE /uma2/rreg/resource_set/{id}` — deregister (§20.1).
    pub async fn uma_delete_resource(
        &self,
        pat: &Sensitive<String>,
        id: Uuid,
    ) -> Result<(), AxiamError> {
        let path = format!("/uma2/rreg/resource_set/{id}");
        let response = self
            .uma_protection_request("DELETE", &path, pat, None::<&()>)
            .await?;
        if !response.status().is_success() {
            return Err(oauth2_error_or_fallback(response).await);
        }
        Ok(())
    }

    /// `GET /uma2/rreg/resource_set` — list the ids **this client** registered
    /// (§20.1).
    ///
    /// Not the tenant's whole resource tree: a protection scope does not
    /// entitle a caller to enumerate it.
    pub async fn uma_list_resources(
        &self,
        pat: &Sensitive<String>,
    ) -> Result<Vec<Uuid>, AxiamError> {
        self.uma_protection_json::<Vec<Uuid>, ()>("GET", "/uma2/rreg/resource_set", pat, None)
            .await
    }

    /// `POST /uma2/perm` — mint a permission ticket (§20.1).
    ///
    /// Scope names are validated **here**, against each resource's declared
    /// set. Asking for an undeclared scope is a `400`, not a denial — the two
    /// are different failures and this SDK surfaces the distinction the server
    /// draws rather than flattening it.
    pub async fn uma_request_ticket(
        &self,
        pat: &Sensitive<String>,
        permissions: &[RequestedPermission],
    ) -> Result<Sensitive<String>, AxiamError> {
        let wire: TicketResponseWire = self
            .uma_protection_json("POST", "/uma2/perm", pat, Some(permissions))
            .await?;
        Ok(Sensitive::new(wire.ticket))
    }

    /// `POST /oauth2/token` with
    /// `grant_type=urn:ietf:params:oauth:grant-type:uma-ticket` (§20.1) —
    /// exchange a ticket for an RPT.
    ///
    /// # This method never retries, by design
    ///
    /// It issues **exactly one** request and does not go through the §16 retry
    /// runner — not on `5xx`, not on timeout, not on any transport failure
    /// (§20.2 rule 6). The ticket is consumed before the request is evaluated,
    /// so a failed exchange has already spent it: a retry cannot succeed, and
    /// under concurrency it is precisely the concurrent redemption a server
    /// whose storage engine this SDK cannot attest may admit twice
    /// (ilpanich/axiam#302). On failure, request a **new** ticket.
    ///
    /// # What this method deliberately does not do
    ///
    /// * **No default `claim_token`** (§20.2 rule 2). It is a required
    ///   parameter. Defaulting it to the resource server's own PAT would mint
    ///   an RPT for the resource server instead of for the user.
    /// * **No auto-narrowing on `access_denied`** (rule 3). A partial grant is
    ///   refused whole; whether two-of-three permissions is useful is the
    ///   application's judgement, not this SDK's.
    /// * **No adoption** (rule 4). The RPT is the *requesting party's* token,
    ///   returned for the caller to hand onward or inspect. Adopting it as this
    ///   client's credentials would re-privilege every later call as that user.
    ///
    /// The four ticket refusals — unknown, expired, already used, wrong client
    /// — all answer `invalid_grant` with one message. This SDK does not try to
    /// tell them apart (§20.4): the server collapses them so a caller cannot
    /// probe for live ticket handles, and re-deriving the distinction
    /// client-side would hand back exactly what the server withheld.
    pub async fn uma_exchange_ticket(
        &self,
        ticket: &Sensitive<String>,
        claim_token: &Sensitive<String>,
    ) -> Result<RequestingPartyToken, AxiamError> {
        self.uma_exchange_ticket_with(ticket, claim_token, None, None)
            .await
    }

    /// [`Self::uma_exchange_ticket`] with an explicit tenant and/or a
    /// pre-fetched discovery document.
    pub async fn uma_exchange_ticket_with(
        &self,
        ticket: &Sensitive<String>,
        claim_token: &Sensitive<String>,
        tenant_id: Option<Uuid>,
        configuration: Option<OidcConfiguration>,
    ) -> Result<RequestingPartyToken, AxiamError> {
        let configuration = match configuration {
            Some(c) => c,
            None => self.oidc_discover().await?,
        };
        let tenant_id = self.resolve_oidc_tenant_id(tenant_id).await?;
        let client_id = self.oidc_client_id_or_err()?.to_string();
        let client_secret = self.oidc_client_secret_or_err("uma_exchange_ticket")?;
        let endpoint = self.mtls_preferred(
            &configuration,
            |a| a.token_endpoint.as_deref(),
            &configuration.token_endpoint,
        )?;
        let url = self.oidc_endpoint_url(endpoint, tenant_id)?;

        let form = UmaTicketForm {
            grant_type: UMA_TICKET_GRANT_TYPE,
            ticket: ticket.expose().as_str(),
            claim_token: claim_token.expose().as_str(),
            claim_token_format: UMA_CLAIM_TOKEN_FORMAT,
            client_id: &client_id,
            client_secret: &client_secret,
        };

        // One `send()`, no retry wrapper. See the rule-6 note above — this is
        // the §16 exception, and it is load-bearing rather than stylistic.
        let response = self
            .idp_form_post(url)
            .form(&form)
            .send()
            .await
            .map_err(|e| AxiamError::Network {
                message: format!("uma ticket exchange request failed: {e}"),
                source: Some(Box::new(e)),
            })?;

        if !response.status().is_success() {
            // §20.4: dispatch on the `error` field before the status code, so
            // `access_denied` reads as itself whether it arrives as 403 (as the
            // ticket grant sends it) or as anything else.
            return Err(oauth2_error_or_fallback(response).await);
        }

        let wire: RptResponseWire = response.json().await.map_err(|e| AxiamError::Network {
            message: format!("failed to parse RPT response: {e}"),
            source: Some(Box::new(e)),
        })?;

        Ok(RequestingPartyToken {
            access_token: Sensitive::new(wire.access_token),
            token_type: wire.token_type,
            expires_in: wire.expires_in,
        })
    }

    /// Shared PAT-authenticated Protection API request.
    async fn uma_protection_request<B: Serialize + ?Sized>(
        &self,
        method: &str,
        path: &str,
        pat: &Sensitive<String>,
        body: Option<&B>,
    ) -> Result<reqwest::Response, AxiamError> {
        let url = self
            .base_url()
            .join(path)
            .map_err(|e| AxiamError::Network {
                message: format!("invalid UMA path {path}: {e}"),
                source: None,
            })?;

        let mut request = match method {
            "POST" => self.http().post(url),
            "PUT" => self.http().put(url),
            "DELETE" => self.http().delete(url),
            _ => self.http().get(url),
        }
        .header("X-Tenant-ID", self.tenant_header_value())
        .bearer_auth(pat.expose())
        .maybe_csrf_header(self);

        if let Some(body) = body {
            request = request.json(body);
        }

        request.send().await.map_err(|e| AxiamError::Network {
            message: format!("UMA protection API request failed: {e}"),
            source: Some(Box::new(e)),
        })
    }

    async fn uma_protection_json<R, B>(
        &self,
        method: &str,
        path: &str,
        pat: &Sensitive<String>,
        body: Option<&B>,
    ) -> Result<R, AxiamError>
    where
        R: for<'de> Deserialize<'de>,
        B: Serialize + ?Sized,
    {
        let response = self.uma_protection_request(method, path, pat, body).await?;
        if !response.status().is_success() {
            return Err(oauth2_error_or_fallback(response).await);
        }
        response.json().await.map_err(|e| AxiamError::Network {
            message: format!("failed to parse UMA response: {e}"),
            source: Some(Box::new(e)),
        })
    }
}

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

    #[test]
    fn parses_a_well_formed_challenge() {
        let c = uma_parse_challenge(
            r#"UMA realm="example", as_uri="https://id.example", ticket="abc123""#,
        )
        .expect("should parse");
        assert_eq!(c.realm.as_deref(), Some("example"));
        assert_eq!(c.as_uri.as_deref(), Some("https://id.example"));
        assert_eq!(c.ticket.map(|t| t.expose().clone()), Some("abc123".into()));
    }

    #[test]
    fn rejects_a_non_uma_scheme() {
        assert!(uma_parse_challenge(r#"Bearer realm="example""#).is_none());
        // A scheme that merely starts with UMA is not UMA.
        assert!(uma_parse_challenge(r#"UMAX realm="example""#).is_none());
    }

    #[test]
    fn a_ticket_is_not_printed_by_debug() {
        // §20.6: the ticket is a bearer credential for its 60-second life, and
        // its short lifetime is exactly what invites logging it.
        let c = uma_parse_challenge(r#"UMA ticket="super-secret-ticket""#).unwrap();
        let rendered = format!("{c:?}");
        assert!(
            !rendered.contains("super-secret-ticket"),
            "the ticket must be redacted in Debug output, got: {rendered}"
        );
    }

    #[test]
    fn challenge_header_round_trips() {
        let header = uma_challenge_header(
            "example",
            "https://id.example",
            &Sensitive::new("tkt".to_string()),
        );
        let parsed = uma_parse_challenge(&header).expect("round trip");
        assert_eq!(parsed.as_uri.as_deref(), Some("https://id.example"));
        assert_eq!(
            parsed.ticket.map(|t| t.expose().clone()),
            Some("tkt".into())
        );
    }

    #[test]
    fn an_update_payload_carries_exactly_the_scopes_given() {
        // §20.2 rule 8: no read-modify-write. Serializing a set with one scope
        // must send one scope, never the union with whatever the server holds.
        let set = ResourceSet::new("invoice").with_scopes(["view"]);
        let json = serde_json::to_value(&set).unwrap();
        assert_eq!(json["resource_scopes"], serde_json::json!(["view"]));
    }
}

/// CONTRACT.md §7 rule 1: these wire structs hold the plaintext of a value
/// the public type wraps in `Sensitive`, so none of them may be `Debug`.
#[cfg(test)]
mod wire_redaction_tests {
    #[test]
    fn no_wire_struct_holding_a_secret_is_debug() {
        assert!(
            !crate::sensitive::implements_debug!(super::TicketResponseWire),
            "TicketResponseWire is Debug"
        );
        assert!(
            !crate::sensitive::implements_debug!(super::RptResponseWire),
            "RptResponseWire is Debug"
        );
    }
}