aiteamutils 0.2.78__tar.gz → 0.2.79__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {aiteamutils-0.2.78 → aiteamutils-0.2.79}/PKG-INFO +1 -1
- {aiteamutils-0.2.78 → aiteamutils-0.2.79}/aiteamutils/security.py +3 -5
- aiteamutils-0.2.79/aiteamutils/version.py +2 -0
- aiteamutils-0.2.78/aiteamutils/version.py +0 -2
- {aiteamutils-0.2.78 → aiteamutils-0.2.79}/.cursorrules +0 -0
- {aiteamutils-0.2.78 → aiteamutils-0.2.79}/.gitignore +0 -0
- {aiteamutils-0.2.78 → aiteamutils-0.2.79}/README.md +0 -0
- {aiteamutils-0.2.78 → aiteamutils-0.2.79}/aiteamutils/__init__.py +0 -0
- {aiteamutils-0.2.78 → aiteamutils-0.2.79}/aiteamutils/base_model.py +0 -0
- {aiteamutils-0.2.78 → aiteamutils-0.2.79}/aiteamutils/base_repository.py +0 -0
- {aiteamutils-0.2.78 → aiteamutils-0.2.79}/aiteamutils/base_service.py +0 -0
- {aiteamutils-0.2.78 → aiteamutils-0.2.79}/aiteamutils/cache.py +0 -0
- {aiteamutils-0.2.78 → aiteamutils-0.2.79}/aiteamutils/config.py +0 -0
- {aiteamutils-0.2.78 → aiteamutils-0.2.79}/aiteamutils/database.py +0 -0
- {aiteamutils-0.2.78 → aiteamutils-0.2.79}/aiteamutils/enums.py +0 -0
- {aiteamutils-0.2.78 → aiteamutils-0.2.79}/aiteamutils/exceptions.py +0 -0
- {aiteamutils-0.2.78 → aiteamutils-0.2.79}/aiteamutils/validators.py +0 -0
- {aiteamutils-0.2.78 → aiteamutils-0.2.79}/pyproject.toml +0 -0
- {aiteamutils-0.2.78 → aiteamutils-0.2.79}/setup.py +0 -0
@@ -1,19 +1,17 @@
|
|
1
1
|
"""보안 관련 유틸리티."""
|
2
2
|
from datetime import datetime, timedelta, timezone
|
3
|
-
from typing import Dict, Any, Optional, Literal, Callable, TYPE_CHECKING, TypeVar
|
3
|
+
from typing import Dict, Any, Optional, Literal, Callable, TYPE_CHECKING, TypeVar
|
4
4
|
from fastapi import Request, HTTPException, status
|
5
5
|
from functools import wraps
|
6
6
|
from jose import jwt, JWTError
|
7
7
|
from passlib.context import CryptContext
|
8
8
|
import logging
|
9
9
|
from sqlalchemy.ext.asyncio import AsyncSession
|
10
|
-
from sqlalchemy.orm import DeclarativeBase
|
11
10
|
from .exceptions import CustomException, ErrorCode
|
12
11
|
from .enums import ActivityType
|
13
|
-
from .database import log_create
|
14
12
|
|
15
13
|
pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")
|
16
|
-
ModelType = TypeVar("ModelType"
|
14
|
+
ModelType = TypeVar("ModelType")
|
17
15
|
|
18
16
|
# 전역 rate limit 상태 저장
|
19
17
|
_rate_limits: Dict[str, Dict[str, Any]] = {}
|
@@ -134,7 +132,7 @@ def rate_limit(
|
|
134
132
|
return decorator
|
135
133
|
|
136
134
|
async def create_jwt_token(
|
137
|
-
user_data:
|
135
|
+
user_data: Optional[ModelType],
|
138
136
|
token_type: Literal["access", "refresh"],
|
139
137
|
db_session: AsyncSession,
|
140
138
|
token_settings: Dict[str, Any],
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|