-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from castedo/pr/package_allowed_signers
move allowed_signers from compat into package
- Loading branch information
Showing
5 changed files
with
9 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
# (c) 2024 E. Castedo Ellerman <[email protected]> | ||
# 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 | ||
from dataclasses import dataclass | ||
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): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters