Struct octorust::auth::JWTCredentials
source · pub struct JWTCredentials {
pub app_id: i64,
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: i64
§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 copy 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<JWTCredentials> for JWTCredentials
impl PartialEq<JWTCredentials> for JWTCredentials
source§fn eq(&self, other: &JWTCredentials) -> bool
fn eq(&self, other: &JWTCredentials) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.Auto Trait Implementations§
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