Add security warning
This commit is contained in:
parent
e388438e05
commit
f92eaf99ba
@ -29,6 +29,9 @@ class __SecretManager(ABC):
|
||||
|
||||
@abstractmethod
|
||||
def load(self, namespace: str, key: str) -> Optional[str]: ...
|
||||
|
||||
def is_secure(self) -> bool:
|
||||
return True
|
||||
|
||||
|
||||
class GnomeKeyringSM(__SecretManager):
|
||||
@ -117,6 +120,8 @@ class FilesystemSM(__SecretManager):
|
||||
return result[0]
|
||||
return None
|
||||
|
||||
def is_secure(self) -> bool:
|
||||
return False
|
||||
|
||||
class EwpSecrets:
|
||||
def __init__(self):
|
||||
@ -165,6 +170,8 @@ def main() -> int:
|
||||
|
||||
# Perform the requested action
|
||||
if args.action == "store":
|
||||
if not secrets.secret_managers[0].is_secure():
|
||||
print("Warning: This system does not have a secure way to store secrets", file=sys.stderr)
|
||||
secret = input("Enter the secret: ")
|
||||
secrets.store(args.namespace, args.key, secret)
|
||||
return 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user