Simplify field names for ProvisionerInfo

This commit is contained in:
Mariano Cano 2022-08-10 17:44:14 -07:00
parent a65adc032b
commit eb091aec54
4 changed files with 10 additions and 10 deletions

View file

@ -100,9 +100,9 @@ func (a *Authority) Sign(csr *x509.CertificateRequest, signOpts provisioner.Sign
case provisioner.Interface:
prov = k
pInfo = &casapi.ProvisionerInfo{
ProvisionerID: prov.GetID(),
ProvisionerType: prov.GetType().String(),
ProvisionerName: prov.GetName(),
ID: prov.GetID(),
Type: prov.GetType().String(),
Name: prov.GetName(),
}
// Adds new options to NewCertificate
case provisioner.CertificateOptions:

View file

@ -63,9 +63,9 @@ type CreateCertificateRequest struct {
// ProvisionerInfo contains information of the provisioner used to authorize a
// certificate.
type ProvisionerInfo struct {
ProvisionerID string
ProvisionerType string
ProvisionerName string
ID string
Type string
Name string
}
// CreateCertificateResponse is the response to a create certificate request.

View file

@ -79,9 +79,9 @@ func (s *StepCAS) CreateCertificate(req *apiv1.CreateCertificateRequest) (*apiv1
if p := req.Provisioner; p != nil {
info = &raInfo{
AuthorityID: s.authorityID,
ProvisionerID: p.ProvisionerID,
ProvisionerType: p.ProvisionerType,
ProvisionerName: p.ProvisionerName,
ProvisionerID: p.ID,
ProvisionerType: p.Type,
ProvisionerName: p.Name,
}
}

View file

@ -667,7 +667,7 @@ func TestStepCAS_CreateCertificate(t *testing.T) {
{"ok with provisioner", fields{jwk, client, testRootFingerprint}, args{&apiv1.CreateCertificateRequest{
CSR: testCR,
Lifetime: time.Hour,
Provisioner: &apiv1.ProvisionerInfo{ProvisionerID: "provisioner-id", ProvisionerType: "ACME"},
Provisioner: &apiv1.ProvisionerInfo{ID: "provisioner-id", Type: "ACME"},
}}, &apiv1.CreateCertificateResponse{
Certificate: testCrt,
CertificateChain: []*x509.Certificate{testIssCrt},