Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logging error in auth_infrastructure #191

Merged
merged 2 commits into from
Mar 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions karp/auth_infrastructure/services/jwt_auth_service.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Module for jwt-based authentication."""
import time
from pathlib import Path
from typing import Dict, List, Optional

Expand Down Expand Up @@ -59,7 +58,7 @@ def __init__(
logger.debug("JWTAuthenticator created")

def authenticate(self, _scheme: str, credentials: str) -> User:
logger.debug("authenticate called", credentials=credentials)
logger.debug("authenticate called", extra={'credentials': credentials})

try:
user_token = jwt.decode(
Expand Down
8 changes: 2 additions & 6 deletions karp/search_infrastructure/repositories/unit_of_work.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
from karp.search.application import unit_of_work
from karp import search
from .sql_search_service import SqlSearchService


class SqlSearchServiceUnitOfWork(unit_of_work.SearchServiceUnitOfWork):
@classmethod
def from_dict(cls, **kwargs):
print(f"SqlIndexUnitOfWork.from_dict: kwargs = {kwargs}")
return cls()
class SqlSearchServiceUnitOfWork(search.IndexUnitOfWork):

def __init__(self, session_factory):
# session_factory=DEFAULT_SESSION_FACTORY):
Expand Down
25 changes: 0 additions & 25 deletions karp/webapp/containers.py

This file was deleted.

7 changes: 4 additions & 3 deletions karp/webapp/routes/resources_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def list_resource_permissions(

@router.get('/')
def get_all_resources(
get_resources: lex.GetResources = Depends(deps.inject_from_req(lex.GetResources)),
get_resources: lex.GetResources = Depends(
deps.inject_from_req(lex.GetResources)),
) -> list[dict]:
return get_resources.query()

Expand Down Expand Up @@ -129,8 +130,8 @@ def publishing_resource(
'resource_id': resource_id})
return
except Exception as err:
log.exception('error occured when publishing',
extra={'resource_id': resource_id, 'user': user.identifier})
logger.exception('error occured when publishing',
extra={'resource_id': resource_id, 'user': user.identifier})
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=f'{err=}',
Expand Down
2 changes: 1 addition & 1 deletion pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code.
extension-pkg-whitelist=
extension-pkg-whitelist=pydantic


extension-pkg-allow-list=dependency_injector
Expand Down