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
//! ARL deserialization for Deezer gateway responses.
//!
//! Provides a type for deserializing Authentication Reference Links (ARLs)
//! from the Deezer gateway API responses, with built-in redaction for security.
//!
//! # Security
//!
//! ARLs in responses are automatically redacted in debug output to prevent
//! accidental credential exposure.
//!
//! # Example
//!
//! ```rust
//! use deezer::gateway::{Arl, Response};
//!
//! // Parse gateway response
//! let response: Response<Arl> = serde_json::from_str(json)?;
//!
//! // Token is redacted in debug output
//! println!("{:?}", response); // Prints: Response { results: Arl("REDACTED") }
//! ```
use Deserialize;
use Redact;
use Method;
/// Gateway method name for retrieving an Authentication Reference Link.
///
/// This endpoint returns a new or refreshed ARL token for authentication.
/// The method name follows Deezer's dot-notation format:
/// - `user`: The API domain
/// - `getArl`: The specific operation
///
/// # API Response
///
/// Returns a response containing the ARL token:
/// ```json
/// {
/// "error": {},
/// "results": {
/// "arl": "abcdef123456..." // Actual token is much longer
/// }
/// }
/// ```
///
/// # Security Note
///
/// Access to this endpoint should be restricted as it provides
/// authentication credentials.
/// Authentication Reference Link for Deezer services.
///
/// This type wraps an ARL token string, providing:
/// * Secure handling (redaction, constant-time comparison)
/// * Serialization support
/// * Type safety
///
/// # Security Notes
///
/// ARLs should be treated as sensitive credentials:
/// * Store securely
/// * Never log or display
/// * Protect from unauthorized access
;