aiteamutils 0.2.76__tar.gz → 0.2.77__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiteamutils
3
- Version: 0.2.76
3
+ Version: 0.2.77
4
4
  Summary: AI Team Utilities
5
5
  Project-URL: Homepage, https://github.com/yourusername/aiteamutils
6
6
  Project-URL: Issues, https://github.com/yourusername/aiteamutils/issues
@@ -207,19 +207,18 @@ async def create_jwt_token(
207
207
 
208
208
  async def verify_jwt_token(
209
209
  token: str,
210
- expected_type: Optional[Literal["access", "refresh"]] = None
210
+ expected_type: Optional[Literal["access", "refresh"]] = None,
211
+ token_settings: Dict[str, Any] = None
211
212
  ) -> Dict[str, Any]:
212
213
  """JWT 토큰을 검증합니다."""
213
214
  try:
214
- settings = get_settings()
215
-
216
215
  # 토큰 디코딩
217
216
  payload = jwt.decode(
218
217
  token,
219
- settings.jwt_secret,
220
- algorithms=[settings.jwt_algorithm],
221
- audience=settings.token_audience,
222
- issuer=settings.token_issuer
218
+ token_settings["JWT_SECRET"],
219
+ algorithms=[token_settings["JWT_ALGORITHM"]],
220
+ audience=token_settings["TOKEN_AUDIENCE"],
221
+ issuer=token_settings["TOKEN_ISSUER"]
223
222
  )
224
223
 
225
224
  # 토큰 타입 검증
@@ -257,14 +256,16 @@ async def verify_jwt_token(
257
256
  original_error=e
258
257
  )
259
258
 
260
- def validate_token(token: str) -> Dict[str, Any]:
259
+ def validate_token(
260
+ token: str,
261
+ token_settings: Dict[str, Any] = None
262
+ ) -> Dict[str, Any]:
261
263
  """JWT 토큰을 검증하고 페이로드를 반환합니다."""
262
264
  try:
263
- settings = get_settings()
264
265
  payload = jwt.decode(
265
266
  token,
266
- settings.jwt_secret,
267
- algorithms=[settings.jwt_algorithm]
267
+ token_settings["JWT_SECRET"],
268
+ algorithms=[token_settings["JWT_ALGORITHM"]]
268
269
  )
269
270
  return payload
270
271
  except JWTError as e:
@@ -0,0 +1,2 @@
1
+ """버전 정보"""
2
+ __version__ = "0.2.77"
@@ -1,2 +0,0 @@
1
- """버전 정보"""
2
- __version__ = "0.2.76"
File without changes
File without changes
File without changes
File without changes