lib.ProcFilterGpg: Add module

Add a ProcFilter implementation for decrypting GPG blobs. It needs an
ExecContext passed to __init__() in order to run /usr/bin/gpg.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-04-23 14:41:51 +02:00
commit d70454b32a
Signed by: jan
GPG key ID: 3750640C9E25DD61

View file

@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
from typing import TYPE_CHECKING
from .ProcFilter import ProcFilter
from .base import Result
if TYPE_CHECKING:
from .ExecContext import ExecContext
class ProcFilterGpg(ProcFilter):
def __init__(self, ec: ExecContext) -> None:
self.__ec = ec
async def _run(self, data: bytes) -> Result:
return await self.__ec.run([
"gpg",
'--batch',
'--yes',
'--quiet',
'--no-tty',
'--decrypt',
],
cmd_input = data,
throw = True
)