Skip to content

Commit

Permalink
apple-only additional verif?
Browse files Browse the repository at this point in the history
  • Loading branch information
rgaudin committed Nov 15, 2024
1 parent eab7a76 commit 9e11446
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions donation-api/src/donation_api/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
9 changes: 9 additions & 0 deletions donation-api/src/donation_api/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__,
Expand Down

0 comments on commit 9e11446

Please sign in to comment.