genetic_forensic_portal.app.common package

Contains common functionality used throughout the application.

Modules: - constants: Contains constants used throughout the application. - download_buttons: Contains Streamlit buttons for downloading files while handling auth decisions. Contained here because it is used in multiple places. - setup.py: Contains the logic run at the top of every Streamlit page to set up the session state and check for authentication. Other code that should be run at the top of every Streamlit page should be added here.

Submodules

genetic_forensic_portal.app.common.constants module

Contains constants used throughout the application.

Types of constants found in this module: - Authentication session state keys - Sample, canned analysis “UUID”s used for testing

genetic_forensic_portal.app.common.download_buttons module

Contains Streamlit buttons for downloading files while handling auth decisions. Contained here because it is used in multiple places.

genetic_forensic_portal.app.common.download_buttons.scat_analysis_download_button(uuid)

Create a download button for SCAT analysis data.

Parameters:

uuid (str)

Return type:

None

genetic_forensic_portal.app.common.download_buttons.voronoi_analysis_download_button(uuid)

Create a download button for Voronoi analysis data.

Parameters:

uuid (str)

Return type:

None

genetic_forensic_portal.app.common.setup module

Contains the logic run at the top of every Streamlit page to set up the session state and check for authentication.

Other code that should be run at the top of every Streamlit page should be added here.

genetic_forensic_portal.app.common.setup.authentication_dialog()

Create the login form for the user to authenticate.

Return type:

None

genetic_forensic_portal.app.common.setup.authentication_logout()

Create the logout confirmation dialog for the user to confirm logging out.

Return type:

None

genetic_forensic_portal.app.common.setup.create_authentication()

Create the authentication flow for the user to log in and log out.

Return type:

None

genetic_forensic_portal.app.common.setup.initialize()

Initialize the session state and create the authentication flow.

Return type:

None

genetic_forensic_portal.app.common.setup.initialize_session_state()

Initialize the session state variables used for authentication.

Return type:

None

genetic_forensic_portal.app.common.setup.login_success(message, username, token)

Set the session state variables when a user successfully logs in.

Parameters:
  • message (str) – The message to display to the user.

  • username (str) – The username of the user that logged in.

  • token (dict) – The token returned from the Keycloak API.

Return type:

None