Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 12 additions & 12 deletions .github/workflows/cd-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ jobs:
echo "Running coverage unit test"
docker compose --env-file ./.env run app_xis sh -c "python manage.py waitdb && coverage run manage.py test --tag=unit && flake8 && coverage report && coverage report --fail-under=80"

sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# sonarcloud:
# name: SonarCloud
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
# - name: SonarCloud Scan
# uses: SonarSource/sonarcloud-github-action@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

build:
# requires dependency from step above
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dockerfile

FROM python:3.9-buster
FROM python:3.9-bookworm

# install nginx

Expand Down
10 changes: 8 additions & 2 deletions app/api/management/utils/api_helper_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ def add_metadata_ledger(data, experience_id):
data['unique_record_identifier'] = str(uuid.uuid4())

# sorting the metadata for consistency
data['metadata'] = multi_dict_sort(data['metadata'])
if 'metadata' in data:
data['metadata'] = multi_dict_sort(data['metadata'])
else:
data['metadata'] = {}

# create hash values of metadata and supplemental data
metadata_hash = hashlib.sha512(str(data['metadata']).encode(
Expand Down Expand Up @@ -78,7 +81,10 @@ def add_supplemental_ledger(data, experience_id):
data['unique_record_identifier'] = str(uuid.uuid4())

# sorting the metadata for consistency
data['metadata'] = multi_dict_sort(data['metadata'])
if 'metadata' in data:
data['metadata'] = multi_dict_sort(data['metadata'])
else:
data['metadata'] = {}

# create hash values of metadata and supplemental data
supplemental_hash = hashlib.sha512(str(data['metadata'])
Expand Down
3 changes: 2 additions & 1 deletion app/core/management/utils/xss_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ def get_data_types_for_validation():
datatype_to_object = {
"int": int,
"str": str,
"bool": bool
"bool": bool,
"URI": str
}
expected_data_types = dict()

Expand Down
Loading