Skip to content

Commit

Permalink
Fix OpenAPI generation for NoAuthAuthentication
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Sep 22, 2021
1 parent 6ea4e14 commit c923695
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions plugins/auth/fps_auth/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import httpx
from fastapi import Depends, status
from fastapi.security.base import SecurityBase
from fastapi_users.authentication import BaseAuthentication, CookieAuthentication # type: ignore
from fastapi_users import FastAPIUsers, BaseUserManager # type: ignore
from starlette.requests import Request
Expand All @@ -25,16 +24,11 @@
)


class NoAuth(SecurityBase):
def __call__(self):
return "noauth"


class NoAuthAuthentication(BaseAuthentication):
def __init__(self, user: UserDB, name: str = "noauth"):
super().__init__(name, logout=False)
self.user = user
self.scheme = NoAuth()
self.scheme = None # type: ignore

async def __call__(self, credentials, user_manager):
noauth_user = await user_manager.user_db.get_by_email(NOAUTH_EMAIL)
Expand Down

0 comments on commit c923695

Please sign in to comment.