text: import secrets
  from fastapi import Depends, HTTPException, status
  from fastapi.security import HTTPBasic, HTTPBasicCredentials
  from app import api_settings
  
  security = HTTPBasic()
  
  
  def get_username(credentials: HTTPBasicCredentials = Depends(security)):
      correct_username = secrets.compare_digest(credentials.username, api_settings.username)
      correct_password = secrets.compare_digest(credentials.password, api_settings.password)
      if not (correct_username and correct_password):
          raise HTTPException(
              status_code=status.HTTP_401_UNAUTHORIZED,
              detail="Incorrect email or password",
              headers={"WWW-Authenticate": "Basic"},
          )
      return credentials.username
  