pub struct DeviceAuthorizationResponse {
pub device_code: String,
pub user_code: String,
pub verification_uri: String,
pub verification_uri_complete: Option<String>,
pub expires_in: u64,
pub interval: u64,
}Expand description
The RFC 8628 section 3.2 device authorization response.
Debug is hand-written (see below) rather than derived: device_code and user_code are both
credentials (RFC 8628 section 5.1 discusses guessing the user code; the device code is the
bearer credential the device polls with), and verification_uri_complete EMBEDS the user code
by construction, so it needs the same treatment or redacting user_code alone is theater.
Fields§
§device_code: StringThe device verification code the device polls the token endpoint with.
user_code: StringThe short code the end user types at verification_uri.
verification_uri: StringWhere the user goes to enter the code.
verification_uri_complete: Option<String>verification_uri with the code embedded, for QR codes and deep links.
expires_in: u64Lifetime of device_code and user_code in seconds (REQUIRED by the RFC).
interval: u64Minimum seconds between token-endpoint polls (the RFC default is 5).
Trait Implementations§
Source§impl Clone for DeviceAuthorizationResponse
impl Clone for DeviceAuthorizationResponse
Source§fn clone(&self) -> DeviceAuthorizationResponse
fn clone(&self) -> DeviceAuthorizationResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DeviceAuthorizationResponse
Hand-written so device_code and user_code never print, and so
verification_uri_complete (which embeds user_code verbatim, per RFC 8628 section 3.3.1)
does not leak the code back out through a field that looks like plain metadata. Only the
Some/None shape of verification_uri_complete is kept, for the same reason an Option
credential elsewhere in this crate keeps its shape: whether the AS offered a complete-URI form
is diagnostic, the URI’s contents are not.
impl Debug for DeviceAuthorizationResponse
Hand-written so device_code and user_code never print, and so
verification_uri_complete (which embeds user_code verbatim, per RFC 8628 section 3.3.1)
does not leak the code back out through a field that looks like plain metadata. Only the
Some/None shape of verification_uri_complete is kept, for the same reason an Option
credential elsewhere in this crate keeps its shape: whether the AS offered a complete-URI form
is diagnostic, the URI’s contents are not.