Skip to content

Commit

Permalink
Dont run other CI checks
Browse files Browse the repository at this point in the history
  • Loading branch information
vmcj committed Jan 24, 2022
1 parent 7b20ab3 commit 18ddf38
Show file tree
Hide file tree
Showing 24 changed files with 94 additions and 143 deletions.
19 changes: 0 additions & 19 deletions .github/workflows/codespell.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/crunch42-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "42Crunch REST API Static Security Testing"

# follow standard Code Scanning triggers
on:
push:
branches: [ main ]
pull_request_target:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '19 4 * * 3'

jobs:
rest-api-static-security-testing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install DOMjudge
run: .github/workflowscripts/baseinstall.sh

- name: Dump the OpenAPI
run: .github/workflowscripts/getapi.sh

- name: Find all other JSON files and delete those
run: |
rm -rf ./installdir/domserver/lib/vendor ./lib/vendor
rm -f ./doc/manual/sphinx-team.json ./doc/manual/sphinx-team.json
find ./ -name "*.json"
- name: 42Crunch REST API Static Security Testing
uses: 42Crunch/api-security-audit-action@v1
with:
# Follow these steps to configure API_SECRET https://docs.42crunch.com/latest/content/tasks/integrate_github_actions.htm
api-token: ${{ secrets.API_SECRET }}
min-score: 9
# Upload results to Github code scanning
upload-to-code-scanning: true
# Github token for uploading the results
github-token: ${{ github.token }}
ignore-failures: false

41 changes: 0 additions & 41 deletions .github/workflows/mayhem-api.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/shiftleft.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .gitlab-ci.yml

This file was deleted.

16 changes: 13 additions & 3 deletions webapp/config/packages/nelmio_api_doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ nelmio_api_doc:
components:
securitySchemes:
basicAuth:
type: http
type: https
scheme: basic
parameters:
cid:
Expand All @@ -19,6 +19,8 @@ nelmio_api_doc:
required: true
schema:
type: string
pattern: "^[A-Za-z0-9]{1,255}$"
maxLength: 255
examples:
int0:
value: "2"
Expand All @@ -36,6 +38,8 @@ nelmio_api_doc:
required: true
schema:
type: integer
minimum: 1
maximum: 9999
examples:
balloon:
value: 1
Expand All @@ -46,7 +50,10 @@ nelmio_api_doc:
description: The ID of the entity to get
required: true
schema:
$ref: "#/components/schemas/Id"
type: string
pattern: "^[A-Za-z0-9]{1,255}$"
maxLength: 255
examples:
generic:
value: "1"
Expand All @@ -68,8 +75,7 @@ nelmio_api_doc:
schema:
type: array
items:
type: string
description: A single ID
$ref: "#/components/schemas/Id"
strict:
name: strict
in: query
Expand Down Expand Up @@ -97,6 +103,10 @@ nelmio_api_doc:
schema:
type: string
schemas:
Id:
type: string
pattern: "^[A-Za-z0-9]{1,255}$"
maxLength: 255
ImageList:
type: array
items:
Expand Down
1 change: 1 addition & 0 deletions webapp/src/Controller/API/AbstractRestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

