Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Towards 2 challenges ressources #131

Open
pandatix opened this issue Dec 11, 2024 · 0 comments
Open

Towards 2 challenges ressources #131

pandatix opened this issue Dec 11, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@pandatix
Copy link
Member

CTFd datamodel around its challenges resources revolves around the following datamodel, form the UI.
There is a "challenge" that could be either a standard or dynamic, or something else with plugins (e.g. ctfd-chall-manager).

classDiagram
    class Challenge
    <<Abstract>> Challenge

    class Standard {
        ...
    }
    Standard --|> Challenge

    class Dynamic {
        ...
    }
    Dynamic --|> Challenge
Loading

From the backend, it is implemented as follows.
This suffers from limitations, like the value attribute being unused in Dynamic yet an initial is introduced, etc.

classDiagram
    class Standard {
        ...
    }

    class Dynamic {
        ...
    }
    Dynamic --|> Standard
Loading

The current TF implementation merges the two of them and infer behaviors toward the API, that lead to "one challenge to rule them all". My take on that was that technical debt would be absorbed by the implementation, providing a brand new API to the DevOps using the provider that would ease its job...

But now that we are working on the Terraform provider for the DynamicIACChallenge of the CTFd plugin for Chall-Manager, I don't see how it could be properly extended and documented.

My current take would be to split the challenge to 2 resources to better fit CTFd internals.
This would provide a better API and documentation to the DevOps, and ease the job of configuring exactly the resource you want.

I suggest ctfd_challenge_standard and ctfd_challenge_dynamic, such that plugins could cover other types like ctfd_challenge_dynamiciac or others.

Such changes would require a major tag change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant