Struct octorust::auth::JWTCredentials[][src]

pub struct JWTCredentials {
    pub app_id: u64,
    pub private_key: Vec<u8>,
    // some fields omitted
}
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: u64private_key: Vec<u8>

DER RSA key. Generate with openssl rsa -in private_rsa_key.pem -outform DER -out private_rsa_key.der

Implementations

Fetch a valid JWT token, regenerating it if necessary

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.