authentication
OAuth2 authentication to access protected resources.
Functions¶
add_auth_to_url
¶
add_auth_to_url(url: str) -> str
get_cached_token
¶
get_cached_token(account_name: str) -> Optional[str]
Return the cached token for the account.
github_auth_device
¶
github_auth_device(n_polls: int = 9999) -> Optional[str]
Authenticate with GitHub, polling up to n_polls times to wait for completion.
login_to_svc
¶
login_to_svc(
service: Optional[str] = None,
protocol: Optional[str] = None,
scopes: Optional[str] = None,
token: Optional[str] = None,
) -> str
Log in and cache token.
Parameters:
service-
The name of the service to authenticate with
DEFAULT:
None protocol-
The protocol to use for git operations
DEFAULT:
None scopes-
Additional authentication scopes to request
DEFAULT:
None token-
A specific token to use instead of logging in
DEFAULT:
None
Returns:
-
str -
The token for the service