pub fn from_json_file<P: AsRef<Path>>(path: P) -> Result<AuthProvider> {
        let file = fs::File::open(path.as_ref()).context(FailedToReadServiceAccountKey)?;

        let credentials: ApplicationCredentials =
            serde_json::from_reader(file).context(FailedToParseJSON)?;

        Ok(AuthProvider { credentials })
    }
/// Create an auth provider from a JSON file on disk.
///
/// # Errors
/// Returns an AuthError if the file cannot be read or if it doesn't contain
/// valid JSON.
Create an auth provider from a JSON file on disk.
Create an auth provider from a JSON file on disk .
pub fn from_json_file<P: AsRef<Path>>(path: P) -> Result<AuthProvider> {
        let file = fs::File::open(path.as_ref()).context(FailedToReadServiceAccountKey)?;
        let credentials: ApplicationCredentials =
            serde_json::from_reader(file).context(FailedToParseJSON)?;
        Ok(AuthProvider { credentials })
    }
pub fn from_json_file < P : AsRef < Path > > ( path : P ) -> Result < AuthProvider > { let file = fs :: File :: open ( path . as_ref ( ) ) . context ( FailedToReadServiceAccountKey ) ? ; let credentials : ApplicationCredentials = serde_json :: from_reader ( file ) . context ( FailedToParseJSON ) ? ; Ok ( AuthProvider { credentials } ) }
Create an auth provider from a JSON file on disk.
Create an auth provider from a JSON file on disk .
path
P
errors
Returns an AuthError if the file cannot be read or if it doesn't contain
valid JSON.
Returns an AuthError if the file cannot be read or if it doesn ' t contain valid JSON .