Add cluster-managed certificate metadata support

This commit is contained in:
2026-09-19 10:22:03 -04:00
parent 6cff2261d5
commit 43826bebed
4 changed files with 226 additions and 1 deletions
+26
View File
@@ -23,9 +23,11 @@ from functions import common
from functions import request
from functions import renew
from functions import revoke
from functions import cluster_cert
DEFAULT_CERTIFICATE_JS = "/app/internal/certificate.js"
DEFAULT_CERTIFICATE_SCHEMA = "/app/schema/components/certificate-object.json"
def main() -> None:
@@ -36,15 +38,28 @@ def main() -> None:
)
)
certificate_schema = Path(
os.environ.get(
"NPM_CERTIFICATE_SCHEMA",
DEFAULT_CERTIFICATE_SCHEMA,
)
)
config = common.load_config()
common.log(f"certificate.js={certificate_js}")
common.log(f"certificate_schema={certificate_schema}")
common.log(f"request_gate={config.request}")
common.log(f"renew_gate={config.renew}")
common.log(f"revoke_gate={config.revoke}")
common.log(f"cluster_cert={config.cluster_cert}")
source = common.load_source(certificate_js)
schema_source = None
if config.cluster_cert:
schema_source = common.load_source(certificate_schema)
if config.any_enabled:
source = common.apply_authority_helper(source)
@@ -57,6 +72,10 @@ def main() -> None:
if config.revoke:
source = revoke.apply(source)
if config.cluster_cert:
source = cluster_cert.apply_certificate_js(source)
schema_source = cluster_cert.apply_schema(schema_source)
common.verify(source, config)
if config.request:
@@ -68,8 +87,15 @@ def main() -> None:
if config.revoke:
revoke.verify(source)
if config.cluster_cert:
cluster_cert.verify_certificate_js(source)
cluster_cert.verify_schema(schema_source)
common.write_source(certificate_js, source)
if config.cluster_cert:
common.write_source(certificate_schema, schema_source)
common.log("All requested ACME authority gates applied successfully")