diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 5ad5346..657e0ed 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.2.0 +current_version = 1.3.0 commit = False tag = False diff --git a/pyproject.toml b/pyproject.toml index f3685c8..b3fdd8f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "takrmapi" -version = "1.2.0" +version = "1.3.0" description = "RASENMAEHER integration API for TAK server" authors = ["Eero af Heurlin ", "Ari Karhunen "] homepage = "https://github.com/pvarki/python-tak-rmapi" diff --git a/src/takrmapi/__init__.py b/src/takrmapi/__init__.py index 8da9d11..723bfb2 100644 --- a/src/takrmapi/__init__.py +++ b/src/takrmapi/__init__.py @@ -1,2 +1,2 @@ """ RASENMAEHER integration API for TAK server """ -__version__ = "1.2.0" # NOTE Use `bump2version --config-file patch` to bump versions correctly +__version__ = "1.3.0" # NOTE Use `bump2version --config-file patch` to bump versions correctly diff --git a/src/takrmapi/tak_helpers.py b/src/takrmapi/tak_helpers.py index 4e70e84..96cf053 100644 --- a/src/takrmapi/tak_helpers.py +++ b/src/takrmapi/tak_helpers.py @@ -5,9 +5,10 @@ import shutil import logging from pathlib import Path -import aiohttp +import uuid +import aiohttp from OpenSSL import crypto # FIXME: Move to python-cryptography for cert parsing from jinja2 import Template from libpvarki.schemas.product import UserCRUDRequest @@ -188,7 +189,9 @@ async def create_mission_zip(self, app_version: str = "", walk_dir: str = "") -> with open(org_file, "r", encoding="utf-8") as filehandle: template = Template(filehandle.read()) - rendered_template = await self.render_tak_manifest_template(template=template) + rendered_template = await self.render_tak_manifest_template( + template=template, app_version=app_version + ) new_dst_file = dst_file.replace(".tpl", "") if new_dst_file.endswith("manifest.xml"): await self.tak_manifest_extra(rendered_template, tmp_folder) @@ -207,10 +210,11 @@ async def create_mission_zip(self, app_version: str = "", walk_dir: str = "") -> # await remove_tmp_dir(tmp_folder) return f"{tmp_folder}.zip" - async def render_tak_manifest_template(self, template: Template) -> str: + async def render_tak_manifest_template(self, template: Template, app_version: str) -> str: """Render tak manifest template""" + pkguid = uuid.uuid5(uuid.NAMESPACE_URL, f"{config.TAK_SERVER_FQDN}/{self.user.user.uuid}/{app_version}") return template.render( - tak_server_uid_name=config.TAK_SERVER_FQDN, + tak_server_uid_name=str(pkguid), tak_server_name=config.TAK_SERVER_NAME, tak_server_address=config.TAK_SERVER_FQDN, client_cert_name=self.user.callsign, diff --git a/tests/test_takrmapi.py b/tests/test_takrmapi.py index 810eac3..fc0ea12 100644 --- a/tests/test_takrmapi.py +++ b/tests/test_takrmapi.py @@ -4,4 +4,4 @@ def test_version() -> None: """Make sure version matches expected""" - assert __version__ == "1.2.0" + assert __version__ == "1.3.0"