Skip to content
This repository has been archived by the owner on Sep 3, 2023. It is now read-only.

Commit

Permalink
Checkpoint Commit
Browse files Browse the repository at this point in the history
Signed-off-by: Arpan Mahanty <[email protected]>
  • Loading branch information
ShadowXBoss696 committed Apr 14, 2023
1 parent a88237e commit e1d6c40
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 113 deletions.
10 changes: 6 additions & 4 deletions jukebox/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ async def event_shutdown():
public_router = APIRouter()


@public_router.get("/healthcheck")
async def healthcheck() -> dict:
@public_router.get("/health-check")
async def health_check() -> dict:
return {"status": "ok"}


Expand All @@ -51,12 +51,14 @@ async def private() -> dict:


# Include API routers
app.include_router(
app.include_router( # For public router
private_router, prefix=API_PREFIX,
dependencies=[Depends(has_access)],
responses={
401: {"description": "Invalid or expired token"}, # HTTP_401_UNAUTHORIZED
403: {"description": "User does not have permission to access this resource"} # HTTP_403_FORBIDDEN
},
)
app.include_router(public_router, prefix=API_PREFIX)
app.include_router( # For private router
public_router, prefix=API_PREFIX,
)
4 changes: 2 additions & 2 deletions jukebox/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ def generate_password_hash(secret: str) -> str:
return pwd_context.hash(secret)


def validate_password(secret: str, hash: str) -> bool:
def validate_password(secret: str, hashed_secret: str) -> bool:
"""Validates the password hash"""
return pwd_context.verify(secret, hash)
return pwd_context.verify(secret, hashed_secret)
8 changes: 0 additions & 8 deletions migrations/20230327_01_JN5tH-initial-schema.sql

This file was deleted.

4 changes: 4 additions & 0 deletions migrations/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Migrations Directory

The migrations directory contains a series of migration scripts. Each migration script is a Python (.py) or
SQL file (.sql).
Loading

0 comments on commit e1d6c40

Please sign in to comment.