-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
50 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"""enum representing types of authentication supported by this library""" | ||
|
||
from enum import Enum, auto | ||
from typing import List | ||
|
||
|
||
class AuthType(int, Enum): | ||
"""enum representing types of authentication supported by this library""" | ||
|
||
UNAUTHORIZED = auto() | ||
|
||
BROWSER = auto() | ||
|
||
#: client auth via OAuth token refreshing | ||
OAUTH_DEFAULT = auto() | ||
|
||
#: YTM instance is using a non-default OAuth client (id & secret) | ||
OAUTH_CUSTOM_CLIENT = auto() | ||
|
||
#: allows fully formed OAuth headers to ignore browser auth refresh flow | ||
OAUTH_CUSTOM_FULL = auto() | ||
|
||
@classmethod | ||
def oauth_types(cls) -> List["AuthType"]: | ||
return [cls.OAUTH_DEFAULT, cls.OAUTH_CUSTOM_CLIENT, cls.OAUTH_CUSTOM_FULL] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters