[−][src]Struct firestore_db_and_auth::sessions::user::Session
An impersonated session. If you access FireStore with such a session, FireStore rules might restrict access to data.
Fields
userid: String
refresh_token: Option<String>
api_key: String
bearer: String
projectid: String
Methods
impl Session
[src]
pub fn by_refresh_token(
credentials: &Credentials,
refresh_token: &str
) -> Result<Session>
[src]
credentials: &Credentials,
refresh_token: &str
) -> Result<Session>
Create a new firestore user session via a valid refresh_token
pub fn by_user_id(credentials: &Credentials, user_id: &str) -> Result<Session>
[src]
Create a new firestore user session with a fresh access token and new refresh token
pub fn new(
credentials: &Credentials,
user_id: Option<&str>,
firebase_tokenid: Option<&str>,
refresh_token: Option<&str>
) -> Result<Session>
[src]
credentials: &Credentials,
user_id: Option<&str>,
firebase_tokenid: Option<&str>,
refresh_token: Option<&str>
) -> Result<Session>
Create an impersonated session
If the optionally provided access token is still valid, it will be used. If the access token is not valid anymore, but the given refresh token is, it will be used to retrieve a new access token.
If neither refresh token nor access token work are provided or valid, the service account credentials will be used to generate a new impersonated refresh and access token for the given user.
If none of the parameters are given, the function will error out.
See:
- https://firebase.google.com/docs/reference/rest/auth#section-refresh-token
- https://firebase.google.com/docs/auth/admin/create-custom-tokens#create_custom_tokens_using_a_third-party_jwt_library
pub fn by_access_token(
credentials: &Credentials,
firebase_tokenid: &str
) -> Result<Session>
[src]
credentials: &Credentials,
firebase_tokenid: &str
) -> Result<Session>
Trait Implementations
impl<'a> FirebaseAuthBearer<'a> for Session
[src]
impl Debug for Session
[src]
impl Serialize for Session
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for Session
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Send for Session
impl Unpin for Session
impl Sync for Session
impl UnwindSafe for Session
impl RefUnwindSafe for Session
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<T> Typeable for T where
T: Any,
T: Any,
impl<T> IntoCollection<T> for T
fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
A: Array<Item = T>,
fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where
A: Array<Item = U>,
F: FnMut(T) -> U,
A: Array<Item = U>,
F: FnMut(T) -> U,
impl<T, I> AsResult<T, I> for T where
I: Input,
I: Input,