Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /Pushikoo_Pushikoo /backend /src /pushikoo /api /security.py
| from datetime import datetime, timedelta, timezone | |
| from typing import Optional | |
| import jwt | |
| from pushikoo.util.setting import settings | |
| def create_access_token(data: dict, expires_minutes: Optional[int] = None) -> str: | |
| to_encode = data.copy() | |
| expire_minutes = ( | |
| expires_minutes | |
| if expires_minutes is not None | |
| else settings.ACCESS_TOKEN_EXPIRE_MINUTES | |
| ) | |
| expire = datetime.now(timezone.utc) + timedelta(minutes=expire_minutes) | |
| to_encode.update({"exp": expire}) | |
| secret = settings.SSO_CLIENT_SECRET or "dev-secret" | |
| return jwt.encode(to_encode, secret, algorithm="HS256") | |
Xet Storage Details
- Size:
- 621 Bytes
- Xet hash:
- bcc29f8917cfff06a1ddc1c75d45dd92ca8f8e966e9b9a4d889e73a3a4220e3e
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.