Add certificate issuance, CSR signing, and cert listing to web UI
- Add SignCSR RPC to v2 CA proto and regenerate; implement handleSignCSR
in CA engine and caServer gRPC layer; add SignCSR client method and
POST /pki/sign-csr web route with result display in pki.html
- Fix issuer detail cert listing: template was using map-style index on
CertSummary structs; switch to struct field access and populate
IssuedBy/IssuedAt fields from proto response
- Add certificate detail view (cert_detail.html) with GET /cert/{serial}
and GET /cert/{serial}/download routes
- Update Makefile proto target to generate both v1 and v2 protos
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
36
web/templates/cert_detail.html
Normal file
36
web/templates/cert_detail.html
Normal file
@@ -0,0 +1,36 @@
|
||||
{{define "title"}} - Certificate: {{.Cert.Serial}}{{end}}
|
||||
{{define "content"}}
|
||||
<div class="page-header">
|
||||
<h2>Certificate: {{.Cert.CommonName}}</h2>
|
||||
<div class="page-meta">
|
||||
<a href="/pki/issuer/{{.Cert.Issuer}}">← Issuer: {{.Cert.Issuer}}</a>
|
||||
 · 
|
||||
<a href="/pki/cert/{{.Cert.Serial}}/download">Download Certificate (PEM)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-title">Certificate Details</div>
|
||||
<table class="kv-table">
|
||||
<tbody>
|
||||
<tr><th>Serial</th><td><code>{{.Cert.Serial}}</code></td></tr>
|
||||
<tr><th>Common Name</th><td>{{.Cert.CommonName}}</td></tr>
|
||||
<tr><th>Issuer</th><td>{{.Cert.Issuer}}</td></tr>
|
||||
<tr><th>Profile</th><td>{{.Cert.Profile}}</td></tr>
|
||||
{{if .Cert.SANs}}
|
||||
<tr><th>SANs</th><td>{{range $i, $san := .Cert.SANs}}{{if $i}}, {{end}}{{$san}}{{end}}</td></tr>
|
||||
{{end}}
|
||||
<tr><th>Issued By</th><td>{{.Cert.IssuedBy}}</td></tr>
|
||||
<tr><th>Issued At</th><td>{{.Cert.IssuedAt}}</td></tr>
|
||||
<tr><th>Expires At</th><td>{{.Cert.ExpiresAt}}</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-title">Certificate PEM</div>
|
||||
<div class="form-group">
|
||||
<textarea rows="12" class="pem-input" readonly>{{.Cert.CertPEM}}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user