Skip to content
This repository was archived by the owner on Apr 3, 2025. It is now read-only.
This repository was archived by the owner on Apr 3, 2025. It is now read-only.

Challenges #3

@ThEditor

Description

@ThEditor

Description

These endpoints handle everything to do with challenges.

Endpoints

  • GET /chall/all : Retrieves and responds with all challenges data. Adds entry of solved: boolean to the retrieved data according to the sessionId/participantId/teamId.
  • GET /chall/[id] : Retrieves and responds with challenge data having the specified id. Adds entry of solved: boolean to the retrieved data according to the sessionId/participantId/teamId.
  • POST /chall/solve : Accepts flag text and challenge id, resolves if the challenge was solved and awards points to participant & team, Responds with success/failure. It will also decrease challenge's points using the dynamic points formula. (Points are awarded using the sessionId)
  • POST /chall/hint : Responds with a hint and deducts X points from that participant & team. (Use sessionId to determine team & participant)

Objects/Entities

interface Challenge {
  id: string; // UUID
  title: string;
  category: string;
  description: string;
  hint: string;
  attachments: {
    url: string;
    type: string;
  }[];
  flag: string; // Not plain text, encrypt this
  points: number;
  solvedByEntities: string[]; // contains ids of participants/teams that have solved this challenge
}

Note

Make sure participants are not able to re-enter a flag to get points again.
Make sure that no sensitive data (such as flag, hint or solvedByEntities) is sent to the wrong endpoints.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions