Skip to content

Commit

Permalink
apply black new version
Browse files Browse the repository at this point in the history
  • Loading branch information
dianagudu committed Feb 16, 2024
1 parent 85f444d commit bf0cc42
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions motley_cue/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Executable for running motley_cue in development.
"""

import uvicorn


Expand Down
1 change: 1 addition & 0 deletions motley_cue/apis/v1/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module contains the definition of motley_cue's admin API.
"""

from fastapi import Request, Depends, Query, Header

from motley_cue.dependencies import mapper
Expand Down
1 change: 1 addition & 0 deletions motley_cue/apis/v1/root.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module contains the definition of motley_cue's REST router.
"""

from fastapi import Depends, Request, Query, Header
from fastapi.responses import HTMLResponse

Expand Down
1 change: 1 addition & 0 deletions motley_cue/apis/v1/user.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This module contains the definition of motley_cue's user API.
"""

from fastapi import Request, Depends, Header

from motley_cue.dependencies import mapper
Expand Down
1 change: 1 addition & 0 deletions motley_cue/dependencies.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Module containing global mapper object created from default configuration files.
"""

from typing import Optional
from pydantic import field_validator

Expand Down
1 change: 1 addition & 0 deletions motley_cue/mapper/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Map OIDC remote identity to local account"""

# This code is distributed under the MIT License

import sys
Expand Down
1 change: 1 addition & 0 deletions motley_cue/mapper/authorisation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Authorisation module for motley_cue API.
"""

from typing import Optional
from enum import Enum
import logging
Expand Down
1 change: 1 addition & 0 deletions motley_cue/mapper/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Module for loading and describing motley_cue configuration.
"""

from configparser import ConfigParser
from typing import List, Optional, Dict
import logging
Expand Down
1 change: 1 addition & 0 deletions motley_cue/mapper/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""exceptions definitions for motley_cue
"""

from typing import Union
from pydantic import ValidationError
from fastapi.exceptions import (
Expand Down
1 change: 1 addition & 0 deletions motley_cue/mapper/local_user_management.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Module for interfacing with local user management, i.e. FeudalAdapter.
"""

import logging
from enum import Enum

Expand Down
7 changes: 4 additions & 3 deletions motley_cue/mapper/token_manager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Module for managing one-time tokens and the (long) Access Tokens they are derived from.
"""

from abc import abstractmethod
import os
from typing import Callable, Optional
Expand Down Expand Up @@ -457,9 +458,9 @@ def _replace_token_in_kwargs(kwargs: dict, token: str) -> dict:
if authz_header and authz_header.startswith("Bearer "):
new_headers = kwargs["request"].headers.mutablecopy()
new_headers["authorization"] = f"Bearer {token}"
kwargs[
"request"
]._headers = new_headers # pylint: disable=protected-access
kwargs["request"]._headers = (
new_headers # pylint: disable=protected-access
)
kwargs["request"].scope.update(headers=new_headers.raw)
return kwargs

Expand Down
1 change: 1 addition & 0 deletions motley_cue/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Definitions of API response models
"""

from typing import Optional, Union, List, Dict
from pydantic.dataclasses import dataclass
from pydantic import Field
Expand Down
1 change: 1 addition & 0 deletions motley_cue/static.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Helper module for serving static files."""

import markdown


Expand Down

1 comment on commit bf0cc42

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage for this commit

87.61%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
motley_cue
   __init__.py100%100%100%100%
   __main__.py0%100%100%0%12–13, 4, 7, 9
   _version.py100%100%100%100%
   api.py81.40%100%100%81.40%44–45, 50, 53–54, 59, 65–66
   dependencies.py93.75%100%100%93.75%29, 45
   models.py100%100%100%100%
   static.py33.33%100%100%33.33%39–40, 42–45
motley_cue/apis
   __init__.py100%100%100%100%
   utils.py92.86%100%100%92.86%13
motley_cue/apis/v1
   __init__.py100%100%100%100%
   admin.py100%100%100%100%
   api.py100%100%100%100%
   root.py96.30%100%100%96.30%139
   user.py100%100%100%100%
motley_cue/mapper
   __init__.py59.57%100%100%59.57%100, 106, 113, 120, 128, 135–138, 144–145, 151–152, 158–160, 168, 174, 181–182, 191–192, 196, 199–205, 30–31, 33–34, 37, 39, 57, 94
   authorisation.py91.59%100%100%91.59%100, 139–141, 147, 205, 41, 54, 67
   config.py83.76%100%100%83.76%100, 114, 117–121, 131–139, 154–158, 162–163, 202–205, 214–216, 239, 269, 272–274, 276, 280, 357
   exceptions.py96.88%100%100%96.88%31
   local_user_management.py90.11%100%100%90.11%161–162, 164–168, 75–76
   token_manager.py95.31%100%100%95.31%165, 202, 244, 279, 378, 380, 384, 398, 451–452, 64–65, 69

Please sign in to comment.