pub struct JWTCredentials {
pub app_id: u64,
pub private_key: Vec<u8>,
/* private fields */
}Expand description
JSON Web Token authentication mechanism
The GitHub client methods are all &self, but the dynamically generated JWT token changes regularly. The token is also a bit expensive to regenerate, so we do want to have a mutable cache.
We use a token inside a Mutex so we can have interior mutability even though JWTCredentials is not mutable.
Fields§
§app_id: u64§private_key: Vec<u8>DER RSA key. Generate with
openssl rsa -in private_rsa_key.pem -outform DER -out private_rsa_key.der
Implementations§
Trait Implementations§
Source§impl Clone for JWTCredentials
impl Clone for JWTCredentials
Source§fn clone(&self) -> JWTCredentials
fn clone(&self) -> JWTCredentials
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl PartialEq for JWTCredentials
impl PartialEq for JWTCredentials
Auto Trait Implementations§
impl Freeze for JWTCredentials
impl RefUnwindSafe for JWTCredentials
impl Send for JWTCredentials
impl Sync for JWTCredentials
impl Unpin for JWTCredentials
impl UnwindSafe for JWTCredentials
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more