API Reference¶
components.ca.public.auth ¶
authorization ¶
AuthorizationStrategies ¶
Authorization strategies for CA
CaAlanerAdminStrategy ¶
Bases: AlanerAdminStrategy
AlanerAdminStrategy for CA (see class AlanerAdminStrategy in shared/iam/authorization.py)
Source code in components/ca/public/auth/authorization.py
CaAuthenticatedStrategy ¶
CaOpenStrategy ¶
CaOwnerOnlyStrategy ¶
Bases: OwnerOnlyStrategy
OwnerOnlyStrategy for CA (see class OwnerOnlyStrategy in shared/iam/authorization.py)
Source code in components/ca/public/auth/authorization.py
components.ca.public.blueprints ¶
admin_api_blueprint ¶
admin_tools ¶
CaAdminToolsBlueprint ¶
Bases: AdminToolsBlueprint, ServerSideAdminToolBlueprint
route ¶
Source code in components/ca/public/blueprints/admin_tools.py
admin_tools_blueprint
module-attribute
¶
config_usage ¶
Default admin tools: see shared admin tools
Source code in components/ca/public/blueprints/admin_tools.py
customize_email ¶
Customize an email template
Source code in components/ca/public/blueprints/admin_tools.py
document_previews ¶
Default admin tools: see shared admin tools
Source code in components/ca/public/blueprints/admin_tools.py
index ¶
init_blueprint ¶
Initialize the admin tools blueprint
Source code in components/ca/public/blueprints/admin_tools.py
list_api_endpoints ¶
Default admin tools: see shared admin tools
Source code in components/ca/public/blueprints/admin_tools.py
list_commands ¶
Default admin tools: see shared admin tools
Source code in components/ca/public/blueprints/admin_tools.py
list_email ¶
Default admin tools: see shared admin tools
Source code in components/ca/public/blueprints/admin_tools.py
load_admin_tools_blueprint ¶
marmot_account_company_placeholder_creation ¶
Marmot admin tools: account and company placeholder creation
Source code in components/ca/public/blueprints/admin_tools.py
marmot_company_admin_invitation ¶
Marmot admin tools: company admin invitation
Source code in components/ca/public/blueprints/admin_tools.py
marmot_contract_amendment ¶
Marmot admin tools: contract amendment
Source code in components/ca/public/blueprints/admin_tools.py
marmot_contract_creation ¶
Marmot admin tools: contract creation
Source code in components/ca/public/blueprints/admin_tools.py
marmot_create_settlement ¶
Marmot admin tools: create settlement
Source code in components/ca/public/blueprints/admin_tools.py
marmot_employee_invitation ¶
Marmot admin tools: employee invitation
Source code in components/ca/public/blueprints/admin_tools.py
marmot_employee_termination ¶
Marmot admin tools: employee termination
Source code in components/ca/public/blueprints/admin_tools.py
marmot_impersonate ¶
Marmot admin tools: create settlement
Source code in components/ca/public/blueprints/admin_tools.py
marmot_onboarding_invitation ¶
Marmot admin tools: onboarding invitation
Source code in components/ca/public/blueprints/admin_tools.py
show_command ¶
Default admin tools: see shared admin tools
Source code in components/ca/public/blueprints/admin_tools.py
upload_file ¶
Default admin tools: see shared admin tools
Source code in components/ca/public/blueprints/admin_tools.py
view_email ¶
View an email template
Source code in components/ca/public/blueprints/admin_tools.py
ca_core_blueprint ¶
ca_core_blueprint
module-attribute
¶
ca_core_blueprint = CustomBlueprint(
"ca-core",
__name__,
cli_group=None,
template_folder="templates",
static_folder="static",
static_url_path="/static",
)
components.ca.public.command_log ¶
queries ¶
get_command_logs ¶
Get command logs from the database
Source code in components/ca/public/command_log/queries.py
components.ca.public.employment ¶
ca_country_gateway ¶
CaCountryGateway ¶
Bases: CountryGateway[CaExtendedValues]
Canadian implementation of the Employment Component's CountryGateway
are_companies_in_same_account ¶
Source code in components/ca/public/employment/ca_country_gateway.py
get_account_name ¶
Source code in components/ca/public/employment/ca_country_gateway.py
get_company_information ¶
Source code in components/ca/public/employment/ca_country_gateway.py
get_employee_identifier_for_country ¶
get_employment_consumers ¶
Gets all employment consumers contributed by this country.
Notes: 1. ALL Employment Consumers will be called regardless of the country of origin. 2. The function that will be called must have all local code as LOCAL imports - otherwise, this breaks Canada (where loading non-CA models is forbidden)
Source code in components/ca/public/employment/ca_country_gateway.py
get_upstream_retry_handler ¶
get_user_admined_company_ids ¶
get_user_full_name ¶
Source code in components/ca/public/employment/ca_country_gateway.py
ca_extended_values ¶
CaEmploymentDeclaration
module-attribute
¶
CaExtendedValues ¶
Bases: ExtendedValuesDict
Canadian extended values stored in the Employment Component
employment_consumer ¶
Note: Do not import local country code here, do it in the internal component after checking the country code.
ca_health_affiliation_employment_change_consumer ¶
Consumer for employment changes
Source code in components/ca/public/employment/employment_consumer.py
components.ca.public.events ¶
beneficiary_created ¶
subscription ¶
subscribe_to_ca_global_events ¶
Events subscriptions that should be listened by every runtime for Canada.
Source code in components/ca/public/events/subscription.py
subscribe_to_events ¶
components.ca.public.helpers ¶
anonymization ¶
front_end ¶
FRONT_END_PATHS
module-attribute
¶
FRONT_END_PATHS = dict(
APP_URL="/dashboard",
UNSUBSCRIBE_URL="/unsubscribe",
LOGIN_URL="/login",
PASSWORD_RESET_BASE_URL="/password_reset",
DEPENDENT_INVITE_URL="/password_creation",
MARMOT_URL="/marmot",
MARMOT_CLAIM_MANAGEMENT="/marmot/claim_management",
MARMOT_ACCOUNT_URL="/TODO-TODO-TODO",
MARMOT_USER_URL="/marmot/user/",
MARMOT_COMPANY_URL="/marmot/company/",
EMPLOYEE_SIGNUP_URL="/ca/employee-onboarding",
EMPLOYEE_DEEPLINK_URL="/employee_onboarding",
COMPANY_ADMIN_ONBOARDING_INVITE_URL="/onboarding/company_admin_signup",
CUSTOMER_ADMIN_ONBOARDING_INVITE_URL="/onboarding/customer-admin-onboarding",
PARTNER_ONBOARDING_INVITE_URL="/ca/partner-onboarding",
PARTNER_DEEPLINK_URL="/partner_onboarding",
)
init_data_loader ¶
init_data_loader ¶
Create the base data to be populated in fresh local DBs.
Executed by "flask data init".
Source code in components/ca/public/helpers/init_data_loader.py
load_all_mailers ¶
load_all_mailers ¶
Loads all CA mailers, this helps setup register_sample_template_args for the admin tools
Source code in components/ca/public/helpers/load_all_mailers.py
templating ¶
configure_templating ¶
Inspired from https://github.com/alan-eu/alan-apps/blob/main/backend/components/fr/internal/helpers/templating.py#L46 ⧉
Source code in components/ca/public/helpers/templating.py
components.ca.public.scim_api ¶
adapter ¶
CaScimAdapter ¶
Bases: GenericScimAdapter
SCIM adapter for ca_api.
Source code in components/ca/public/scim_api/adapter.py
create_app_user ¶
Create a user with the given first and last name. and returns the user ID.
Source code in components/ca/public/scim_api/adapter.py
get_scim_users_data ¶
Returns the first and last name of users from a list of AlanEmployee objects.
Source code in components/ca/public/scim_api/adapter.py
get_user_data ¶
Returns user's first and last name by user_id.
Source code in components/ca/public/scim_api/adapter.py
test ¶
test_adapter ¶
adapter ¶
profile_service ¶
test_create_app_user ¶
Test create_app_user creates a new user correctly.
Source code in components/ca/public/scim_api/test/test_adapter.py
test_get_scim_users_data ¶
Test get_scim_users_data returns correct mapping of user data.
Source code in components/ca/public/scim_api/test/test_adapter.py
test_get_user_data ¶
Test get_user_data returns correct user identity.