encryptare + adaugare de imagini

This commit is contained in:
andrei-mihnea-cerbu
2024-01-19 04:05:05 +02:00
parent 67b7a241d7
commit 2d4cca0e80
11 changed files with 167 additions and 48 deletions
@@ -0,0 +1,18 @@
from fastapi import APIRouter, Header, HTTPException
from .get_private_key import get_private_key
'''
The 'messages' packages contains the router configuration for the 'Messages' endpoints.
'''
router = APIRouter()
@router.get("/get_private_key")
async def get_private_key_router(authorization_key: str = Header('Authorization_Key', convert_underscores=False)):
expected_value = 'messenger'
if not authorization_key == expected_value:
raise HTTPException(status_code=401, detail="Unauthorized: Incorrect header value")
return get_private_key()
__all__ = ["router"]
@@ -0,0 +1,6 @@
def get_private_key():
# Your implementation to retrieve the private key goes here
# For testing purposes, return a dummy private key
return {"private_key": '8f0240aeb3fe8e16'}
Binary file not shown.
+2
View File
@@ -2,9 +2,11 @@ from fastapi import FastAPI
from api.v1.endpoints.users import router as users_router
from api.v1.endpoints.messages import router as messages_router
from api.v1.endpoints.auth import router as auth_router
from api.v1.endpoints.encryption_key import router as encryption_key_router
app = FastAPI()
app.include_router(users_router, tags=["Users"], prefix="/users")
app.include_router(messages_router, tags=["Messages"], prefix="/messages")
app.include_router(auth_router, tags=["Auth"], prefix="/auth")
app.include_router(encryption_key_router, tags=["Encryption"], prefix="/encryption")