Skip to content

split challenge.py into generic properties#214

Open
vellvoid wants to merge 2 commits into
CTFd:masterfrom
vellvoid:poc-properties
Open

split challenge.py into generic properties#214
vellvoid wants to merge 2 commits into
CTFd:masterfrom
vellvoid:poc-properties

Conversation

@vellvoid

Copy link
Copy Markdown
Collaborator

core/challenge.py has become the designated place for most of ctfcli's most-important functionality (managing challenges). Adding a new property to the challenge requires touching multiple places and further stuffing of that file - the architecture is just not scalable.

This PR introduces a concept of properties - each challenge property like flags, topics, files, name etc. is handled within its own class which knows how to install, sync, compare, pull that specific property. The challenge class just calls hooks for all known properties.

Adding a new property boils down to creating a new class (or using a generic one for simple properties like just a string), and registering it with the properties registry.

@vellvoid

Copy link
Copy Markdown
Collaborator Author

this builds on #213 to avoid conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant