Source code for ace.centralize.rest_api.auth_service
import os
from ace.config import settings
[docs]
class CentralizeAuth:
"""
Centralize API Service
Type : Bearer Token
"""
[docs]
def authenticate_on_behalf_of(self, headers: dict, user_id: str):
headers["X-On-Behalf-Of"] = f"Centralize={user_id}"
return self.authenticate(headers)
centralized_auth = CentralizeAuth()