/**
* Class AbstractRestController
* @OA\Response(response="400", ref="#/components/responses/InvalidResponse")
* @package App\Controller\API
*/
abstract class AbstractRestController extends AbstractFOSRestController
Expand Down
1 change: 0 additions & 1 deletion webapp/src/Controller/API/AwardsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* @OA\Parameter(ref="#/components/parameters/cid")
* @OA\Response(response="404", ref="#/components/responses/NotFound")
* @OA\Response(response="401", ref="#/components/responses/Unauthorized")
* @OA\Response(response="400", ref="#/components/responses/InvalidResponse")
*/
class AwardsController extends AbstractRestController
{
Expand Down
1 change: 0 additions & 1 deletion webapp/src/Controller/API/BalloonController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
* @OA\Parameter(ref="#/components/parameters/cid")
* @OA\Response(response="404", ref="#/components/responses/NotFound")
* @OA\Response(response="401", ref="#/components/responses/Unauthorized")
* @OA\Response(response="400", ref="#/components/responses/InvalidResponse")
* @Security("is_granted('ROLE_JURY') or is_granted('ROLE_API_READER') or is_granted('ROLE_BALLOON')")
*/
class BalloonController extends AbstractRestController
Expand Down
1 change: 0 additions & 1 deletion webapp/src/Controller/API/ClarificationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* @OA\Parameter(ref="#/components/parameters/cid")
* @OA\Response(response="404", ref="#/components/responses/NotFound")
* @OA\Response(response="401", ref="#/components/responses/Unauthorized")
* @OA\Response(response="400", ref="#/components/responses/InvalidResponse")
*/
class ClarificationController extends AbstractRestController
{
Expand Down
1 change: 0 additions & 1 deletion webapp/src/Controller/API/ContestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
* @OA\Tag(name="Contests")
* @OA\Response(response="404", ref="#/components/responses/NotFound")
* @OA\Response(response="401", ref="#/components/responses/Unauthorized")
* @OA\Response(response="400", ref="#/components/responses/InvalidResponse")
*/
class ContestController extends AbstractRestController
{
Expand Down
1 change: 0 additions & 1 deletion webapp/src/Controller/API/GroupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
* @OA\Parameter(ref="#/components/parameters/cid")
* @OA\Response(response="404", ref="#/components/responses/NotFound")
* @OA\Response(response="401", ref="#/components/responses/Unauthorized")
* @OA\Response(response="400", ref="#/components/responses/InvalidResponse")
*/
class GroupController extends AbstractRestController
{
Expand Down
39 changes: 38 additions & 1 deletion webapp/src/Controller/API/JudgehostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
/**
* @Rest\Route("/judgehosts")
* @OA\Tag(name="Judgehosts")
* @OA\Response(response="400", ref="#/components/responses/InvalidResponse")
*/
class JudgehostController extends AbstractFOSRestController
{
Expand Down Expand Up @@ -1324,6 +1323,44 @@ private function getTestcaseFiles(string $id): array
/**
* Fetch work tasks.
* @Rest\Post("/fetch-work")
* @OA\RequestBody(
* description="The hostname of the judgedaemon requesting.",
* @OA\JsonContent(
* required={"hostname"},
* @OA\Property(
* property="hostname",
* type="string",
* format="string",
* description="Hostname of judgedaemon"
* ),
* @OA\Property(
* property="max-batchsize",
* type="integer",
* format="integer",
* description="Maximum size judge requests to handle"
* ),
* @OA\Schema(
* @OA\Property(
* property="hostname",
* type="string",
* format="string",
* description="Hostname of judgedaemon"
* ),
* @OA\Property(
* property="max-batchsize",
* type="integer",
* format="integer",
* description="Maximum size judge requests to handle"
* ),
* ),
* @OA\Examples(example="example-data", value={"hostname": "example-judgehost1"}, summary="Fetch work with example judgedaemon."),
* )
* )
* @OA\Response(
* response="200",
* description="List of judgeTasks.",
* @OA\Schema(ref="#/definitions/JudgeTaskList")
* )
* @Security("is_granted('ROLE_JUDGEHOST')")
*/
public function getJudgeTasksAction(Request $request): array
Expand Down
1 change: 0 additions & 1 deletion webapp/src/Controller/API/JudgementController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* @OA\Parameter(ref="#/components/parameters/cid")
* @OA\Response(response="404", ref="#/components/responses/NotFound")
* @OA\Response(response="401", ref="#/components/responses/Unauthorized")
* @OA\Response(response="400", ref="#/components/responses/InvalidResponse")
*/
class JudgementController extends AbstractRestController implements QueryObjectTransformer
{
Expand Down
1 change: 0 additions & 1 deletion webapp/src/Controller/API/JudgementTypeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
/**
* @Rest\Route("/contests/{cid}/judgement-types")
* @OA\Tag(name="Judgement types")
* @OA\Response(response="400", ref="#/components/responses/InvalidResponse")
*/
class JudgementTypeController extends AbstractRestController
{
Expand Down
1 change: 0 additions & 1 deletion webapp/src/Controller/API/LanguageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
* @OA\Parameter(ref="#/components/parameters/cid")
* @OA\Response(response="404", ref="#/components/responses/NotFound")
* @OA\Response(response="401", ref="#/components/responses/Unauthorized")
* @OA\Response(response="400", ref="#/components/responses/InvalidResponse")
*/
class LanguageController extends AbstractRestController
{
Expand Down
1 change: 0 additions & 1 deletion webapp/src/Controller/API/OrganizationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
* @OA\Parameter(ref="#/components/parameters/cid")
* @OA\Response(response="404", ref="#/components/responses/NotFound")
* @OA\Response(response="401", ref="#/components/responses/Unauthorized")
* @OA\Response(response="400", ref="#/components/responses/InvalidResponse")
*/
class OrganizationController extends AbstractRestController
{
Expand Down
1 change: 0 additions & 1 deletion webapp/src/Controller/API/ProblemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
* @OA\Parameter(ref="#/components/parameters/cid")
* @OA\Response(response="404", ref="#/components/responses/NotFound")
* @OA\Response(response="401", ref="#/components/responses/Unauthorized")
* @OA\Response(response="400", ref="#/components/responses/InvalidResponse")
*/
class ProblemController extends AbstractRestController implements QueryObjectTransformer
{
Expand Down
1 change: 0 additions & 1 deletion webapp/src/Controller/API/RunController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* @OA\Parameter(ref="#/components/parameters/cid")
* @OA\Response(response="404", ref="#/components/responses/NotFound")
* @OA\Response(response="401", ref="#/components/responses/Unauthorized")
* @OA\Response(response="400", ref="#/components/responses/InvalidResponse")
*/
class RunController extends AbstractRestController implements QueryObjectTransformer
{
Expand Down
1 change: 0 additions & 1 deletion webapp/src/Controller/API/ScoreboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
* @OA\Parameter(ref="#/components/parameters/cid")
* @OA\Response(response="404", ref="#/components/responses/NotFound")
* @OA\Response(response="401", ref="#/components/responses/Unauthorized")
* @OA\Response(response="400", ref="#/components/responses/InvalidResponse")
*/
class ScoreboardController extends AbstractRestController
{
Expand Down
1 change: 0 additions & 1 deletion webapp/src/Controller/API/SubmissionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
* @OA\Parameter(ref="#/components/parameters/cid")
* @OA\Response(response="404", ref="#/components/responses/NotFound")
* @OA\Response(response="401", ref="#/components/responses/Unauthorized")
* @OA\Response(response="400", ref="#/components/responses/InvalidResponse")
*/
class SubmissionController extends AbstractRestController
{
Expand Down
Loading

0 comments on commit 18ddf38

Please sign in to comment.