diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index ddbe3ec..ca6ccef 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -3,7 +3,6 @@ name: Docs on: push: branches: [main] - pull_request: # Grant GITHUB_TOKEN the permissions required to make a Pages deployment # and committing generated baseprint snapshot to autobaseprint branch diff --git a/compat/ssh_keygen.py b/compat/ssh_keygen.py index 06c4a72..904da8d 100644 --- a/compat/ssh_keygen.py +++ b/compat/ssh_keygen.py @@ -6,8 +6,7 @@ from typing import BinaryIO from sshsig import InvalidSignature, check_signature, verify - -from .allowed_signers import load_for_git_allowed_signers_file +from sshsig.allowed_signers import load_for_git_allowed_signers_file def cli_subcmd_check_novalidate( diff --git a/compat/allowed_signers.py b/sshsig/allowed_signers.py similarity index 97% rename from compat/allowed_signers.py rename to sshsig/allowed_signers.py index 853dde8..f2c8c17 100644 --- a/compat/allowed_signers.py +++ b/sshsig/allowed_signers.py @@ -1,6 +1,8 @@ # (c) 2024 E. Castedo Ellerman # Released under the MIT License (https://spdx.org/licenses/MIT) +"""Parsing of the ssh-keygen allowed signers format.""" + from __future__ import annotations from collections.abc import Iterable @@ -8,7 +10,7 @@ from pathlib import Path from typing import TYPE_CHECKING, TextIO -from sshsig import PublicKey +from .ssh_public_key import PublicKey if TYPE_CHECKING: @@ -171,7 +173,9 @@ def load_for_git_allowed_signers_file(file: TextIO | Path) -> Iterable[PublicKey return for_git_allowed_keys(load_allowed_signers_file(file)) -def save_for_git_allowed_signers_file(src: set[PublicKey], out: Path | TextIO) -> None: +def save_for_git_allowed_signers_file( + src: Iterable[PublicKey], out: Path | TextIO +) -> None: """Save keys for git to "allowed signers" format per ssh-keygen.""" if isinstance(out, Path): diff --git a/tests/test_allowed_signers.py b/tests/test_allowed_signers.py index 22217d7..82cf335 100644 --- a/tests/test_allowed_signers.py +++ b/tests/test_allowed_signers.py @@ -7,8 +7,7 @@ from unittest import TestCase from sshsig import PublicKey - -from compat.allowed_signers import AllowedSigner, load_allowed_signers_file +from sshsig.allowed_signers import AllowedSigner, load_allowed_signers_file TESTDATA_DIR = Path(__file__).parent.parent / "testdata" diff --git a/tests/test_sshsig.py b/tests/test_sshsig.py index 1566722..b0f04bb 100644 --- a/tests/test_sshsig.py +++ b/tests/test_sshsig.py @@ -6,9 +6,9 @@ from unittest import TestCase from sshsig import sshsig +from sshsig.allowed_signers import load_for_git_allowed_signers_file from compat import ssh_keygen -from compat.allowed_signers import load_for_git_allowed_signers_file TESTDATA_DIR = Path(__file__).parent.parent / "testdata"