A prefect Task class can be customized further with subclassing:
from prefect import Task
class HTTPGetTask(Task):
def __init__(self, username, password, **kwargs):
self.username = username
self.password = password
super().__init__(**kwargs)
def run(self, url):
return requests.get(url, auth=(self.username, self.password))