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
//! Wire types for the `POST /api/v1/auth/{token,validate}` endpoints.
//!
//! Carried over the wire by both `manta-cli` (sending requests via
//! `MantaClient`) and `manta-server` (deserializing them in handlers).
use ;
use ToSchema;
/// Request body for `POST /api/v1/auth/token`.
///
/// Paired with [`AuthTokenResponse`] on success. The `/auth/*`
/// sub-router is wrapped by `strip_body_for_logs`, so neither the
/// request body nor the issued token appears in access logs.
///
/// # Wire shape
///
/// ```json
/// { "username": "alice", "password": "hunter2" }
/// ```
/// Response body for `POST /api/v1/auth/token`.
///
/// Returned in exchange for a valid [`AuthTokenRequest`].
///
/// # Wire shape
///
/// ```json
/// { "token": "eyJhbGciOi..." }
/// ```
/// Request body for `POST /api/v1/auth/validate`.
///
/// Used to check a previously-issued [`AuthTokenResponse::token`]
/// before relying on it. The server returns `200 OK` for a valid
/// token and `401` otherwise — there is no dedicated response body.