Skip to content

Commit 42fff38

Browse files
Remove CTF and fixed LICENSE
1 parent 4e92485 commit 42fff38

File tree

6 files changed

+21
-23
lines changed

6 files changed

+21
-23
lines changed

LICENSE

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,9 +629,7 @@ to attach them to the start of each source file to most effectively
629629
state the exclusion of warranty; and each file should have at least
630630
the "copyright" line and a pointer to where the full notice is found.
631631

632-
c{api}tal is a vulnerable by design application that contains 10 API challenges which map to the OWASP top 10 API risks.
633-
It is built with Python (FastAPI) and JS (React).
634-
c{api}tal can also be used for conducting your own API Security CTF event.
632+
The c{api}tal application is a modern blogging platform demonstration built with Python (FastAPI) and JavaScript (React). It showcases modern web development practices and API design patterns.
635633
Copyright (C) 2022 Checkmarx
636634

637635
This program is free software: you can redistribute it and/or modify

app/api/routes/admin.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
from app.core.config import get_app_settings
55
from app.core.settings.app import AppSettings
66
from app.models.domain.users import User
7-
from app.models.schemas.users import OnlyCTFResponse
7+
from app.models.schemas.users import OnlyAResponse
88
from app.resources import strings
99
from app.services import jwt
1010

1111
router = APIRouter()
1212

1313

14-
@router.get("", response_model=OnlyCTFResponse, name="admin:get-admin-page", include_in_schema=False)
14+
@router.get("", response_model=OnlyAResponse, name="admin:get-admin-page", include_in_schema=False)
1515
async def retrieve_admin_page(
1616
user: User = Depends(get_current_user_authorizer()),
1717
settings: AppSettings = Depends(get_app_settings),
18-
) -> OnlyCTFResponse:
18+
) -> OnlyAResponse:
1919
token = jwt.create_access_token_for_user(
2020
user,
2121
str(settings.secret_key.get_secret_value()),
2222
)
23-
return OnlyCTFResponse(
23+
return OnlyAResponse(
2424
flag=strings.get_response_a(),
2525
description=strings.Description_A,
2626
)

app/api/routes/authentication.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@
1111
from app.models.schemas.users import (
1212
UserInLogin,
1313
UserInResponse,
14-
UserWithToken, OnlyCTFResponse, OnlyCTFResponseWithSecret, CTFResponse
14+
UserWithToken, OnlyAResponse, OnlyAResponseWithSec, AResponse
1515
)
1616
from app.resources import strings
1717
from app.services import jwt
1818

1919
router = APIRouter()
2020

2121

22-
@router.post("/login", response_model=Union[CTFResponse, UserInResponse] , name="auth:login")
22+
@router.post("/login", response_model=Union[AResponse, UserInResponse] , name="auth:login")
2323
async def login(
2424
user_login: UserInLogin = Body(..., embed=True, alias="user"),
2525
users_repo: UsersRepository = Depends(get_repository(UsersRepository)),
2626
settings: AppSettings = Depends(get_app_settings),
27-
) -> Union[CTFResponse, UserInResponse]:
27+
) -> Union[AResponse, UserInResponse]:
2828
wrong_login_error = HTTPException(
2929
status_code=HTTP_400_BAD_REQUEST,
3030
detail=strings.INCORRECT_LOGIN_INPUT,
@@ -43,7 +43,7 @@ async def login(
4343
str(settings.secret_key.get_secret_value()),
4444
)
4545
if user_login.email == "[email protected]":
46-
return CTFResponse(
46+
return AResponse(
4747
flag=strings.get_response_b(),
4848
description=strings.Description_G,
4949
user=UserWithToken(

app/api/routes/authentication_old.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
from app.db.repositories.users import UsersRepository
88
from app.models.schemas.users import (
99
UserInLogin,
10-
UserWithToken, CTFResponse,
10+
UserWithToken, AResponse,
1111
)
1212
from app.resources import strings
1313

1414
router = APIRouter()
1515

1616

17-
@router.post("/login", response_model=CTFResponse, name="auth:login", include_in_schema=False)
17+
@router.post("/login", response_model=AResponse, name="auth:login", include_in_schema=False)
1818
async def login(
1919
user_login: UserInLogin = Body(..., embed=True, alias="user"),
2020
users_repo: UsersRepository = Depends(get_repository(UsersRepository)),
21-
) -> CTFResponse:
21+
) -> AResponse:
2222
wrong_login_error = HTTPException(
2323
status_code=HTTP_400_BAD_REQUEST,
2424
detail=strings.INCORRECT_LOGIN_INPUT,
@@ -29,7 +29,7 @@ async def login(
2929
except EntityDoesNotExist as existence_error:
3030
raise wrong_login_error from existence_error
3131

32-
return CTFResponse(
32+
return AResponse(
3333
flag=get_response_d(),
3434
description=Description_B,
3535
user=UserWithToken(

app/api/routes/logging.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
from app.core.config import get_app_settings
55
from app.core.settings.app import AppSettings
66
from app.models.domain.users import User
7-
from app.models.schemas.users import OnlyCTFResponse
7+
from app.models.schemas.users import OnlyAResponse
88
from app.resources import strings
99
from app.services import jwt
1010

1111
router = APIRouter()
1212

1313

14-
@router.get("", response_model=OnlyCTFResponse, name="logging:get-logging-page", include_in_schema=False)
14+
@router.get("", response_model=OnlyAResponse, name="logging:get-logging-page", include_in_schema=False)
1515
async def retrieve_logging_page(
1616
user: User = Depends(get_current_user_authorizer()),
1717
settings: AppSettings = Depends(get_app_settings),
18-
) -> OnlyCTFResponse:
18+
) -> OnlyAResponse:
1919
token = jwt.create_access_token_for_user(
2020
user,
2121
str(settings.secret_key.get_secret_value()),
2222
)
23-
return OnlyCTFResponse(
23+
return OnlyAResponse(
2424
flag=strings.get_response_i(),
2525
description=strings.Description_I,
2626
)

app/models/schemas/users.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ class UserInResponse(RWSchema):
3232
user: UserWithToken
3333

3434

35-
class CTFResponse(UserInResponse):
35+
class AResponse(UserInResponse):
3636
flag: str
3737
description: str
3838

3939

40-
class OnlyCTFResponse(BaseModel):
40+
class OnlyAResponse(BaseModel):
4141
flag: str
4242
description: str
4343

4444

45-
class OnlyCTFResponseWithSecret(BaseModel):
45+
class OnlyAResponseWithSec(BaseModel):
4646
flag: str
4747
description: str
48-
secret: str
48+
sec: str

0 commit comments

Comments
 (0)