Skip to content

Commit e01ef91

Browse files
authored
Merge pull request #11246 from DefectDojo/release/2.40.1
Release: Merge release into master from: release/2.40.1
2 parents 7c70d96 + 5df736d commit e01ef91

40 files changed

Lines changed: 7836 additions & 274 deletions

.github/workflows/build-docker-images-for-testing.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ jobs:
4949
# export docker images to be used in next jobs below
5050
- name: Upload image ${{ matrix.docker-image }} as artifact
5151
timeout-minutes: 10
52-
uses: actions/upload-artifact@v3
52+
uses: actions/upload-artifact@v4
5353
with:
54-
name: ${{ matrix.docker-image }}
54+
name: built-docker-image-${{ matrix.docker-image }}-${{ matrix.os }}
5555
path: ${{ matrix.docker-image }}-${{ matrix.os }}_img
5656
retention-days: 1

.github/workflows/fetch-oas.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
run: docker compose down
5252

5353
- name: Upload oas.${{ matrix.file-type }} as artifact
54-
uses: actions/upload-artifact@v3
54+
uses: actions/upload-artifact@v4
5555
with:
5656
name: oas-${{ matrix.file-type }}
5757
path: oas.${{ matrix.file-type }}

.github/workflows/integration-tests.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,18 @@ jobs:
4545

4646
# load docker images from build jobs
4747
- name: Load images from artifacts
48-
uses: actions/download-artifact@v3
48+
uses: actions/download-artifact@v4
49+
with:
50+
path: built-docker-image
51+
pattern: built-docker-image-*
52+
merge-multiple: true
4953

5054
- name: Load docker images
5155
timeout-minutes: 10
5256
run: |-
53-
docker load -i nginx/nginx-${{ matrix.os }}_img
54-
docker load -i django/django-${{ matrix.os }}_img
55-
docker load -i integration-tests/integration-tests-debian_img
57+
docker load -i built-docker-image/nginx-${{ matrix.os }}_img
58+
docker load -i built-docker-image/django-${{ matrix.os }}_img
59+
docker load -i built-docker-image/integration-tests-debian_img
5660
docker images
5761
5862
- name: Set integration-test mode

.github/workflows/k8s-tests.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,18 @@ jobs:
4848
minikube status
4949
5050
- name: Load images from artifacts
51-
uses: actions/download-artifact@v3
51+
uses: actions/download-artifact@v4
52+
with:
53+
path: built-docker-image
54+
pattern: built-docker-image-*
55+
merge-multiple: true
5256

5357
- name: Load docker images
5458
timeout-minutes: 10
5559
run: |-
5660
eval $(minikube docker-env)
57-
docker load -i nginx/nginx-${{ matrix.os }}_img
58-
docker load -i django/django-${{ matrix.os }}_img
61+
docker load -i built-docker-image/nginx-${{ matrix.os }}_img
62+
docker load -i built-docker-image/django-${{ matrix.os }}_img
5963
docker images
6064
6165
- name: Configure HELM repos

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
runs-on: ubuntu-latest
4848
steps:
4949
- name: Load OAS files from artifacts
50-
uses: actions/download-artifact@v3
50+
uses: actions/download-artifact@v4
5151

5252
- name: Upload Release Asset - OpenAPI Specification - YAML
5353
id: upload-release-asset-yaml

.github/workflows/rest-framework-tests.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,17 @@ jobs:
2020

2121
# load docker images from build jobs
2222
- name: Load images from artifacts
23-
uses: actions/download-artifact@v3
23+
uses: actions/download-artifact@v4
24+
with:
25+
path: built-docker-image
26+
pattern: built-docker-image-*
27+
merge-multiple: true
2428

2529
- name: Load docker images
2630
timeout-minutes: 10
2731
run: |-
28-
docker load -i nginx/nginx-${{ matrix.os }}_img
29-
docker load -i django/django-${{ matrix.os }}_img
32+
docker load -i built-docker-image/nginx-${{ matrix.os }}_img
33+
docker load -i built-docker-image/django-${{ matrix.os }}_img
3034
docker images
3135
3236
# run tests with docker compose

components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "defectdojo",
3-
"version": "2.40.0",
3+
"version": "2.40.1",
44
"license" : "BSD-3-Clause",
55
"private": true,
66
"dependencies": {

dojo/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
# Django starts so that shared_task will use this app.
55
from .celery import app as celery_app # noqa: F401
66

7-
__version__ = "2.40.0"
7+
__version__ = "2.40.1"
88
__url__ = "https://github.com/DefectDojo/django-DefectDojo"
99
__docs__ = "https://documentation.defectdojo.com"

dojo/api_v2/serializers.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import json
22
import logging
3-
import os
43
import re
54
from datetime import datetime
65

@@ -803,20 +802,8 @@ class Meta:
803802

804803
def validate(self, data):
805804
if file := data.get("file"):
806-
ext = os.path.splitext(file.name)[1] # [0] returns path+filename
807-
valid_extensions = settings.FILE_UPLOAD_TYPES
808-
if ext.lower() not in valid_extensions:
809-
if accepted_extensions := f"{', '.join(valid_extensions)}":
810-
msg = (
811-
"Unsupported extension. Supported extensions are as "
812-
f"follows: {accepted_extensions}"
813-
)
814-
else:
815-
msg = (
816-
"File uploads are prohibited due to the list of acceptable "
817-
"file extensions being empty"
818-
)
819-
raise ValidationError(msg)
805+
# the clean will validate the file extensions and raise a Validation error if the extensions are not accepted
806+
FileUpload(title=file.name, file=file).clean()
820807
return data
821808
return None
822809

dojo/importers/options.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,13 +530,15 @@ def validate_tags(
530530
*args: list,
531531
**kwargs: dict,
532532
) -> list:
533-
return self.validate(
533+
tags = self.validate(
534534
"tags",
535535
expected_types=[list],
536536
required=False,
537537
default=[],
538538
**kwargs,
539539
)
540+
# Force all tags to be lowercase
541+
return [tag.lower() for tag in tags]
540542

541543
def validate_test(
542544
self,

0 commit comments

Comments
 (0)