Skip to content

Commit 2c8148f

Browse files
romartintisnik
authored andcommitted
Linting.
1 parent ca2f56e commit 2c8148f

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

src/authentication/api_key_token.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,12 @@ async def __call__(self, request: Request) -> tuple[str, str, bool, str]:
5252
request: The FastAPI request object.
5353
5454
Returns:
55-
A tuple containing (user_uid, username, skip_userid_check, user_token) if authentication succeeds.
55+
A tuple containing (user_uid, username, skip_userid_check, user_token)
56+
if authentication succeeds.
5657
5758
Raises:
58-
HTTPException: If the bearer token is missing or doesn't match the configured API key (HTTP 401).
59+
HTTPException: If the bearer token is missing or
60+
doesn't match the configured API key (HTTP 401).
5961
"""
6062
# try to extract user token from request
6163
user_token = extract_user_token(request.headers)

src/models/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,8 @@ def check_authentication_model(self) -> Self:
841841
if self.module == constants.AUTH_MOD_APIKEY_TOKEN:
842842
if self.api_key_config is None:
843843
raise ValueError(
844-
"API Key configuration section must be specified when using API Key token authentication"
844+
"API Key configuration section must be specified "
845+
"when using API Key token authentication"
845846
)
846847
if self.api_key_config.api_key.get_secret_value() is None:
847848
raise ValueError(

tests/unit/authentication/test_api_key_token.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# pylint: disable=redefined-outer-name
2+
13
"""Unit tests for functions defined in authentication/api_key_token.py"""
24

35
from fastapi import Request, HTTPException

tests/unit/models/config/test_authentication_configuration.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ def test_authentication_configuration_api_key_but_insufficient_config() -> None:
382382

383383
with pytest.raises(
384384
ValidationError,
385-
match="API Key configuration section must be specified when using API Key token authentication",
385+
match="API Key configuration section must be "
386+
"specified when using API Key token authentication",
386387
):
387388
AuthenticationConfiguration(
388389
module=AUTH_MOD_APIKEY_TOKEN,

0 commit comments

Comments
 (0)