Skip to content

Commit

Permalink
fix loading jsonc
Browse files Browse the repository at this point in the history
  • Loading branch information
amazy committed Sep 19, 2023
1 parent 2cf83b2 commit 9e8041d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 19 deletions.
16 changes: 2 additions & 14 deletions sources/orthanc_auth_service/permissions.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
// "SPDX-FileCopyrightText: 2022 - 2023 Orthanc Team SRL <[email protected]>"
// SPDX-License-Identifier: CC0-1.0
{
"roles" : {
<<<<<<< HEAD
"admin": {
"permissions": ["all"],
"authorized_labels": ["*"]
},
"doctor": {
"permissions":["view", "download", "share", "send"],
"authorized_labels": ["*"]
},
"students": {
"permissions":["view", "download"],
"authorized_labels": ["students"]
=======
"admin-role": {
"permissions": ["all"],
"authorized_labels": ["*"]
Expand All @@ -24,7 +13,6 @@
"external-role": {
"permissions":["view", "download"],
"authorized_labels": ["external"]
>>>>>>> labels-perm
}
}
}
3 changes: 0 additions & 3 deletions sources/orthanc_auth_service/permissions.json.license

This file was deleted.

4 changes: 2 additions & 2 deletions sources/orthanc_auth_service/shares/keycloak.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import logging
import requests
import jwt
import json
import jsonc
from typing import Dict, Any, List, Tuple
from .models import *
from .utils.utils import get_secret_or_die, is_secret_defined
Expand Down Expand Up @@ -148,7 +148,7 @@ def _get_keycloak_public_key(keycloak_uri: str) -> str:

def _get_config_from_file(file_path: str):
with open(file_path) as f:
data = json.load(f)
data = jsonc.load(f)

roles = data.get('roles')

Expand Down
1 change: 1 addition & 0 deletions sources/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ pytz==2022.1
python-dateutil==2.8.2
uvicorn[standard]==0.18.2
pytest
json-with-comments==1.2.1
httpx
# TODO: standardize usage of https or requests
requests

0 comments on commit 9e8041d

Please sign in to comment.