I am using the firebase-admin-python SDK to handle authentication between an iOS app and a flask backend (python). This is my backend authentication endpoint, following the firebase guide:
from flask import request
from firebase_admin import auth
def get():
"""accessed via '/api/authtoken' """
try:
fir_token = request.headers["Authorization"]
decoded_token = auth.verify_id_token(fir_token)
fir_auth_id = decoded_token["uid"]
except:
...
How do I mock the fir_token for a unit test? How do I also mock auth.verify_id_token
such that I don't need to actually connect to the firebase server?
if config["TESTING"] == True:
beforedecoded_token = auth.verify_id_token(fir_token)
to toggle theverifier
? – Thegn