Flags
Flag
¶
Bases: ResponseModel
Represents a flag in CTFd.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id |
int
|
The ID of the flag |
required |
type |
FlagType
|
The type of the flag |
required |
challenge |
int
|
Alias for |
required |
challenge_id |
int
|
The ID of the challenge the flag is associated with |
required |
content |
str
|
The content of the flag |
required |
data |
str
|
Additional data for the flag, currently only supports |
required |
Attributes:
Name | Type | Description |
---|---|---|
id |
int
|
The ID of the flag, read-only |
type |
FlagType
|
The type of the flag |
challenge_id |
int
|
The ID of the challenge the flag is associated with |
content |
str
|
The content of the flag |
data |
str
|
Additional data for the flag, currently only supports |
Properties
is_case_insensitive : bool Whether the flag is case-insensitive or not
Source code in ctfdpy\models\flags.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
|
to_update_payload
¶
to_update_payload() -> UpdateFlagPayload
Converts the flag to a payload for updating flags.
Returns:
Type | Description |
---|---|
UpdateFlagPayload
|
The payload for updating flags |
Source code in ctfdpy\models\flags.py
69 70 71 72 73 74 75 76 77 78 |
|
FlagTypeInfo
¶
Bases: ResponseModel
Information about the flag type.
This is used internally by CTFd to create the UI modals for creating and updating flags.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the flag type |
required |
templates |
FlagTypeTemplatesDict
|
The templates for the flag type |
required |
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the flag type |
templates |
FlagTypeTemplatesDict
|
The templates for the flag type |
Source code in ctfdpy\models\flags.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
|
CreateFlagPayload
¶
Bases: CreatePayloadModel
Payload to create a flag in CTFd.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
type |
FlagType
|
The type of the flag |
required |
challenge |
int
|
Alias for |
required |
challenge_id |
int
|
The ID of the challenge the flag is associated with |
required |
content |
str
|
The content of the flag |
required |
data |
Literal['case_insensitive', '']
|
Additional data for the flag, currently only supports |
required |
Source code in ctfdpy\models\flags.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
|
UpdateFlagPayload
¶
Bases: UpdatePayloadModel
Payload to update a flag in CTFd.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
type |
FlagType
|
The type of the flag |
required |
challenge |
int
|
Alias for |
required |
challenge_id |
int
|
The ID of the challenge the flag is associated with |
required |
content |
str
|
The content of the flag |
required |
data |
Literal['case_insensitive', '']
|
Additional data for the flag, currently only supports |
required |
Attributes:
Name | Type | Description |
---|---|---|
type |
FlagType
|
The type of the flag |
challenge_id |
int
|
The ID of the challenge the flag is associated with |
content |
str
|
The content of the flag |
data |
Literal['case_insensitive', '']
|
Additional data for the flag, currently only supports |
Source code in ctfdpy\models\flags.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
|