Skip to content

Commit 9e11446

Browse files
committed
apple-only additional verif?
1 parent eab7a76 commit 9e11446

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

donation-api/src/donation_api/constants.py

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class Constants:
2222
merchantid_domain_association: str = (
2323
os.getenv("MERCHANTID_DOMAIN_ASSOCIATION") or ""
2424
)
25+
merchantid_domain_association_txt: str = (
26+
os.getenv("MERCHANTID_DOMAIN_ASSOCIATION_TXT") or ""
27+
)
2528

2629
stripe_minimal_amount: int = int(os.getenv("STRIPE_MINIMAL_AMOUNT") or "5")
2730
stripe_maximum_amount: int = int(os.getenv("STRIPE_MAXIMUM_AMOUNT") or "999999")

donation-api/src/donation_api/entrypoint.py

+9
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ async def _():
3333
conf.merchantid_domain_association, status_code=HTTPStatus.OK
3434
)
3535

36+
if conf.merchantid_domain_association_txt:
37+
38+
@app.get("/.well-known/apple-developer-merchantid-domain-association.txt")
39+
async def _():
40+
"""Used to validate domain ownership with apple"""
41+
return PlainTextResponse(
42+
conf.merchantid_domain_association_txt, status_code=HTTPStatus.OK
43+
)
44+
3645
api = FastAPI(
3746
title=__title__,
3847
description=__description__,

0 commit comments

Comments
 (0)