xia_login_flask.account.XiaLoginFlask
- class xia_login_flask.account.XiaLoginFlask
Bases:
object
XIA Login Module for Flask
- Logged in status:
all user related information was retrieved by cookies.
g.user_id: User Mail Address
g.user_info: A dictionary holds the user related information
g.acl: A dictionary holds the User’s permissions for all requested applications.
- __init__()
Methods
__init__
()get_account_blueprint
(home_path, path_name, ...)Get Account Management Blueprint
get_callback_url
(requested_fqdn, url_list)Get Callback URL from a list of requested url
get_redirect_link
(endpoint, **kwargs)Get redirect link
get_token_from_url
(link)Get token value from URL
- classmethod get_account_blueprint(home_path: str, path_name: str, template_location: str, token_manager: Type[FlaskToken], user_manager: Type[User], profile_manager: Optional[Type[UserRoles]] = None, app_manager: Optional[Type[RoleMatrix]] = None, app_name: str = '', mail_sender: Optional[Type[MailSender]] = None, debug: bool = False)
Get Account Management Blueprint
- Parameters
home_path – homepage path of flask, should be parsable by using url_for. Example: home.home_page
path_name – sub flask path name of the parent app. Example: account so url_for(account.login) allows login
token_manager – Token Management Class, should be a subclass of FlaskToken
user_manager – User Management Class, should be a subclass of User (xia-user package)
profile_manager – User profile Management Class, should be a subclass of UserRoles (xia-user package)
app_manager – Application Management Class, should be a subclass of RoleMatrx (xia-user package)
app_name – The profile of which app should be retrieved
mail_sender – Mail Sender, should be a subclass of MailSender
template_location – Where the template Html files could be found. Example: “accounts” => “templates/accounts”
debug – Generate debug page: Weather the program should generate a debug endpoint
- Returns
Flask blueprint
- classmethod get_callback_url(requested_fqdn: str, url_list: list)
Get Callback URL from a list of requested url
- Parameters
requested_fqdn – Requested FQDN
url_list – Callback url list
- classmethod get_redirect_link(endpoint: str, **kwargs)
Get redirect link
- Parameters
endpoint – endpoint of flask name
**kwargs – parameters
- Returns
A full url to call
- classmethod get_token_from_url(link: str)
Get token value from URL
- Parameters
link – full URL
Returns: