Terarea  2
The automation project
Loading...
Searching...
No Matches
src.lib.components.oauth_authentication.OAuthAuthentication Class Reference
Collaboration diagram for src.lib.components.oauth_authentication.OAuthAuthentication:
Collaboration graph

Public Member Functions

None __init__ (self, RuntimeData runtime_data, int success=0, int error=84, bool debug=False)
 
Union[str, None] refresh_token (self, str provider_name, str refresh_link)
 
Response oauth_callback (self, Request request)
 
Response oauth_login (self, Request request)
 
Response add_oauth_provider (self, Request request, str provider="")
 
Response update_oauth_provider_data (self, Request request, str provider)
 
Response patch_oauth_provider_data (self, Request request, str provider)
 
Response delete_oauth_provider (self, Request request, str provider)
 

Data Fields

bool debug = debug
 
int success = success
 
int error = error
 
RuntimeData runtime_data_initialised = runtime_data
 
Disp disp
 

Protected Member Functions

Union[int, str] _generate_oauth_authorization_url (self, str provider)
 
 _exchange_code_for_token (self, str provider, str code)
 
 _get_user_info (self, str provider, str access_token)
 
Response _oauth_user_logger (self, Dict user_info, str provider, list connection_data)
 
Response _handle_token_response (self, Dict token_response, str provider)
 

Detailed Description

The class that handle the oauth authentication

Definition at line 15 of file oauth_authentication.py.

Constructor & Destructor Documentation

◆ __init__()

None src.lib.components.oauth_authentication.OAuthAuthentication.__init__ ( self,
RuntimeData runtime_data,
int success = 0,
int error = 84,
bool debug = False )
_summary_
    The constructor of the OAuth authentication class

Args:
    runtime_data (RuntimeData): _description_: The initialised version of the runtime_data class.
    success (int, optional): _description_. Defaults to 0.: The status code for success.
    error (int, optional): _description_. Defaults to 84.: The status code for error.
    debug (bool, optional): _description_. Defaults to False.: The info on if to activate debug mode.

Definition at line 20 of file oauth_authentication.py.

Member Function Documentation

◆ _exchange_code_for_token()

src.lib.components.oauth_authentication.OAuthAuthentication._exchange_code_for_token ( self,
str provider,
str code )
protected
Exchange the OAuth authorization code for an access token

Definition at line 95 of file oauth_authentication.py.

◆ _generate_oauth_authorization_url()

Union[int, str] src.lib.components.oauth_authentication.OAuthAuthentication._generate_oauth_authorization_url ( self,
str provider )
protected
Generate an OAuth authorization url depends on the given provider

Definition at line 44 of file oauth_authentication.py.

◆ _get_user_info()

src.lib.components.oauth_authentication.OAuthAuthentication._get_user_info ( self,
str provider,
str access_token )
protected
Get a user information depending

Definition at line 163 of file oauth_authentication.py.

◆ _handle_token_response()

Response src.lib.components.oauth_authentication.OAuthAuthentication._handle_token_response ( self,
Dict token_response,
str provider )
protected
The function that handle the response given by the provider for the oauth token

Definition at line 337 of file oauth_authentication.py.

◆ _oauth_user_logger()

Response src.lib.components.oauth_authentication.OAuthAuthentication._oauth_user_logger ( self,
Dict user_info,
str provider,
list connection_data )
protected
The function to insert or update the user information in the database

Definition at line 207 of file oauth_authentication.py.

◆ add_oauth_provider()

Response src.lib.components.oauth_authentication.OAuthAuthentication.add_oauth_provider ( self,
Request request,
str provider = "" )
Add a new oauth provider to the database (only for admin)

Definition at line 575 of file oauth_authentication.py.

◆ delete_oauth_provider()

Response src.lib.components.oauth_authentication.OAuthAuthentication.delete_oauth_provider ( self,
Request request,
str provider )
The function to delete an oauth provider from the database

Definition at line 856 of file oauth_authentication.py.

◆ oauth_callback()

Response src.lib.components.oauth_authentication.OAuthAuthentication.oauth_callback ( self,
Request request )
Callback of the OAuth login

Definition at line 452 of file oauth_authentication.py.

◆ oauth_login()

Response src.lib.components.oauth_authentication.OAuthAuthentication.oauth_login ( self,
Request request )
Get the authorization url for the OAuth login depending on the provider

Definition at line 535 of file oauth_authentication.py.

◆ patch_oauth_provider_data()

Response src.lib.components.oauth_authentication.OAuthAuthentication.patch_oauth_provider_data ( self,
Request request,
str provider )
The function that modify every value of an oauth provider

Definition at line 758 of file oauth_authentication.py.

◆ refresh_token()

Union[str, None] src.lib.components.oauth_authentication.OAuthAuthentication.refresh_token ( self,
str provider_name,
str refresh_link )
The function that use the given provider name and refresh link to generate a new token for oauth authentication

Definition at line 410 of file oauth_authentication.py.

◆ update_oauth_provider_data()

Response src.lib.components.oauth_authentication.OAuthAuthentication.update_oauth_provider_data ( self,
Request request,
str provider )
The function that modify every value of an oauth provider

Definition at line 679 of file oauth_authentication.py.

Field Documentation

◆ debug

bool src.lib.components.oauth_authentication.OAuthAuthentication.debug = debug

Definition at line 30 of file oauth_authentication.py.

◆ disp

Disp src.lib.components.oauth_authentication.OAuthAuthentication.disp
Initial value:
= Disp(
TOML_CONF,
SAVE_TO_FILE,
FILE_NAME,
FILE_DESCRIPTOR,
debug=self.debug,
logger=self.__class__.__name__
)

Definition at line 35 of file oauth_authentication.py.

◆ error

int src.lib.components.oauth_authentication.OAuthAuthentication.error = error

Definition at line 32 of file oauth_authentication.py.

◆ runtime_data_initialised

RuntimeData src.lib.components.oauth_authentication.OAuthAuthentication.runtime_data_initialised = runtime_data

Definition at line 33 of file oauth_authentication.py.

◆ success

int src.lib.components.oauth_authentication.OAuthAuthentication.success = success

Definition at line 31 of file oauth_authentication.py.


The documentation for this class was generated from the following file: