get_certificates() on both drivers, for NetOrk/netork#2656: the node's TLS certificates in netOrk's certificate contract, so netOrk's expiry warnings cover a Proxmox VE node's and a backup server's web UI and API certificate.
What it reads
GET /nodes/{node}/certificates/info (PBS: /nodes/localhost/certificates/info), each row as {name, issuer, valid_from, valid_to, in_use_by} (the shape the OPNsense driver set; Unix timestamps), plus subject, fingerprint and acme. name is the file name (pve-root-ca.pem, pve-ssl.pem, pveproxy-ssl.pem; proxy.pem on PBS), issuer and subject the common names, in_use_by 1 for the certificate the proxy serves (pveproxy-ssl.pem before pve-ssl.pem). The PEM is not returned.
ACME with one more call, GET /nodes/{node}/config: acme is true for the certificate an ACME order writes (pveproxy-ssl.pem, PBS proxy.pem) when a domain is configured (acmedomainN, or domains= in the older acme property). An unreadable config reads as no ACME.
Unreadable certificates are [], as on OPNsense, so a token without Sys.Audit does not fail the poll.
New module napalm_proxmox/certificates.py (ProxmoxCertificatesMixin, PbsCertificatesMixin with the backup server's file names), mixed into both drivers.
Tests
tests/test_certificates.py (written first): the contract shape for all three PVE files, integer timestamps, which file is served with and without pveproxy-ssl.pem, ACME in both config forms, an account without domains, ACME never on pve-ssl.pem, an unreadable config, unreadable certificates, PBS from the recorded fake, and both drivers having the method. Ran with test_connection, test_pbs_connection, test_time_sync, test_fix_templates, test_get_facts, test_pbs_host (103 passed; after the merge with main the whole suite, 752); ruff check and format; mypy on the new module.
Version
0.15.0 (chore(release): 0.15.0 on this branch), README and CHANGELOG updated. 0.14.0 went to #76 (PVE 9.3) meanwhile: main (4b42322) is merged into this branch, the driver keeps all three new mixins (certificates, credential expiry, update history), and this entry moved to its own 0.15.0 section. With that merge the driver requires napalm-device-types >= 4.44.0, as main does. The whole suite (752), napalm-standard check and napalm-standard ratchet pass on the merged tree. netOrk pins this branch's commit in its PR for NetOrk/netork#2656.
`get_certificates()` on both drivers, for NetOrk/netork#2656: the node's TLS certificates in netOrk's certificate contract, so netOrk's expiry warnings cover a Proxmox VE node's and a backup server's web UI and API certificate.
## What it reads
- `GET /nodes/{node}/certificates/info` (PBS: `/nodes/localhost/certificates/info`), each row as `{name, issuer, valid_from, valid_to, in_use_by}` (the shape the OPNsense driver set; Unix timestamps), plus `subject`, `fingerprint` and `acme`. `name` is the file name (`pve-root-ca.pem`, `pve-ssl.pem`, `pveproxy-ssl.pem`; `proxy.pem` on PBS), `issuer` and `subject` the common names, `in_use_by` 1 for the certificate the proxy serves (`pveproxy-ssl.pem` before `pve-ssl.pem`). The PEM is not returned.
- ACME with one more call, `GET /nodes/{node}/config`: `acme` is true for the certificate an ACME order writes (`pveproxy-ssl.pem`, PBS `proxy.pem`) when a domain is configured (`acmedomainN`, or `domains=` in the older `acme` property). An unreadable config reads as no ACME.
- Unreadable certificates are `[]`, as on OPNsense, so a token without `Sys.Audit` does not fail the poll.
New module `napalm_proxmox/certificates.py` (`ProxmoxCertificatesMixin`, `PbsCertificatesMixin` with the backup server's file names), mixed into both drivers.
## Tests
`tests/test_certificates.py` (written first): the contract shape for all three PVE files, integer timestamps, which file is served with and without `pveproxy-ssl.pem`, ACME in both config forms, an account without domains, ACME never on `pve-ssl.pem`, an unreadable config, unreadable certificates, PBS from the recorded fake, and both drivers having the method. Ran with `test_connection`, `test_pbs_connection`, `test_time_sync`, `test_fix_templates`, `test_get_facts`, `test_pbs_host` (103 passed; after the merge with main the whole suite, 752); ruff check and format; mypy on the new module.
## Version
0.15.0 (`chore(release): 0.15.0` on this branch), README and CHANGELOG updated. 0.14.0 went to #76 (PVE 9.3) meanwhile: `main` (4b42322) is merged into this branch, the driver keeps all three new mixins (certificates, credential expiry, update history), and this entry moved to its own 0.15.0 section. With that merge the driver requires napalm-device-types >= 4.44.0, as `main` does. The whole suite (752), `napalm-standard check` and `napalm-standard ratchet` pass on the merged tree. netOrk pins this branch's commit in its PR for NetOrk/netork#2656.
The node's TLS certificates from GET /nodes/{node}/certificates/info (PBS:
/nodes/localhost/certificates/info) in netOrk's certificate contract,
{name, issuer, valid_from, valid_to, in_use_by} with Unix timestamps, so
netOrk's expiry warnings cover a node's web UI and API certificate.
One more call, the node's config, says whether ACME renews the certificate
the proxy serves (acme). The PEM is not returned; unreadable certificates
are [] and an unreadable config reads as no ACME.
Version note: main is 0.14.0 since #76 was merged, so this PR needs another number when it is rebased. #77 (services that still run replaced code, NetOrk/netork#2750) took 0.16.0 and leaves 0.15.0 for this one.
Version note: `main` is 0.14.0 since #76 was merged, so this PR needs another number when it is rebased. #77 (services that still run replaced code, NetOrk/netork#2750) took **0.16.0** and leaves 0.15.0 for this one.
christianmanivong
changed title from feat(certificates): get_certificates on both drivers, with ACME (NetOrk/netork#2656) to feat(certificates): get_certificates on both drivers, with ACME, 0.15.0 (NetOrk/netork#2656)2026-11-26 18:26:43 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
get_certificates()on both drivers, for NetOrk/netork#2656: the node's TLS certificates in netOrk's certificate contract, so netOrk's expiry warnings cover a Proxmox VE node's and a backup server's web UI and API certificate.What it reads
GET /nodes/{node}/certificates/info(PBS:/nodes/localhost/certificates/info), each row as{name, issuer, valid_from, valid_to, in_use_by}(the shape the OPNsense driver set; Unix timestamps), plussubject,fingerprintandacme.nameis the file name (pve-root-ca.pem,pve-ssl.pem,pveproxy-ssl.pem;proxy.pemon PBS),issuerandsubjectthe common names,in_use_by1 for the certificate the proxy serves (pveproxy-ssl.pembeforepve-ssl.pem). The PEM is not returned.GET /nodes/{node}/config:acmeis true for the certificate an ACME order writes (pveproxy-ssl.pem, PBSproxy.pem) when a domain is configured (acmedomainN, ordomains=in the olderacmeproperty). An unreadable config reads as no ACME.[], as on OPNsense, so a token withoutSys.Auditdoes not fail the poll.New module
napalm_proxmox/certificates.py(ProxmoxCertificatesMixin,PbsCertificatesMixinwith the backup server's file names), mixed into both drivers.Tests
tests/test_certificates.py(written first): the contract shape for all three PVE files, integer timestamps, which file is served with and withoutpveproxy-ssl.pem, ACME in both config forms, an account without domains, ACME never onpve-ssl.pem, an unreadable config, unreadable certificates, PBS from the recorded fake, and both drivers having the method. Ran withtest_connection,test_pbs_connection,test_time_sync,test_fix_templates,test_get_facts,test_pbs_host(103 passed; after the merge with main the whole suite, 752); ruff check and format; mypy on the new module.Version
0.15.0 (
chore(release): 0.15.0on this branch), README and CHANGELOG updated. 0.14.0 went to #76 (PVE 9.3) meanwhile:main(4b42322) is merged into this branch, the driver keeps all three new mixins (certificates, credential expiry, update history), and this entry moved to its own 0.15.0 section. With that merge the driver requires napalm-device-types >= 4.44.0, asmaindoes. The whole suite (752),napalm-standard checkandnapalm-standard ratchetpass on the merged tree. netOrk pins this branch's commit in its PR for NetOrk/netork#2656.The node's TLS certificates from GET /nodes/{node}/certificates/info (PBS: /nodes/localhost/certificates/info) in netOrk's certificate contract, {name, issuer, valid_from, valid_to, in_use_by} with Unix timestamps, so netOrk's expiry warnings cover a node's web UI and API certificate. One more call, the node's config, says whether ACME renews the certificate the proxy serves (acme). The PEM is not returned; unreadable certificates are [] and an unreadable config reads as no ACME.Version note:
mainis 0.14.0 since #76 was merged, so this PR needs another number when it is rebased. #77 (services that still run replaced code, NetOrk/netork#2750) took 0.16.0 and leaves 0.15.0 for this one.feat(certificates): get_certificates on both drivers, with ACME (NetOrk/netork#2656)to feat(certificates): get_certificates on both drivers, with ACME, 0.15.0 (NetOrk/netork#2656)