Remove defunct client package
This commit is contained in:
@ -1,35 +0,0 @@
|
|||||||
"""Client code"""
|
|
||||||
|
|
||||||
from typing import TextIO
|
|
||||||
import click
|
|
||||||
|
|
||||||
from sshecret.crypto import decode_string, load_private_key
|
|
||||||
|
|
||||||
|
|
||||||
# async def request_secret(host: str, port: str, username: str, client_key: str, secretname: str) -> str:
|
|
||||||
# """Request secret."""
|
|
||||||
# async with asyncssh.connect(host, port, client_username=username, client_keys=[client_key]) as conn:
|
|
||||||
# result = await conn.run(secretname, check=True)
|
|
||||||
|
|
||||||
# if encoded := result.stdout:
|
|
||||||
# if isinstance(encoded, str):
|
|
||||||
# return encoded
|
|
||||||
# return encoded.decode()
|
|
||||||
|
|
||||||
|
|
||||||
def decrypt_secret(encoded: str, client_key: str) -> str:
|
|
||||||
"""Decrypt secret."""
|
|
||||||
private_key = load_private_key(client_key)
|
|
||||||
return decode_string(encoded, private_key)
|
|
||||||
|
|
||||||
|
|
||||||
@click.command()
|
|
||||||
@click.argument("keyfile", type=click.Path(exists=True, readable=True, dir_okay=False))
|
|
||||||
@click.argument("encrypted_input", type=click.File("r"))
|
|
||||||
def cli_decrypt(keyfile: str, encrypted_input: TextIO) -> None:
|
|
||||||
"""Decrypt on command line."""
|
|
||||||
decrypted = decrypt_secret(encrypted_input.read(), keyfile)
|
|
||||||
click.echo(decrypted)
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
cli_decrypt()
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
[project]
|
|
||||||
name = "sshecret-client"
|
|
||||||
version = "0.1.0"
|
|
||||||
description = "Add your description here"
|
|
||||||
readme = "README.md"
|
|
||||||
requires-python = ">=3.13"
|
|
||||||
dependencies = [
|
|
||||||
"asyncssh>=2.20.0",
|
|
||||||
"click>=8.1.8",
|
|
||||||
"cryptography>=44.0.2",
|
|
||||||
"paramiko>=3.5.1",
|
|
||||||
"sshecret",
|
|
||||||
]
|
|
||||||
|
|
||||||
[tool.uv.sources]
|
|
||||||
sshecret = { workspace = true }
|
|
||||||
Reference in New Issue
Block a user