pub struct AuthResult {
pub role: String,
pub claims: HashMap<String, Value>,
}Expand description
Authentication result containing role and claims.
Fields§
§role: StringPostgreSQL role to use
claims: HashMap<String, Value>All JWT claims
Implementations§
Source§impl AuthResult
impl AuthResult
Sourcepub fn claims_json(&self) -> String
pub fn claims_json(&self) -> String
Get claims as JSON for GUC.
Sourcepub fn claim_settings(&self) -> Vec<(String, String)>
pub fn claim_settings(&self) -> Vec<(String, String)>
Build transaction-local PostgreSQL settings for the verified claims.
The complete JSON document preserves every claim. Claims with names
valid for custom PostgreSQL settings are also exposed individually for
policies using request.jwt.claims.<name>.
Trait Implementations§
Source§impl Clone for AuthResult
impl Clone for AuthResult
Source§impl Debug for AuthResult
impl Debug for AuthResult
Source§impl<'de> Deserialize<'de> for AuthResult
impl<'de> Deserialize<'de> for AuthResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AuthResult
impl RefUnwindSafe for AuthResult
impl Send for AuthResult
impl Sync for AuthResult
impl Unpin for AuthResult
impl UnsafeUnpin for AuthResult
impl UnwindSafe for AuthResult
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