mirror of
https://github.com/smallstep/certificates.git
synced 2024-10-31 03:20:16 +00:00
Report provisioner and parent on linkedca
This commit is contained in:
parent
20b2c6a201
commit
de99c3cac0
@ -292,11 +292,22 @@ func (c *linkedCaClient) StoreRenewedCertificate(parent *x509.Certificate, fullc
|
|||||||
return errors.Wrap(err, "error posting certificate")
|
return errors.Wrap(err, "error posting certificate")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *linkedCaClient) StoreSSHCertificate(crt *ssh.Certificate) error {
|
func (c *linkedCaClient) StoreSSHCertificate(prov provisioner.Interface, crt *ssh.Certificate) error {
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
_, err := c.client.PostSSHCertificate(ctx, &linkedca.SSHCertificateRequest{
|
_, err := c.client.PostSSHCertificate(ctx, &linkedca.SSHCertificateRequest{
|
||||||
Certificate: string(ssh.MarshalAuthorizedKey(crt)),
|
Certificate: string(ssh.MarshalAuthorizedKey(crt)),
|
||||||
|
Provisioner: createProvisionerIdentity(prov),
|
||||||
|
})
|
||||||
|
return errors.Wrap(err, "error posting ssh certificate")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *linkedCaClient) StoreRenewedSSHCertificate(parent, crt *ssh.Certificate) error {
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
_, err := c.client.PostSSHCertificate(ctx, &linkedca.SSHCertificateRequest{
|
||||||
|
Certificate: string(ssh.MarshalAuthorizedKey(crt)),
|
||||||
|
ParentCertificate: string(ssh.MarshalAuthorizedKey(parent)),
|
||||||
})
|
})
|
||||||
return errors.Wrap(err, "error posting ssh certificate")
|
return errors.Wrap(err, "error posting ssh certificate")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user