Add support for multiple keyrings
We want all @archlinux.org keys in one place, so they can all be exported to WKD (#142). This commit adds basic support for the expected keyrings we need in the short term (support staff and service accounts (ex: @renovate)). Fix #141
This commit is contained in:
parent
a511e5a91a
commit
91f9ebb25b
@ -15,6 +15,7 @@ from .keyring import convert
|
|||||||
from .keyring import export
|
from .keyring import export
|
||||||
from .keyring import inspect_keyring
|
from .keyring import inspect_keyring
|
||||||
from .keyring import list_keyring
|
from .keyring import list_keyring
|
||||||
|
from .types import Keyring
|
||||||
from .types import TrustFilter
|
from .types import TrustFilter
|
||||||
from .util import absolute_path
|
from .util import absolute_path
|
||||||
from .util import cwd
|
from .util import cwd
|
||||||
@ -32,6 +33,12 @@ parser.add_argument(
|
|||||||
default=False,
|
default=False,
|
||||||
help="force the execution of subcommands (e.g. overwriting of files)",
|
help="force the execution of subcommands (e.g. overwriting of files)",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--keyring",
|
||||||
|
choices=[e.value for e in Keyring],
|
||||||
|
default=Keyring.packager.value,
|
||||||
|
help="Keyring to use",
|
||||||
|
)
|
||||||
subcommands = parser.add_subparsers(dest="subcommand")
|
subcommands = parser.add_subparsers(dest="subcommand")
|
||||||
|
|
||||||
convert_parser = subcommands.add_parser(
|
convert_parser = subcommands.add_parser(
|
||||||
@ -143,6 +150,8 @@ def main() -> None: # noqa: ignore=C901
|
|||||||
with TemporaryDirectory(prefix="arch-keyringctl-") as tempdir:
|
with TemporaryDirectory(prefix="arch-keyringctl-") as tempdir:
|
||||||
project_root = Path(".").absolute()
|
project_root = Path(".").absolute()
|
||||||
keyring_root = Path("keyring").absolute()
|
keyring_root = Path("keyring").absolute()
|
||||||
|
if args.keyring != "packager":
|
||||||
|
keyring_root = Path(args.keyring).absolute()
|
||||||
working_dir = Path(tempdir)
|
working_dir = Path(tempdir)
|
||||||
debug(f"Working directory: {working_dir}")
|
debug(f"Working directory: {working_dir}")
|
||||||
with cwd(working_dir):
|
with cwd(working_dir):
|
||||||
|
@ -10,6 +10,12 @@ Username = NewType("Username", str)
|
|||||||
PacketKind = NewType("PacketKind", str)
|
PacketKind = NewType("PacketKind", str)
|
||||||
|
|
||||||
|
|
||||||
|
class Keyring(Enum):
|
||||||
|
packager = "packager"
|
||||||
|
support = "support"
|
||||||
|
service = "service"
|
||||||
|
|
||||||
|
|
||||||
class Trust(Enum):
|
class Trust(Enum):
|
||||||
unknown = auto
|
unknown = auto
|
||||||
revoked = auto()
|
revoked = auto()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user