CoolFace
Apppublic

SRNI-2005/ctf

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
__init__.py76 linesDownload Raw Back to api
1from flask import Blueprint, current_app2from flask_restx import Api3 4from CTFd.api.v1.awards import awards_namespace5from CTFd.api.v1.brackets import brackets_namespace6from CTFd.api.v1.challenges import challenges_namespace7from CTFd.api.v1.comments import comments_namespace8from CTFd.api.v1.config import configs_namespace9from CTFd.api.v1.exports import exports_namespace10from CTFd.api.v1.files import files_namespace11from CTFd.api.v1.flags import flags_namespace12from CTFd.api.v1.hints import hints_namespace13from CTFd.api.v1.notifications import notifications_namespace14from CTFd.api.v1.pages import pages_namespace15from CTFd.api.v1.schemas import (16    APIDetailedSuccessResponse,17    APISimpleErrorResponse,18    APISimpleSuccessResponse,19)20from CTFd.api.v1.scoreboard import scoreboard_namespace21from CTFd.api.v1.shares import shares_namespace22from CTFd.api.v1.solutions import solutions_namespace23from CTFd.api.v1.statistics import statistics_namespace24from CTFd.api.v1.submissions import submissions_namespace25from CTFd.api.v1.tags import tags_namespace26from CTFd.api.v1.teams import teams_namespace27from CTFd.api.v1.tokens import tokens_namespace28from CTFd.api.v1.topics import topics_namespace29from CTFd.api.v1.unlocks import unlocks_namespace30from CTFd.api.v1.users import users_namespace31 32api = Blueprint("api", __name__, url_prefix="/api/v1")33CTFd_API_v1 = Api(34    api,35    version="v1",36    doc=current_app.config.get("SWAGGER_UI_ENDPOINT"),37    authorizations={38        "AccessToken": {39            "type": "apiKey",40            "in": "header",41            "name": "Authorization",42            "description": "Generate access token in the settings page of your user account.",43        },44    },45    security=["AccessToken"],46)47 48CTFd_API_v1.schema_model("APISimpleErrorResponse", APISimpleErrorResponse.schema())49CTFd_API_v1.schema_model(50    "APIDetailedSuccessResponse", APIDetailedSuccessResponse.schema()51)52CTFd_API_v1.schema_model("APISimpleSuccessResponse", APISimpleSuccessResponse.schema())53 54CTFd_API_v1.add_namespace(challenges_namespace, "/challenges")55CTFd_API_v1.add_namespace(tags_namespace, "/tags")56CTFd_API_v1.add_namespace(topics_namespace, "/topics")57CTFd_API_v1.add_namespace(awards_namespace, "/awards")58CTFd_API_v1.add_namespace(hints_namespace, "/hints")59CTFd_API_v1.add_namespace(flags_namespace, "/flags")60CTFd_API_v1.add_namespace(submissions_namespace, "/submissions")61CTFd_API_v1.add_namespace(scoreboard_namespace, "/scoreboard")62CTFd_API_v1.add_namespace(teams_namespace, "/teams")63CTFd_API_v1.add_namespace(users_namespace, "/users")64CTFd_API_v1.add_namespace(statistics_namespace, "/statistics")65CTFd_API_v1.add_namespace(files_namespace, "/files")66CTFd_API_v1.add_namespace(notifications_namespace, "/notifications")67CTFd_API_v1.add_namespace(configs_namespace, "/configs")68CTFd_API_v1.add_namespace(pages_namespace, "/pages")69CTFd_API_v1.add_namespace(unlocks_namespace, "/unlocks")70CTFd_API_v1.add_namespace(tokens_namespace, "/tokens")71CTFd_API_v1.add_namespace(comments_namespace, "/comments")72CTFd_API_v1.add_namespace(shares_namespace, "/shares")73CTFd_API_v1.add_namespace(brackets_namespace, "/brackets")74CTFd_API_v1.add_namespace(exports_namespace, "/exports")75CTFd_API_v1.add_namespace(solutions_namespace, "/solutions")76