...
 
Commits (2)
......@@ -16,7 +16,6 @@ XMPP_JID = os.getenv("HH_XMPP_JID", None)
XMPP_PASSWORD = os.getenv("HH_XMPP_PASSWORD", None)
XMPP_SENDER = os.getenv("HH_XMPP_SENDER", None)
VAULT_ADDR = os.getenv("VAULT_ADDR", None)
VAULT_ENTITY = os.getenv("VAULT_ENTITY", None)
VAULT_TOKEN = os.getenv("VAULT_TOKEN", None)
......@@ -107,7 +106,7 @@ def check_and_renew_token(vault):
# Test Vault server
# Test Criteria: initialized, unsealed, valid token, and successful list of secrets
# Returns: hvac.Client if all criteria passes, False if any don't
def vault_test(address, entity, token):
def vault_test(address, token):
# Init the client
vault = hvac.Client(url=address, token=token)
......@@ -139,13 +138,6 @@ def vault_test(address, entity, token):
send_xmpp("system", message)
return False
# Do a test read to confirm we're good
if not vault.secrets.kv.list_secrets(mount_point=entity, path="/"):
message = "[ERROR]: Failed to list secrets at: " + entity
LOG.error("%s", message)
send_xmpp("system", message)
return False
# Testing is done if we get here, return the hvac.Client instance
LOG.info("Connected to Vault")
return vault
......@@ -175,11 +167,10 @@ def get_xmpp(
def get_vault():
vault_address = VAULT_ADDR
vault_entity = VAULT_ENTITY
vault_token = VAULT_TOKEN
# Test configuration
vault = vault_test(vault_address, vault_entity, vault_token)
vault = vault_test(vault_address, vault_token)
if not vault:
message = "[ERROR]: Vault is not ready"
......@@ -258,7 +249,6 @@ if __name__ == "__main__":
XMPP_PASSWORD,
XMPP_SENDER,
VAULT_ADDR,
VAULT_ENTITY,
VAULT_TOKEN,
}:
LOG.error("Missing required ENV variables")
......
......@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
setuptools.setup(
name="hhelper",
version="1.0.11",
version="1.0.12",
author="Tyler Page",
author_email="hhelper-pypi@tpage.io",
description="A homelab helper module",
......