pub struct SplitFileCredentialsProvider { /* private fields */ }Expand description
Reads the credentials for the resource owner and the client from two seperate (mostly) JSON files.
Implementations§
Source§impl SplitFileCredentialsProvider
impl SplitFileCredentialsProvider
Sourcepub fn new<C, O, CP, UP>(
client_credentials_file_path: C,
owner_credentials_file_path: O,
client_credentials_parser: CP,
owner_credentials_parser: UP,
) -> Selfwhere
C: Into<PathBuf>,
O: Into<PathBuf>,
CP: ClientCredentialsParser + Send + Sync + 'static,
UP: ResourceOwnerCredentialsParser + Send + Sync + 'static,
pub fn new<C, O, CP, UP>(
client_credentials_file_path: C,
owner_credentials_file_path: O,
client_credentials_parser: CP,
owner_credentials_parser: UP,
) -> Selfwhere
C: Into<PathBuf>,
O: Into<PathBuf>,
CP: ClientCredentialsParser + Send + Sync + 'static,
UP: ResourceOwnerCredentialsParser + Send + Sync + 'static,
Create a new instance with the given paths and the given parsers.
Sourcepub fn with_default_parsers<C, O>(
client_credentials_file_path: C,
owner_credentials_file_path: O,
) -> Self
pub fn with_default_parsers<C, O>( client_credentials_file_path: C, owner_credentials_file_path: O, ) -> Self
Sourcepub fn with_default_client_parser<C, O, P>(
client_credentials_file_path: C,
owner_credentials_file_path: O,
owner_credentials_parser: P,
) -> Self
pub fn with_default_client_parser<C, O, P>( client_credentials_file_path: C, owner_credentials_file_path: O, owner_credentials_parser: P, ) -> Self
Sourcepub fn with_default_client_parser_from_env<P>(
owner_credentials_parser: P,
) -> InitializationResult<Self>
pub fn with_default_client_parser_from_env<P>( owner_credentials_parser: P, ) -> InitializationResult<Self>
Configures from environment variables while the
ResourceOwnerCredentialsParser can be explicitly set.
- ‘
TOKKIT_CREDENTIALS_DIR’: The first place to look for the path to the credentials files. - ‘
CREDENTIALS_DIR’: The fallback for ‘TOKKIT_CREDENTIALS_DIR’ - ‘
TOKKIT_CREDENTIALS_RESOURCE_OWNER_FILENAME’ : The file name for the resource owner credentials - ‘
TOKKIT_CREDENTIALS_CLIENT_FILENAME’ : The file name for the client credentials
Either ‘TOKKIT_CREDENTIALS_DIR’ or ‘CREDENTIALS_DIR’ must be set
where ‘TOKKIT_CREDENTIALS_DIR’ takes preceedence.
‘TOKKIT_CREDENTIALS_RESOURCE_OWNER_FILENAME’
defaults to user.json while ‘TOKKIT_CREDENTIALS_CLIENT_FILENAME’
defaults to client.json.
Sourcepub fn with_default_parsers_from_env() -> InitializationResult<Self>
pub fn with_default_parsers_from_env() -> InitializationResult<Self>
Configures the instance from environment variables.
- ‘
TOKKIT_CREDENTIALS_DIR’: The first place to look for the path to the credentials files. - ‘
CREDENTIALS_DIR’: The fallback for ‘TOKKIT_CREDENTIALS_DIR’ - ‘
TOKKIT_CREDENTIALS_RESOURCE_OWNER_FILENAME’ : The file name for the resource owner credentials - ‘
TOKKIT_CREDENTIALS_CLIENT_FILENAME’ : The file name for the client credentials
Either ‘TOKKIT_CREDENTIALS_DIR’ or ‘CREDENTIALS_DIR’ must be set
where ‘TOKKIT_CREDENTIALS_DIR’ takes preceedence.
‘TOKKIT_CREDENTIALS_RESOURCE_OWNER_FILENAME’
defaults to user.json while ‘TOKKIT_CREDENTIALS_CLIENT_FILENAME’
defaults to client.json.