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
14 changes: 13 additions & 1 deletion .github/workflows/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,27 @@ on:
jobs:
build-server:
runs-on: ubuntu-latest
container: ${{ matrix.container }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
include:
- python-version: "3.6"
container: "python:3.6"
- python-version: "3.7"
container: "python:3.7"
- python-version: "3.8"
- python-version: "3.9"
- python-version: "3.10"
- python-version: "3.11"
- python-version: "3.12"
- python-version: "3.13"
defaults:
run:
working-directory: server
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
if: ${{ !matrix.container }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down
9 changes: 5 additions & 4 deletions server/recceiver/cfstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import time
from collections import defaultdict
from operator import itemgetter
from typing import Dict, List, Set

from channelfinder import ChannelFinderClient
from requests import ConnectionError, RequestException
Expand Down Expand Up @@ -397,15 +398,15 @@ def dict_to_file(dict, iocs, conf):
json.dump(list, f)


def create_channel(name: str, owner: str, properties: list[dict[str, str]]):
def create_channel(name: str, owner: str, properties: List[Dict[str, str]]):
return {
"name": name,
"owner": owner,
"properties": properties,
}


def create_property(owner: str, name: str, value: str):
def create_property(owner: str, name: str, value: str) -> Dict[str, str]:
return {
"name": name,
"owner": owner,
Expand Down Expand Up @@ -741,8 +742,8 @@ def create_default_properties(owner, iocTime, recceiverid, channels_dict, iocs,


def __merge_property_lists(
newProperties: list[dict[str, str]], channel: dict[str, list[dict[str, str]]], managed_properties=set()
) -> list[dict[str, str]]:
newProperties: List[Dict[str, str]], channel: Dict[str, List[Dict[str, str]]], managed_properties: Set[str] = set()
) -> List[Dict[str, str]]:
"""
Merges two lists of properties ensuring that there are no 2 properties with
the same name In case of overlap between the new and old property lists the
Expand Down