clan-cli/sops: rename add_key to write_key #77
@ -2,7 +2,7 @@ import argparse
|
||||
|
||||
from . import secrets
|
||||
from .folders import list_objects, remove_object, sops_machines_folder
|
||||
from .sops import add_key
|
||||
from .sops import write_key
|
||||
from .types import (
|
||||
machine_name_type,
|
||||
public_or_private_age_key_type,
|
||||
@ -16,7 +16,7 @@ def list_command(args: argparse.Namespace) -> None:
|
||||
|
||||
|
||||
def add_command(args: argparse.Namespace) -> None:
|
||||
add_key(sops_machines_folder() / args.machine, args.key, args.force)
|
||||
write_key(sops_machines_folder() / args.machine, args.key, args.force)
|
||||
|
||||
|
||||
def remove_command(args: argparse.Namespace) -> None:
|
||||
|
@ -74,7 +74,7 @@ def ensure_user(pub_key: str) -> SopsKey:
|
||||
username = get_user_name(username)
|
||||
|
||||
# Add the public key for the user
|
||||
add_key(users_folder / username, pub_key, False)
|
||||
write_key(users_folder / username, pub_key, False)
|
||||
|
||||
return key
|
||||
|
||||
@ -126,7 +126,7 @@ def encrypt_file(secret_path: Path, content: IO[str], keys: list[str]) -> None:
|
||||
pass
|
||||
|
||||
|
||||
def add_key(path: Path, publickey: str, overwrite: bool) -> None:
|
||||
def write_key(path: Path, publickey: str, overwrite: bool) -> None:
|
||||
path.mkdir(parents=True, exist_ok=True)
|
||||
try:
|
||||
flags = os.O_CREAT | os.O_WRONLY | os.O_TRUNC
|
||||
|
@ -2,7 +2,7 @@ import argparse
|
||||
|
||||
from . import secrets
|
||||
from .folders import list_objects, remove_object, sops_users_folder
|
||||
from .sops import add_key
|
||||
from .sops import write_key
|
||||
from .types import (
|
||||
VALID_SECRET_NAME,
|
||||
public_or_private_age_key_type,
|
||||
@ -12,7 +12,7 @@ from .types import (
|
||||
|
||||
|
||||
def add_user(name: str, key: str, force: bool) -> None:
|
||||
add_key(sops_users_folder() / name, key, force)
|
||||
write_key(sops_users_folder() / name, key, force)
|
||||
|
||||
|
||||
def list_command(args: argparse.Namespace) -> None:
|
||||
|
Loading…
Reference in New Issue
Block a user