Skip to content

Commit ea08663

Browse files
committed
feat: added option for api auth
1 parent 4bdaea0 commit ea08663

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/webapp/authn.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616

1717
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
1818

19+
oauth2_apikey_scheme = OAuth2PasswordBearer(
20+
scheme_name="api_key_scheme",
21+
tokenUrl="token-from-api-key",
22+
)
23+
1924
api_key_header = APIKeyHeader(name="X-API-KEY", scheme_name="api-key", auto_error=False)
2025
# The INST value may be empty for Datakinder or cross-institution access.
2126
api_key_inst_header = APIKeyHeader(

0 commit comments

Comments
 (0)