File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939auth_url = security_config .auth_url
4040ALGORITHM = security_config .auth_algorithm or "HS256"
4141SECRET_KEY = security_config .auth_key or secrets .token_hex (32 )
42- if security_config .auth_type == "password" :
43- oauth2_scheme = OAuth2PasswordBearer (tokenUrl = "auth/token" )
44- else :
45- oauth2_scheme = APIKeyCookie (name = security_config .cookie_key )
46- if security_config .instrument_auth_type == "token" :
47- instrument_oauth2_scheme = OAuth2PasswordBearer (tokenUrl = "auth/token" )
48- else :
49- instrument_oauth2_scheme = lambda * args , ** kwargs : None
42+ oauth2_scheme = (
43+ OAuth2PasswordBearer (tokenUrl = "auth/token" )
44+ if security_config .auth_type == "password"
45+ else APIKeyCookie (name = security_config .cookie_key )
46+ )
47+ instrument_oauth2_scheme = (
48+ OAuth2PasswordBearer (tokenUrl = "auth/token" )
49+ if security_config .instrument_auth_type == "token"
50+ else lambda * args , ** kwargs : None
51+ )
5052pwd_context = CryptContext (schemes = ["bcrypt" ], deprecated = "auto" )
5153
5254instrument_server_tokens : dict [float , dict ] = {}
You can’t perform that action at this time.
0 commit comments