aboutsummaryrefslogtreecommitdiffstats
path: root/backend (follow)
Commit message (Collapse)AuthorAgeLines
* Add Role Based Authorized ReadersGravatar Hassan Abouelela2022-02-05-14/+73
| | | | | | | Adds a new property on forms to declare which roles are authorized to access form responses. Signed-off-by: Hassan Abouelela <[email protected]>
* Overhaul Scope SystemGravatar Hassan Abouelela2022-02-05-60/+246
| | | | | | | Adds discord role support to the pre-existing scopes system to power more complex access permissions. Signed-off-by: Hassan Abouelela <[email protected]>
* Add Helper Functions For Managing RolesGravatar Hassan Abouelela2022-01-22-9/+130
| | | | Signed-off-by: Hassan Abouelela <[email protected]>
* Don't include user mention for anonymous form submissionsGravatar Chris Lovering2022-01-21-1/+5
| | | | | | We currently use WEBHOOK_ENABLED to determine whether user data should be stored to the db. However, when webhooking a form submission this config is ignored, and the user mention is always included if available. This means that if a user login in using another form, and then submits an anonymous form with the same session, their name will be included in the webhook.
* Model: makes Form.id case insensitiveGravatar Matteo Bertucci2021-12-26-11/+8
| | | | Note that it will make any existing form with an upper case letter impossible to access until its ID is changed, which shouldn't be the case in production according to @HassanAbouelela
* Hash Cf-Connecting-IP if given, else remote hostGravatar Joe Banks2021-12-25-1/+5
|
* Uses Backend URL In EmbedGravatar Hassan Abouelela2021-07-06-1/+1
| | | | | | | Temporarily switches the URL in discord embeds from the frontend, to the backend, to allow for easier viewing until the frontend is ready. Signed-off-by: Hassan Abouelela <[email protected]>
* Merge pull request #92 from python-discord/unittest_failuresGravatar Hassan Abouelela2021-06-20-16/+101
|\ | | | | Allow Unittest Failures
| * Updates Unittest Filter To Match New ModelGravatar Hassan Abouelela2021-06-19-1/+1
| | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]>
| * Verifies Unittest Error ResponsesGravatar Hassan Abouelela2021-06-03-1/+14
| | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]>
| * Handles Code Questions With No TestsGravatar Hassan Abouelela2021-06-03-1/+13
| | | | | | | | | | | | Adds a check to handle code questions with no test suites. Signed-off-by: Hassan Abouelela <[email protected]>
| * Clarify Validator SemanticsGravatar Hassan Abouelela2021-06-03-1/+1
| | | | | | | | | | Co-authored-by: Chris <[email protected]> Signed-off-by: Hassan Abouelela <[email protected]>
| * Adds Missing DocstringsGravatar Hassan Abouelela2021-06-02-0/+3
| | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]>
| * Documents Return Code Gravatar Hassan Abouelela2021-06-02-0/+1
| | | | | | | | | | Adds a comment which explains when a certain return_code is used. Co-authored-by: Joe Banks <[email protected]>
| * Uses 422 For Failed Tests Gravatar Hassan Abouelela2021-06-02-1/+1
| | | | | | | | | | Uses 422 instead of 403 to indicate a test has failed. Co-authored-by: Joe Banks <[email protected]>
| * Reports All Unittest Failure ReasonsGravatar Hassan Abouelela2021-06-02-2/+9
| | | | | | | | | | | | Records the reason of failure for non-zero exit codes. Signed-off-by: Hassan Abouelela <[email protected]>
| * Records Failed UnittestsGravatar Hassan Abouelela2021-06-02-8/+33
| | | | | | | | | | | | | | Adds logic for saving submissions of failed unittests. Updates schema docs. Signed-off-by: Hassan Abouelela <[email protected]>
| * Adds Code Question ModelGravatar Hassan Abouelela2021-06-02-5/+29
| | | | | | | | | | | | | | Adds an explicit model for questions of type `code`, to allow more complex parsing. Updates schema docs. Signed-off-by: Hassan Abouelela <[email protected]>
* | Merge pull request #90 from python-discord/auth-formGravatar Hassan Abouelela2021-06-20-5/+37
|\ \ | | | | | | Empty Authorization Form
| * | Adds An Empty Form For AuthorizationGravatar Hassan Abouelela2021-05-17-5/+37
| | | | | | | | | | | | | | | | | | | | | Returns a form with no questions, if the server is not running in production, and no other forms are found, to aid in setting up. Signed-off-by: Hassan Abouelela <[email protected]>
* | | Handles Null WebhooksGravatar Hassan Abouelela2021-06-04-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | The form model specifies webhook as nullable, but the validator code does not properly handle them. This PR adds logic to handle that scenario. Signed-off-by: Hassan Abouelela <[email protected]>
* | | Reverts "Validates Form Patch Request"Gravatar Hassan Abouelela2021-06-03-2/+6
| |/ |/| | | | | | | | | | | Reverts the changes made in 4f28ae85 because they made it impossible to send a partial patch request. Changes to a simpler try/except instead. Signed-off-by: Hassan Abouelela <[email protected]>
* | Set Form Viewing URLGravatar Hassan Abouelela2021-05-30-1/+1
| | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]>
* | Validates Form Patch RequestGravatar Hassan Abouelela2021-05-30-1/+3
|/ | | | | | Makes sure patch requests send a validated request. Signed-off-by: Hassan Abouelela <[email protected]>
* Adds A Dev Only Endpoint For Adding AdminsGravatar Hassan Abouelela2021-05-15-8/+35
| | | | | | | Copies the admin adding endpoint into an unprotected endpoint that is only registered in non-production builds. Signed-off-by: Hassan Abouelela <[email protected]>
* Merge branch 'main' into ks123/role-assigningGravatar ks1292021-03-16-1/+3
|\
| * Merge branch 'main' into dependabot/pip/sentry-sdk-0.20.3Gravatar Hassan Abouelela2021-03-15-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]> # Conflicts: # poetry.lock # pyproject.toml
| * \ Merge branch 'main' into dependabot/pip/sentry-sdk-0.20.3Gravatar Hassan Abouelela2021-03-08-59/+228
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]> # Conflicts: # backend/__init__.py # poetry.lock
| * \ \ Merge branch 'main' into dependabot/pip/sentry-sdk-0.20.3Gravatar Hassan Abouelela2021-02-28-8/+161
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]> # Conflicts: # poetry.lock
| * | | | Sets Sentry SDK EnvironmentGravatar Hassan Abouelela2021-02-21-2/+4
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]>
* | | | | Add back removed parenthesisGravatar ks1292021-03-16-1/+1
| | | | |
* | | | | Split if statement to multiple lines to avoid noqaGravatar ks1292021-03-16-1/+4
| | | | |
* | | | | Split public fields constant to multiple linesGravatar ks1292021-03-16-1/+9
| | | | |
* | | | | Use value of enum member instead of member itselfGravatar ks1292021-03-16-3/+3
| | | | |
* | | | | Add discord_role to public fieldsGravatar ks1292021-03-16-1/+1
| | | | |
* | | | | Simplify role assigning rate limit handlingGravatar ks1292021-03-09-12/+6
| | | | | | | | | | | | | | | Co-authored-by: Hassan Abouelela <[email protected]>
* | | | | Merge branch 'main' into ks123/role-assigningGravatar ks1292021-03-09-57/+378
|\ \ \ \ \ | | |_|_|/ | |/| | |
| * | | | Fixes Production URL ConstantGravatar Hassan Abouelela2021-03-08-1/+1
| | |_|/ | |/| | | | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]>
| * | | Corrects Token Cookie DomainGravatar Hassan Abouelela2021-03-07-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | Removes schema from the token cookie's domain field. Signed-off-by: Hassan Abouelela <[email protected]>
| * | | Switches Forwarded Protocol HeaderGravatar Hassan Abouelela2021-03-07-12/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Traefik forwards https traffic to http, which causes issues with the protocol in a request's URL. This switch uses the protocol header to correctly set the protocol. Signed-off-by: Hassan Abouelela <[email protected]>
| * | | Corrects Domain On Token CookieGravatar Hassan Abouelela2021-03-07-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Correctly formats the domain set on the cookie used for tokens. Signed-off-by: Hassan Abouelela <[email protected]>
| * | | Corrects Domain On Token CookieGravatar Hassan Abouelela2021-03-07-2/+3
| | | | | | | | | | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]>
| * | | Fixes Domain URL On Token CookieGravatar Hassan Abouelela2021-03-07-11/+18
| | | | | | | | | | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]>
| * | | Makes Helper To Handle Token SameSite LogicGravatar Hassan Abouelela2021-03-07-19/+45
| | | | | | | | | | | | | | | | | | | | | | | | Adds a helper method to allow tokens to work on deploy previews. Signed-off-by: Hassan Abouelela <[email protected]>
| * | | Revert "Sets Token Cookie To Same Site To Lax"Gravatar Hassan Abouelela2021-03-06-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 013ea900 Signed-off-by: Hassan Abouelela <[email protected]>
| * | | Sets Token Cookie To Same Site To LaxGravatar Hassan Abouelela2021-03-06-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Sets the authorization token cookie's security policy to lax, to allow it to work on the site. Signed-off-by: Hassan Abouelela <[email protected]>
| * | | Formats Authorize FileGravatar Hassan Abouelela2021-03-06-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleans up the authorize file, and the __init__ to maintain the project's code style. Co-authored-by: Joe Banks <[email protected]> Signed-off-by: Hassan Abouelela <[email protected]>
| * | | Renames Token To `token` Gravatar Hassan Abouelela2021-03-06-4/+4
| | | | | | | | | | | | | | | | | | | | Changes the name for the token used to authorize with the backend. Co-authored-by: Joe Banks <[email protected]>
| * | | Make Admin Fetch AsyncGravatar Hassan Abouelela2021-03-01-3/+3
| | | | | | | | | | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]>
| * | | Allows All CORS Requests On DevelopmentGravatar Hassan Abouelela2021-03-01-2/+2
| | | | | | | | | | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]>