#[non_exhaustive]pub enum JwtKeyError {
NotBase64,
NotJson(String),
NotAKey,
BadKey {
at: String,
reason: String,
},
NoUsableKeys(String),
JwksUrl(String),
}Expand description
A JWT secret that cannot be turned into keys.
Always a configuration fault, reported when the configuration is read: a server that started with a key it cannot use would answer every token with a 401 and leave the operator to work out why.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotBase64
The secret is said to be base64 and is not.
NotJson(String)
The secret starts like a JSON object and does not parse as one.
Not quietly read as an HMAC secret instead, which is what PostgREST does: a public key with a typo in it would then become an HMAC secret that anyone holding the public key can sign with.
NotAKey
A JSON object that is neither a JWK nor a JWK Set.
BadKey
One key is malformed.
NoUsableKeys(String)
Every key was set aside as unable to verify a signature.
JwksUrl(String)
PGRST_JWT_JWKS_URL is not a URL keys may be fetched from; see
crate::jwks::check_url.
Trait Implementations§
Source§impl Clone for JwtKeyError
impl Clone for JwtKeyError
Source§impl Debug for JwtKeyError
impl Debug for JwtKeyError
Source§impl Display for JwtKeyError
impl Display for JwtKeyError
impl Eq for JwtKeyError
Source§impl Error for JwtKeyError
impl Error for JwtKeyError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()