MCPcopy Index your code

hub / github.com/davidgraeff/firestore-db-and-auth-rs / functions

Functions108 in github.com/davidgraeff/firestore-db-and-auth-rs

↓ 9 callersMethodclient
(&self)
src/sessions.rs:122
↓ 9 callersFunctionextract_google_api_error_async
If the given reqwest response is status code 200, nothing happens Otherwise the response will be analysed if it contains a Google API Error response.
src/errors.rs:193
↓ 7 callersMethodaccess_token
Returns the current access token. This method will automatically refresh your access token, if it has expired. If the refresh failed, this will retur
src/sessions.rs:103
↓ 7 callersMethodadd_jwks_public_keys
Add a JSON Web Key Set (JWKS) to allow verification of Google access tokens. Example: ``` use firestore_db_and_auth::credentials::Credentials; use f
src/credentials.rs:233
↓ 7 callersMethodproject_id
(&self)
src/sessions.rs:91
↓ 6 callersMethodverify
Verifies that creating access tokens is possible with the given credentials and public keys. Returns an empty result type on success.
src/credentials.rs:183
↓ 5 callersFunctionwrite
Write a document to a given collection. If no document_id is given, Firestore will generate an ID. Check the [`WriteResult`] return value. If a docu
src/documents/write.rs:82
↓ 4 callersFunctiondownload_google_jwks
Download the Google JWK Set for a given service account. Returns the JWKS alongside the maximum time the JWKS is valid for. The resulting set of JWKs
src/jwt.rs:68
↓ 4 callersFunctionfrom_cache_file
Download the two public key JWKS files if necessary and cache the content at the given file path. Only use this option in cloud functions if the given
examples/utils/mod.rs:38
↓ 3 callersMethodaccess_token
An access token. If a refresh token is known and the access token expired, the implementation should try to refresh the access token before returning.
examples/own_auth.rs:19
↓ 3 callersFunctioncheck_write
(result: WriteResult, doc_id: &str)
examples/create_read_write_document.rs:56
↓ 3 callersFunctioncreate
Firebase Auth provides server-side session cookie management for traditional websites that rely on session cookies. This solution has several advantag
src/sessions.rs:424
↓ 3 callersFunctioncreate_jwt
( credentials: &Credentials, scope: Option<Iter<S>>, duration: chrono::Duration, client_id: Op
src/jwt.rs:137
↓ 3 callersFunctiondocument_to_pod
Converts a firebase google-rpc-api inspired heavily nested and wrapped response document of the Firebase REST API into a given custom type. This is a
src/firebase_rest_to_rust.rs:124
↓ 3 callersFunctionfirebase_auth_url
(v: &str, v2: &str)
src/users.rs:60
↓ 3 callersFunctionfirebase_url
(v1: &str, v2: &str)
src/documents/mod.rs:76
↓ 3 callersFunctionquery
Queries the database for specific documents, for example all documents in a collection of 'type' == "car". Example: ```no_run # use serde::{Serialize
src/documents/query.rs:36
↓ 3 callersFunctionread
Read a document of a specific type from a collection ## Arguments `auth` The authentication token `path` The document path / collection; For example
src/documents/read.rs:35
↓ 3 callersFunctionuser_session_with_cached_refresh_token
(cred: &Credentials)
examples/utils/mod.rs:8
↓ 3 callersFunctionvalid_test_credentials
()
examples/create_read_write_document.rs:223
↓ 3 callersFunctionverify_access_token
( credentials: &Credentials, access_token: &str, )
src/jwt.rs:197
↓ 3 callersMethodwith_jwkset
Adds public-key JWKs to a credentials instance and returns it. This method will also verify that the given JWKs files allow verification of Google ac
src/credentials.rs:150
↓ 2 callersMethodcompute_secret
Compute the Rsa keypair by using the private_key of the credentials file. You must call this if you have manually created a credentials object. This
src/credentials.rs:283
↓ 2 callersFunctioncreate_jwt_encoded
( credentials: &Credentials, scope: Option<Iter<'_, S>>, duration: chrono::Duration, client_id
src/jwt.rs:83
↓ 2 callersFunctiondelete
Deletes the document at the given path. You cannot use this directly with paths from [`list`] and [`query`] document metadata objects. Those contain
src/documents/delete.rs:14
↓ 2 callersFunctiondocument_name
Simple method to join the path and document identifier in correct format
src/documents/read.rs:71
↓ 2 callersMethoddownload_google_jwks
If you haven't called [`Credentials::add_jwks_public_keys`] to manually add public keys, this method will download one for your google service account
src/credentials.rs:250
↓ 2 callersFunctionextract_google_api_error_intern
( status: StatusCode, http_body: String, context: impl Fn() -> String, )
src/errors.rs:208
↓ 2 callersFunctionget_new_access_token
Gets a new access token via an api_key and a refresh_token.
src/sessions.rs:128
↓ 2 callersMethodjoin
(&mut self, sep: &str)
src/documents/mod.rs:30
↓ 2 callersFunctionpod_to_document
Converts a custom data type into a firebase google-rpc-api inspired heavily nested and wrapped type to be consumed by the Firebase REST API. This is
src/firebase_rest_to_rust.rs:163
↓ 2 callersFunctionread_by_name
Read a document of a specific type from a collection by its Firestore document name ## Arguments `auth` The authentication token `document_name` The
src/documents/read.rs:10
↓ 2 callersFunctionrequest_document
Executes the request to retrieve the document. Returns the response from `reqwest`
src/documents/read.rs:57
↓ 2 callersFunctionrun
()
examples/own_auth.rs:33
↓ 2 callersFunctionserde_value_to_firebase_value
Converts a flat serde json value into a firebase google-rpc-api inspired heavily nested and wrapped type to be consumed by the Firebase REST API. Thi
src/firebase_rest_to_rust.rs:69
↓ 2 callersFunctionservice_account_session
(cred: Credentials)
examples/create_read_write_document.rs:68
↓ 2 callersFunctionsign_up_in
( session: &service_account::Session, email: &str, password: &str, action: &str, )
src/users.rs:122
↓ 2 callersFunctionuser_account_session
(cred: Credentials)
examples/create_read_write_document.rs:96
↓ 1 callersMethodaccess_token_unchecked
The access token, unchecked. Might be expired or in other ways invalid.
examples/own_auth.rs:23
↓ 1 callersMethoddecode_secret
Find the secret in the jwt set that matches the given key id, if any. Used for jws validation
src/credentials.rs:203
↓ 1 callersFunctionfirebase_url_base
(v1: &str)
src/documents/mod.rs:63
↓ 1 callersFunctionfirebase_url_extended
(v1: &str, v2: &str, v3: &str)
src/documents/mod.rs:68
↓ 1 callersFunctionfirebase_url_query
(v1: &str)
src/documents/mod.rs:55
↓ 1 callersFunctionfirebase_value_to_serde_value
Converts a firebase google-rpc-api inspired heavily nested and wrapped response value of the Firebase REST API into a flattened serde json value. Thi
src/firebase_rest_to_rust.rs:28
↓ 1 callersFunctionget_new_data
( collection_id: &str, url: &str, auth: &'a impl FirebaseAuthBearer, )
src/documents/list.rs:122
↓ 1 callersFunctionidentitytoolkit_url
(project_id: &str)
src/sessions.rs:370
↓ 1 callersFunctionis_expired
Returns true if the access token (assumed to be a jwt) has expired An error is returned if the given access token string is not a jwt
src/jwt.rs:103
↓ 1 callersFunctionjwt_update_expiry_if
Returns true if the jwt was updated and needs signing
src/jwt.rs:115
↓ 1 callersFunctionlist
List all documents of a given collection. Please note that this API acts as an iterator of same-like documents. This type is not suitable if you want
src/documents/list.rs:44
↓ 1 callersFunctionmain
()
examples/firebase_user.rs:7
↓ 1 callersMethodnext
Skip empty entries
src/documents/query.rs:98
↓ 1 callersFunctionpem_to_der
Converts a PEM (ascii base64) encoded private key into the binary der representation
src/credentials.rs:67
↓ 1 callersFunctionrefresh_to_access_endpoint
(v: &str)
src/sessions.rs:36
↓ 1 callersFunctiontoken_endpoint
(v: &str)
src/sessions.rs:28
↓ 1 callersFunctionuser_info
Retrieve information about the firebase auth user associated with the given user session Error codes: - INVALID_ID_TOKEN - USER_NOT_FOUND
src/users.rs:69
↓ 1 callersFunctionvalid_test_credentials
()
examples/utils/mod.rs:64
↓ 1 callersFunctionwrite_document
(session: &mut ServiceSession, doc_id: &str)
examples/create_read_write_document.rs:26
↓ 1 callersFunctionwrite_partial_document
(session: &mut ServiceSession, doc_id: &str)
examples/create_read_write_document.rs:38
Functionabs_to_rel
Converts an absolute path like "projects/{PROJECT_ID}/databases/(default)/documents/my_collection/document_id" into a relative document path like "my_
src/documents/mod.rs:87
Functionabs_to_rel_test
()
src/documents/mod.rs:92
Methodaccess_token_unchecked
(&self)
src/sessions.rs:95
Methodby_access_token
Create a new firestore user session by a valid access token Remember that such a session cannot renew itself. As soon as the access token expired, no
src/sessions.rs:309
Methodby_oauth2
Creates a new user session with OAuth2 provider token. If user don't exist it's create new user in firestore Arguments: - `credentials` The credentia
src/sessions.rs:333
Methodby_refresh_token
Create a new firestore user session via a valid refresh_token Arguments: - `credentials` The credentials - `refresh_token` A refresh token. Async su
src/sessions.rs:234
Methodby_user_id
Create a new firestore user session with a fresh access token. Arguments: - `credentials` The credentials - `user_id` The firebase Authentication use
src/sessions.rs:259
Methodclient
The reqwest http client. The `Client` holds a connection pool internally, so it is advised that it is reused for multiple, successive connections.
examples/own_auth.rs:28
Functioncontents
Return the raw unparsed content of the Firestore document. Methods like [`read()`](../documents/fn.read.html) will deserialize the JSON-encoded respon
src/documents/read.rs:50
Functioncreate_session_cookie_test
()
examples/session_cookie.rs:30
Methoddefault
()
src/dto.rs:65
Functiondeserialize_credentials
()
src/credentials.rs:307
Functiondoctest_credentials
()
src/credentials.rs:296
Methoddownload_jwkset
The public keys to verify generated tokens will be downloaded, for the given service account as well as for "securetoken@system.gserviceaccount.com".
src/credentials.rs:175
Functionextract_google_api_error
If the given reqwest response is status code 200, nothing happens Otherwise the response will be analysed if it contains a Google API Error response.
src/errors.rs:171
Functionfirebase_user_test
()
examples/firebase_user.rs:22
Methodfmt
(&self, f: &mut fmt::Formatter)
src/errors.rs:92
Methodfmt
(&self, f: &mut fmt::Formatter<'_>)
src/credentials.rs:31
Methodfrom
(error: std::io::Error)
src/errors.rs:56
Methodfrom_file
Create a [`Credentials`] object by reading and parsing a google-service-account json file. This is a convenience method, that reads in the given cred
src/credentials.rs:139
Methodfrom_request
(request: &'a request::Request<'_>)
src/rocket/mod.rs:49
Functionget_provider
(provider: OAuth2Provider)
src/sessions.rs:55
Methodget_scopes
(&self)
src/jwt.rs:189
Functionhello
(auth: FirestoreAuthSessionGuard)
examples/rocket_http_protected_route.rs:21
Functionhello_not_logged_in
()
examples/rocket_http_protected_route.rs:27
Functionit_deserializes_a_document_with_empty_mapvalue
()
src/dto.rs:581
Functionit_deserializes_a_document_with_every_data_type
()
src/dto.rs:603
Functionit_document_name_joins_invalid_path_fragments
()
src/documents/read.rs:90
Functionit_document_name_joins_paths
()
src/documents/read.rs:79
Functionmain
()
examples/rocket_http_protected_route.rs:7
Functionmain
()
examples/session_cookie.rs:8
Functionmain
()
examples/create_read_write_document.rs:199
Functionmain
()
examples/own_auth.rs:60
Methodnew
Create a new JWKSetDTO instance from a given json string You can use [`Credentials::add_jwks_public_keys`] to manually add more public keys later on.
src/jwt.rs:55
Methodnew
(token: String, with_refresh_token: bool)
src/sessions.rs:148
Methodnew
Create a [`Credentials`] object by parsing a google-service-account json string Example: Assuming that your firebase service account credentials fil
src/credentials.rs:129
Functionown_auth_test
()
examples/own_auth.rs:65
Functionpem_to_der_test
()
src/credentials.rs:89
Methodproject_id
(&self)
examples/own_auth.rs:14
Functionservice_account_session_test
()
examples/create_read_write_document.rs:245
Functionsign_in
Signs in with the given email and password and returns a user session. Error codes: EMAIL_NOT_FOUND: There is no user record corresponding to this id
src/users.rs:170
Functionsign_up
Creates the firebase auth user with the given email and password and returns a user session. Error codes: EMAIL_EXISTS: The email address is already
src/users.rs:160
next →1–100 of 108, ranked by callers