mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-28 13:01:38 +00:00
14 lines
324 B
Python
14 lines
324 B
Python
import base64
|
|
|
|
from openbb_core.env import Env
|
|
|
|
|
|
def get_auth() -> str:
|
|
"""Returns the basic auth header."""
|
|
|
|
userpass = f"{Env().API_USERNAME}:{Env().API_PASSWORD}"
|
|
userpass_bytes = userpass.encode("ascii")
|
|
base64_bytes = base64.b64encode(userpass_bytes)
|
|
|
|
return f"Basic {base64_bytes.decode('ascii')}"
|