Skip to content

Commit

Permalink
make sure the latest user certs are written to tak folders as well
Browse files Browse the repository at this point in the history
  • Loading branch information
rambo committed Jan 26, 2025
1 parent 172ba2f commit d02b888
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/takrmapi/tak_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ async def user_cert_write(self) -> None:

async def user_cert_validate(self) -> bool:
"""Check that the given certificate can at least be opened"""
await self.user_cert_write()
try:
cert_file_name = config.TAK_CERTS_FOLDER / f"{self.user.callsign}.pem"
with open(cert_file_name, "rb") as cert_file:
Expand All @@ -372,6 +373,8 @@ async def add_user_to_tak_with_cert(self) -> bool:
# THIS SHOULD BE CHANGED TO BE DONE THROUGH REST IF POSSIBLE
# Or via Pyjnius, or via PyIgnite
#
if not await self.user_cert_validate():
raise ValueError("User TAK certs not valid")
tasks = []
for certname in self.enable_user_cert_names:
tasks.append(
Expand Down Expand Up @@ -404,7 +407,8 @@ async def add_admin_to_tak_with_cert(self) -> bool:
# THIS SHOULD BE CHANGED TO BE DONE THROUGH REST IF POSSIBLE
# Or via Pyjnius, or via PyIgnite
#

if not await self.user_cert_validate():
raise ValueError("User TAK certs not valid")
tasks = []
for certname in self.enable_user_cert_names:
tasks.append(
Expand Down Expand Up @@ -437,6 +441,8 @@ async def delete_user_with_cert(self) -> bool:
# THIS SHOULD BE CHANGED TO BE DONE THROUGH REST IF POSSIBLE
# Or via Pyjnius, or via PyIgnite
#
if not await self.user_cert_validate():
raise ValueError("User TAK certs not valid")
tasks = []
for certname in self.enable_user_cert_names:
tasks.append(
Expand Down

0 comments on commit d02b888

Please sign in to comment.