Skip to content

Commit

Permalink
Fix mypy typing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobsvante committed Mar 29, 2021
1 parent d92b186 commit 10e5e40
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions fastapi_security/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logging
from typing import Callable, Iterable, List, Optional, Type
from typing import Callable, Dict, Iterable, List, Optional, Type

from fastapi import Depends, HTTPException
from fastapi.security.http import HTTPAuthorizationCredentials
Expand Down Expand Up @@ -27,7 +27,7 @@ def __init__(self, *, user_permission_class: Type[UserPermission] = UserPermissi
self.basic_auth = BasicAuthValidator()
self.oauth2_jwt = Oauth2JwtAccessTokenValidator()
self.oidc_discovery = OpenIdConnectDiscovery()
self._permission_overrides: PermissionOverrides = {}
self._permission_overrides: Dict[str, List[str]] = {}
self._user_permission_class = user_permission_class
self._all_permissions: List[UserPermission] = []
self._oauth2_init_through_oidc = False
Expand Down Expand Up @@ -77,7 +77,7 @@ def add_permission_overrides(self, overrides: PermissionOverrides):
"""
for user, val in overrides.items():
lst = self._permission_overrides.setdefault(user, [])
lst: List[str] = self._permission_overrides.setdefault(user, [])
if isinstance(val, str):
assert (
val == "*"
Expand Down
4 changes: 2 additions & 2 deletions fastapi_security/permissions.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import Dict, Iterable, Union
from typing import Dict, MutableSequence, Union

__all__ = ("PermissionOverrides",)


PermissionOverrides = Dict[str, Union[str, Iterable[str]]]
PermissionOverrides = Dict[str, Union[str, MutableSequence[str]]]


class UserPermission:
Expand Down

0 comments on commit 10e5e40

Please sign in to comment.