diff --git a/donation-api/src/donation_api/constants.py b/donation-api/src/donation_api/constants.py index d608b563..fc96d6b2 100644 --- a/donation-api/src/donation_api/constants.py +++ b/donation-api/src/donation_api/constants.py @@ -22,6 +22,9 @@ class Constants: merchantid_domain_association: str = ( os.getenv("MERCHANTID_DOMAIN_ASSOCIATION") or "" ) + merchantid_domain_association_txt: str = ( + os.getenv("MERCHANTID_DOMAIN_ASSOCIATION_TXT") or "" + ) stripe_minimal_amount: int = int(os.getenv("STRIPE_MINIMAL_AMOUNT") or "5") stripe_maximum_amount: int = int(os.getenv("STRIPE_MAXIMUM_AMOUNT") or "999999") diff --git a/donation-api/src/donation_api/entrypoint.py b/donation-api/src/donation_api/entrypoint.py index 073eac3d..60b08cca 100644 --- a/donation-api/src/donation_api/entrypoint.py +++ b/donation-api/src/donation_api/entrypoint.py @@ -33,6 +33,15 @@ async def _(): conf.merchantid_domain_association, status_code=HTTPStatus.OK ) + if conf.merchantid_domain_association_txt: + + @app.get("/.well-known/apple-developer-merchantid-domain-association.txt") + async def _(): + """Used to validate domain ownership with apple""" + return PlainTextResponse( + conf.merchantid_domain_association_txt, status_code=HTTPStatus.OK + ) + api = FastAPI( title=__title__, description=__description__,