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

chore: merge to main for release 1.27.0 #2522

Merged
merged 62 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
eac344f
chore: clean up unnecessary fields in core filters (#2455)
StefanFl Jan 14, 2025
9f755b7
fix(deps): update dependency django to v5.1.5 (#2456)
renovate[bot] Jan 15, 2025
2974870
chore(deps): update traefik docker tag to v3.3.2 (#2457)
renovate[bot] Jan 15, 2025
9e9fa91
fix(deps): update dependency django-stubs to v5.1.2 (#2458)
renovate[bot] Jan 15, 2025
9b63a67
chore(deps): update keycloak/keycloak docker tag to v26.1.0 (#2459)
renovate[bot] Jan 15, 2025
2c8bdc1
feat: show only relevant branch names as filters (#2460)
StefanFl Jan 15, 2025
268cb0c
chore: remove has_pending_assessment filter (#2462)
StefanFl Jan 15, 2025
c32a219
chore(deps): update docker/build-push-action action to v6.12.0 (#2461)
renovate[bot] Jan 15, 2025
897ce5f
fix(deps): update dependency psycopg to v3.2.4 (#2463)
renovate[bot] Jan 15, 2025
9903304
chore(deps): update dependency @types/node to v22.10.7 (#2464)
renovate[bot] Jan 16, 2025
733f309
feat: JSON schema for license policy exports (#2465)
StefanFl Jan 16, 2025
735374c
fix: license policies without parents cannot be edited (#2466)
StefanFl Jan 17, 2025
7b6cd78
fix: problems with paging in expand in license component overview (#2…
StefanFl Jan 17, 2025
3ab0f5d
chore(deps): update dependency mkdocs-material to v9.5.50 (#2468)
renovate[bot] Jan 18, 2025
1345e53
fix(deps): update dependency semver to v3.0.3 (#2469)
renovate[bot] Jan 19, 2025
8db6047
chore(deps): update dependency vite to v6.0.9 (#2471)
renovate[bot] Jan 20, 2025
ed673a8
chore: document import of SBOMs (#2472)
StefanFl Jan 20, 2025
ba1cde4
fix(deps): update react-admin monorepo to v5.5.0 (#2473)
renovate[bot] Jan 20, 2025
2235dd5
chore(deps): update to react 19 (#2474)
StefanFl Jan 20, 2025
cd35b55
chore(deps): update json-viewer to 4.0.1 and downgrade react to 18.3.…
StefanFl Jan 20, 2025
dffe1d3
chore(deps): update typescript-eslint monorepo to v8.21.0 (#2476)
renovate[bot] Jan 20, 2025
c7ec9cb
chore(deps): update dependency vite to v6.0.11 (#2477)
renovate[bot] Jan 21, 2025
e889ee7
fix(deps): update dependency tss-react to v4.9.15 (#2479)
renovate[bot] Jan 21, 2025
ae0090e
fix(deps): update material-ui monorepo to v6.4.1 (#2480)
renovate[bot] Jan 22, 2025
d27485e
chore(deps): update github/codeql-action action to v3.28.2 (#2481)
renovate[bot] Jan 22, 2025
a34a5b0
chore(deps): update mysql docker tag to v8.4.4 (#2482)
renovate[bot] Jan 22, 2025
ac301bd
chore(deps): update node.js to v22.13.1 (#2485)
renovate[bot] Jan 22, 2025
5853433
fix: handle OIDC groups as string (#2486)
dervoeti Jan 23, 2025
28f15d4
chore(deps): update github/codeql-action action to v3.28.3 (#2488)
renovate[bot] Jan 23, 2025
fb03539
chore(deps): update node.js to e2b39f7 (#2489)
renovate[bot] Jan 23, 2025
7a607ca
chore(deps): update dependency @types/node to v22.10.8 (#2490)
renovate[bot] Jan 23, 2025
32acbf6
chore(deps): update dependency @types/node to v22.10.9 (#2491)
renovate[bot] Jan 23, 2025
c0d308e
chore(deps): update github/codeql-action action to v3.28.4 (#2495)
renovate[bot] Jan 23, 2025
bb62363
chore(deps): update dependency @types/node to v22.10.10 (#2494)
renovate[bot] Jan 24, 2025
1c6759f
feat: aliases for vulnerability id (#2497)
StefanFl Jan 24, 2025
7822ed7
chore(deps): update mcr.microsoft.com/playwright docker tag to v1.50.…
renovate[bot] Jan 24, 2025
642db8c
chore(deps): remove unused pre-commit dependency (#2499)
StefanFl Jan 24, 2025
d24481a
chore(deps): update docker/build-push-action action to v6.13.0 (#2498)
renovate[bot] Jan 24, 2025
c58dd94
fix(deps): update dependency semver to v3.0.4 (#2500)
renovate[bot] Jan 25, 2025
7753d80
fix(deps): update react-admin monorepo to v5.5.2 (#2501)
renovate[bot] Jan 25, 2025
1dbdc29
chore(deps): update python:3.12.8-alpine docker digest to ba13ef9 (#2…
renovate[bot] Jan 25, 2025
bc80216
chore(deps): update github/codeql-action action to v3.28.5 (#2503)
renovate[bot] Jan 25, 2025
19b8440
chore(deps): update eslint monorepo to v9.19.0 (#2504)
renovate[bot] Jan 25, 2025
0da02dd
feat: bulk delete functionality for own assessments (#2487)
dervoeti Jan 26, 2025
859ed90
chore(deps): update actions/setup-node action to v4.2.0 (#2505)
renovate[bot] Jan 27, 2025
062b439
fix: optimize extracting dependencies from CycloneDX (#2508)
StefanFl Jan 27, 2025
d6e527f
chore(deps): update typescript-eslint monorepo to v8.22.0 (#2507)
renovate[bot] Jan 28, 2025
b30585f
chore(deps): update github/codeql-action action to v3.28.6 (#2509)
renovate[bot] Jan 28, 2025
307e8b4
chore(deps): update dependency @types/node to v22.12.0 (#2510)
renovate[bot] Jan 28, 2025
94b386f
chore(deps): update actions/setup-python action to v5.4.0 (#2511)
renovate[bot] Jan 28, 2025
02be071
fix: order license components by component_name_version_type (#2512)
StefanFl Jan 28, 2025
a35c519
fix: make rendering of dependencies more robust (#2513)
StefanFl Jan 28, 2025
014e2b3
chore(deps): update dependency @trivago/prettier-plugin-sort-imports …
renovate[bot] Jan 28, 2025
be94214
fix(deps): update dependency pylint to v3.3.4 (#2515)
renovate[bot] Jan 28, 2025
3ec7111
fix(deps): update material-ui monorepo to v6.4.2 (#2519)
renovate[bot] Jan 29, 2025
c8f6dfb
chore(deps): update github/codeql-action action to v3.28.8 (#2517)
renovate[bot] Jan 30, 2025
87c5122
fix(deps): update dependency flake8-isort to v6.1.2 (#2518)
renovate[bot] Jan 30, 2025
66eda44
fix(deps): update dependency black to v25 (#2516)
renovate[bot] Jan 30, 2025
18067dc
chore(deps): lock file maintenance (#2470)
renovate[bot] Jan 30, 2025
c10f441
feat: basic service to scan vulnerabilities from OSV [experimental] (…
StefanFl Jan 30, 2025
5238799
chore: ignore a false positive of Bandit (#2520)
StefanFl Jan 30, 2025
8946b22
chore: prepare for release 1.27.0 (#2521)
StefanFl Jan 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build_push_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: echo "CREATED=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
-
name: Build and push backend
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11.0
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
with:
context: .
file: ./docker/backend/prod/django/Dockerfile
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
run: echo "CREATED=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
-
name: Build and push frontend
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11.0
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
with:
context: .
file: ./docker/frontend/prod/Dockerfile
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build_push_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: echo "CREATED=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
-
name: Build and push backend
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11.0
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
with:
context: .
file: ./docker/backend/prod/django/Dockerfile
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
run: echo "CREATED=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
-
name: Build and push frontend
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11.0
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
with:
context: .
file: ./docker/frontend/prod/Dockerfile
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: 20
-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python 3.12
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: 3.12

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: 20

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_licenses_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: 20
-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate_sboms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: 20
-
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main
- chore/documentation_check_security_gate
- chore/documentation_sbom

permissions: read-all

Expand All @@ -15,7 +15,7 @@ jobs:
contents: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: 3.x
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scan_sca_current.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: 'v1.26.0'
ref: 'v1.27.0'
-
name: Run SCA vulnerability scanners
uses: MaibornWolff/secobserve_actions_templates/actions/vulnerability_scanner@a8344daa56598a80c2c80081974a0468dd29d086 # main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
uses: github/codeql-action/upload-sarif@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion backend/application/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "1.26.0"
__version__ = "1.27.0"

import pymysql

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,14 @@ def _get_groups_from_token(self, payload: dict) -> list:
return []

groups = payload.get(os.environ["OIDC_GROUPS"])
if not groups or not isinstance(groups, list):

if not groups:
return []

if isinstance(groups, str):
groups = [groups]

if not isinstance(groups, list):
return []

return sorted(groups)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Permissions(IntEnum):
Product_Delete = 1103
Product_Create = 1104
Product_Import_Observations = 1105
Product_Scan_OSV = 1106

Product_Member_View = 1201
Product_Member_Edit = 1202
Expand Down Expand Up @@ -206,6 +207,7 @@ def get_roles_with_permissions():
Permissions.Product_Group_View,
Permissions.Product_View,
Permissions.Product_Import_Observations,
Permissions.Product_Scan_OSV,
Permissions.Product_Member_View,
Permissions.Product_Authorization_Group_Member_View,
Permissions.Product_Rule_View,
Expand All @@ -225,6 +227,7 @@ def get_roles_with_permissions():
Permissions.Product_View,
Permissions.Product_Edit,
Permissions.Product_Import_Observations,
Permissions.Product_Scan_OSV,
Permissions.Product_Member_View,
Permissions.Product_Member_Edit,
Permissions.Product_Member_Delete,
Expand Down Expand Up @@ -268,6 +271,7 @@ def get_roles_with_permissions():
Permissions.Product_Edit,
Permissions.Product_Delete,
Permissions.Product_Import_Observations,
Permissions.Product_Scan_OSV,
Permissions.Product_Member_View,
Permissions.Product_Member_Edit,
Permissions.Product_Member_Delete,
Expand Down
5 changes: 5 additions & 0 deletions backend/application/commons/services/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ def clip_fields(application: str, model: str, my_object) -> None:
field.name,
value[: max_length - 9] + "\n```\n\n...",
)


def get_comma_separated_as_list(comma_separated_string: str) -> list[str]:
return_list = comma_separated_string.split(",") if comma_separated_string else []
return [x.strip() for x in return_list]
98 changes: 67 additions & 31 deletions backend/application/core/api/filters.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from datetime import timedelta

from django.db.models import Q
from django.utils import timezone
from django_filters import (
BooleanFilter,
CharFilter,
ChoiceFilter,
FilterSet,
ModelChoiceFilter,
NumberFilter,
OrderingFilter,
)

Expand All @@ -24,6 +24,7 @@
Service,
)
from application.core.types import Status
from application.licenses.models import License_Component


class ProductGroupFilter(FilterSet):
Expand Down Expand Up @@ -73,7 +74,6 @@ class Meta:


class ProductMemberFilter(FilterSet):
product = NumberFilter(field_name="product")
is_product_group = BooleanFilter(field_name="product__is_product_group")

ordering = OrderingFilter(
Expand All @@ -91,7 +91,6 @@ class Meta:


class ProductAuthorizationGroupMemberFilter(FilterSet):
product = NumberFilter(field_name="product")
is_product_group = BooleanFilter(field_name="product__is_product_group")

ordering = OrderingFilter(
Expand All @@ -109,7 +108,71 @@ class Meta:


class BranchFilter(FilterSet):
product = NumberFilter(field_name="product")
for_observations = BooleanFilter(
field_name="for_observations",
method="get_for_observations",
)
for_license_components = BooleanFilter(
field_name="for_license_components",
method="get_for_license_components",
)

def get_for_observations(
self, queryset, field_name, value
): # pylint: disable=unused-argument
# field_name is used as a positional argument
if value:
product_data = self.data.get("product")
if product_data:
product_id = int(product_data)
observation_branches = (
Observation.objects.filter(
product_id=product_id, branch__isnull=False
)
.values("branch_id")
.distinct()
)
product_default_branches = (
Product.objects.filter(
id=product_id, repository_default_branch__isnull=False
)
.values("repository_default_branch")
.distinct()
)
return queryset.filter(
Q(id__in=observation_branches) | Q(id__in=product_default_branches)
)

return queryset

def get_for_license_components(
self, queryset, field_name, value
): # pylint: disable=unused-argument
# field_name is used as a positional argument
if value:
product_data = self.data.get("product")
if product_data:
product_id = int(product_data)
license_component_branches = (
License_Component.objects.filter(
product_id=product_id, branch__isnull=False
)
.values("branch_id")
.distinct()
)
product_default_branches = (
Product.objects.filter(
id=product_id, repository_default_branch__isnull=False
)
.values("repository_default_branch")
.distinct()
)
return queryset.filter(
Q(id__in=license_component_branches)
| Q(id__in=product_default_branches)
)

return queryset

ordering = OrderingFilter(
# tuple-mapping retains order
Expand Down Expand Up @@ -169,33 +232,6 @@ class ObservationFilter(FilterSet):
queryset=Product.objects.filter(is_product_group=True),
)

has_pending_assessment = ChoiceFilter(
field_name="has_pending_assessment",
method="get_has_pending_assessment",
choices=[
("true", "true"),
("false", "false"),
],
)

def get_has_pending_assessment(
self, queryset, field_name, value
): # pylint: disable=unused-argument
# field_name is used as a positional argument

if value == "true":
return queryset.filter(
id__in=Observation_Log.objects.filter(
assessment_status="Needs approval"
).values("observation_id")
)

return queryset.exclude(
id__in=Observation_Log.objects.filter(
assessment_status="Needs approval"
).values("observation_id")
)

ordering = OrderingFilter(
# tuple-mapping retains order
fields=(
Expand Down
8 changes: 4 additions & 4 deletions backend/application/core/api/serializers_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ def get_origin_component_name_version(observation: Observation) -> str:
return ""

origin_component_name_version_with_type = observation.origin_component_name_version
if observation.origin_component_purl:
purl = PackageURL.from_string(observation.origin_component_purl)
if purl.type:
origin_component_name_version_with_type += f" ({purl.type})"
if observation.origin_component_purl_type:
origin_component_name_version_with_type += (
f" ({observation.origin_component_purl_type})"
)

return origin_component_name_version_with_type

Expand Down
Loading