certmate-cli 0.1.4__tar.gz → 0.1.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -79,6 +79,7 @@ htmlcov/
79
79
  .pytest_cache/
80
80
  .coverage
81
81
  coverage.xml
82
+ coverage.json
82
83
  test_results.json
83
84
 
84
85
  # Local dev / debug scripts (kept on developer machines only)
@@ -114,3 +115,7 @@ theme-baseline/
114
115
  UI_DRACONIAN_ANALYSIS.md
115
116
  UI_UX_Opinioni_CertMate.pdf
116
117
  UI_REDESIGN_PLAN.md
118
+
119
+ # Local nginx reverse-proxy config: copy nginx.conf.example to nginx.conf and
120
+ # fill in your domain. The copy is yours; the example is tracked (#576).
121
+ nginx.conf
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: certmate-cli
3
- Version: 0.1.4
3
+ Version: 0.1.5
4
4
  Summary: CertMate command-line interface — the SSL certificate lifecycle from your terminal
5
5
  Project-URL: Homepage, https://github.com/fabriziosalmi/certmate
6
6
  Project-URL: Source, https://github.com/fabriziosalmi/certmate/tree/main/clients/certmate-cli
@@ -23,7 +23,7 @@ Classifier: Topic :: Security
23
23
  Classifier: Topic :: System :: Systems Administration
24
24
  Classifier: Topic :: Utilities
25
25
  Requires-Python: >=3.9
26
- Requires-Dist: certmate-sdk>=0.1.3
26
+ Requires-Dist: certmate-sdk>=0.1.5
27
27
  Requires-Dist: rich>=13
28
28
  Requires-Dist: typer>=0.9
29
29
  Description-Content-Type: text/markdown
@@ -1,2 +1,2 @@
1
1
  """certmate-cli — the CertMate SSL lifecycle from your terminal (built on certmate-sdk)."""
2
- __version__ = "0.1.4"
2
+ __version__ = "0.1.5"
@@ -166,11 +166,31 @@ def cert_ls(ctx: typer.Context):
166
166
  table.add_column("DAYS", justify="right")
167
167
  table.add_column("CA")
168
168
  table.add_column("AUTO-RENEW")
169
- for c in sorted(certs, key=lambda x: (x.days_until_expiry if x.days_until_expiry is not None else 1 << 30)):
169
+ # Sort by seconds where the server sends them: a certificate with 23 hours
170
+ # left and one that lapsed an hour ago are both 0 or -1 in whole days, and
171
+ # would otherwise land next to each other in either order.
172
+ def _remaining(cert):
173
+ if cert.seconds_left is not None:
174
+ return cert.seconds_left
175
+ if cert.days_until_expiry is not None:
176
+ return cert.days_until_expiry * 86400
177
+ return 1 << 40
178
+
179
+ for c in sorted(certs, key=_remaining):
170
180
  days = c.days_until_expiry
171
- days_str = "-" if days is None else str(days)
172
- colour = "green"
173
- if days is not None:
181
+ expired = c.has_expired()
182
+ # "0" for a certificate with 23 hours left was read as expired by
183
+ # everything that saw it, including CertMate's own dashboard until
184
+ # server 2.32.2. Say which of the two it is instead of printing the
185
+ # number that cannot tell them apart.
186
+ if expired is True:
187
+ days_str, colour = "expired", "red"
188
+ elif days is None:
189
+ days_str, colour = "-", "green"
190
+ elif days == 0:
191
+ days_str, colour = ("<1" if expired is False else "?"), "red"
192
+ else:
193
+ days_str = str(days)
174
194
  colour = "red" if days < 7 else ("yellow" if days < 30 else "green")
175
195
  table.add_row(
176
196
  c.domain,
@@ -187,8 +207,16 @@ def cert_info(ctx: typer.Context, domain: str):
187
207
  """Show a certificate's details."""
188
208
  c = _run(lambda: _client(ctx).get_certificate(domain))
189
209
  out.print(f"[bold]{c.domain}[/]")
190
- out.print(f" expires: {c.expiry_date or '-'} "
191
- f"({c.days_until_expiry if c.days_until_expiry is not None else '?'} days)")
210
+ if c.has_expired() is True:
211
+ remaining = "[red]expired[/]"
212
+ elif c.days_until_expiry is None:
213
+ remaining = "? days"
214
+ elif c.days_until_expiry == 0:
215
+ # Under a day, and not expired, or the server is too old to say.
216
+ remaining = "less than a day" if c.has_expired() is False else "? days"
217
+ else:
218
+ remaining = f"{c.days_until_expiry} days"
219
+ out.print(f" expires: {c.expiry_date or '-'} ({remaining})")
192
220
  out.print(f" CA: {c.ca_provider or '-'}")
193
221
  out.print(f" DNS: {c.dns_provider or '-'}")
194
222
  out.print(f" auto-renew: {c.auto_renew}")
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "certmate-cli"
7
- version = "0.1.4"
7
+ version = "0.1.5"
8
8
  description = "CertMate command-line interface — the SSL certificate lifecycle from your terminal"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -30,10 +30,13 @@ classifiers = [
30
30
  ]
31
31
  # Built ON the SDK (never the reverse). typer for the command surface, rich
32
32
  # for tables/spinners. Still light — no server deps.
33
- # The SDK floor tracks the CLI release: 0.1.2 needs TransportError and the
34
- # renew/audit semantics introduced in certmate-sdk 0.1.2.
33
+ # The SDK floor tracks the CLI release, and now something enforces that:
34
+ # tests/test_version_consistency.py fails if this floor falls behind the SDK
35
+ # in the tree. It had already drifted once, sitting at 0.1.3 while both
36
+ # packages were 0.1.4. 0.1.5 is needed for Certificate.has_expired(), which
37
+ # `cert ls` and `cert info` call on every row.
35
38
  dependencies = [
36
- "certmate-sdk>=0.1.3",
39
+ "certmate-sdk>=0.1.5",
37
40
  "typer>=0.9",
38
41
  "rich>=13",
39
42
  ]
File without changes