Source code for imednet.auth.api_key
"""API Key authentication strategy."""
from typing import Dict
from imednet.constants import HEADER_API_KEY, HEADER_SECURITY_KEY
[docs]class ApiKeyAuth:
"""Authentication strategy using API Key and Security Key."""
def __init__(self, api_key: str, security_key: str) -> None:
self.api_key = api_key
self.security_key = security_key
[docs] def get_headers(self) -> Dict[str, str]:
"""Return the API key and security key headers."""
return {
HEADER_API_KEY: self.api_key,
HEADER_SECURITY_KEY: self.security_key,
}