pub struct DeviceAuthorization { /* private fields */ }Expand description
What DeviceFlow::start returns: everything the login needs, with the one
secret in it wrapped.
07-security.md’s credential inventory splits the two codes deliberately:
“the user code is shown on screen by design, the device code never is”. So
DeviceAuthorization::user_code hands out a plain &str and
DeviceAuthorization::device_code hands out a SecretString, and
Debug is written by hand so that neither a derive nor a future field can
quietly change that.
Implementations§
Source§impl DeviceAuthorization
impl DeviceAuthorization
Sourcepub fn user_code(&self) -> &str
pub fn user_code(&self) -> &str
The code the user types. Displayed by design, and only during login.
Sourcepub fn device_code(&self) -> &SecretString
pub fn device_code(&self) -> &SecretString
The code this process proves possession of. Never displayed, never logged, never persisted.
Sourcepub fn verification_uri(&self) -> &Url
pub fn verification_uri(&self) -> &Url
The page the user code is typed into — validated to be on GitHub’s own
origin by DeviceFlow::start.
Sourcepub fn expires_in(&self) -> Duration
pub fn expires_in(&self) -> Duration
How long the whole login has before the device code dies.
Trait Implementations§
Source§impl Clone for DeviceAuthorization
impl Clone for DeviceAuthorization
Source§fn clone(&self) -> DeviceAuthorization
fn clone(&self) -> DeviceAuthorization
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more