Esempio n. 1
0
#    published by the Free Software Foundation, either version 3 of the
#    License, or (at your option) any later version.
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#    GNU Affero General Public License for more details.
#    You should have received a copy of the GNU Affero General Public License
#    along with this program. If not, see <https://www.gnu.org/licenses/>.

from immuni_common.sanic import create_app, run_app
from immuni_exposure_reporting.apis import keys
from immuni_exposure_reporting.core.managers import managers

sanic_app = create_app(
    api_title="Exposure Reporting Service",
    api_description=
    "The Exposure Reporting Service makes the TEK Chunks created by the Exposure "
    "Ingestion Service available to the Mobile Client. Only TEK Chunks for the last 14 days are "
    "made available."
    "<br><br>"
    "To avoid downloading the same TEKs multiple times, the Mobile Clients fetch the indexes of "
    "the TEK Chunks available to download first. "
    "Then, they only actually download TEK Chunks with indexes for which TEK Chunks have not been "
    "downloaded before.",
    blueprints=(keys.bp, ),
    managers=managers,
)

if __name__ == "__main__":  # pragma: no cover
    run_app(sanic_app)
Esempio n. 2
0
#    You should have received a copy of the GNU Affero General Public License
#    along with this program. If not, see <https://www.gnu.org/licenses/>.

from immuni_common.sanic import create_app, run_app
from immuni_exposure_ingestion.apis import ingestion
from immuni_exposure_ingestion.core.managers import managers

sanic_app = create_app(
    api_title="Exposure Ingestion Service",
    api_description="The Exposure Ingestion Service provides an API for the Mobile Client to "
    "upload its TEKs for the previous 14 days, in the case that the user tests positive for "
    "SARS-CoV-2 and decides to share them. "
    "Contextually, the Mobile Client uploads the Epidemiological Infos from the previous 14 days, "
    "if any. "
    "If some Epidemiological Infos are indeed uploaded, the user's Province of Domicile is "
    "uploaded too. "
    "The upload can only take place with an authorised OTP. "
    "The Exposure Ingestion Service is also responsible for periodically generating the TEK Chunks "
    "to be published by the Exposure Reporting Service. "
    "The TEK Chunks are assigned a unique incremental index and are immutable. "
    "They are generated periodically as the Mobile Clients upload new TEKs. "
    "TEK Chunks older than 14 days are automatically deleted from the database by an async "
    "cleanup job. "
    "Province of Domicile and Epidemiological Infos are forwarded to the Analytics Service.",
    blueprints=(ingestion.bp,),
    managers=managers,
)

if __name__ == "__main__":  # pragma: no cover
    run_app(sanic_app)
Esempio n. 3
0
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#   GNU Affero General Public License for more details.
#   You should have received a copy of the GNU Affero General Public License
#   along with this program. If not, see <https://www.gnu.org/licenses/>.

from immuni_common.sanic import create_app, run_app
from immuni_otp.apis import otp
from immuni_otp.core.managers import managers

sanic_app = create_app(
    api_title="OTP Service",
    api_description="The OTP Service provides an API to the National Healthcare Service for "
    "authorising OTPs that can be used to upload data from the Mobile Client via the Exposure "
    "Ingestion Service."
    "The OTP is generated by the App and communicated by the user to the Healthcare Operator "
    "(e.g., during a phone call). "
    "The Healthcare Operator inserts the OTP into the HIS, which then registers the OTP on the "
    "OTP Service."
    "<br><br>"
    "The OTP automatically expires after a defined interval. "
    "If the data has not been uploaded by the time the OTP expires, the user will have to start "
    "the process from the beginning with a new OTP.",
    blueprints=(otp.bp,),
    managers=managers,
)

if __name__ == "__main__":  # pragma: no cover
    run_app(sanic_app)
Esempio n. 4
0
#    Please refer to the AUTHORS file for more information.
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU Affero General Public License as
#    published by the Free Software Foundation, either version 3 of the
#    License, or (at your option) any later version.
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#    GNU Affero General Public License for more details.
#    You should have received a copy of the GNU Affero General Public License
#    along with this program. If not, see <https://www.gnu.org/licenses/>.

from immuni_app_configuration.apis import settings
from immuni_app_configuration.core.managers import managers
from immuni_common.sanic import create_app, run_app

sanic_app = create_app(
    api_title="App Configuration Service",
    api_description=
    "The App can be partially customised through the Configuration Settings "
    "downloaded at the App startup and updated every time the App starts a session, whether in the "
    "foreground or background. "
    "For example, these include information such as the weights to be used by the Mobile Client in "
    "the calculation of the Total Risk Score.",
    blueprints=(settings.bp, ),
    managers=managers,
)

if __name__ == "__main__":  # pragma: no cover
    run_app(sanic_app)
Esempio n. 5
0
def sanic(monitoring_setup: None) -> Sanic:
    yield create_app(api_title="",
                     api_description="",
                     blueprints=tuple(),
                     managers=BaseManagers())