Skip to content

Commit bb177bc

Browse files
committed
fix(certs): Check that Template and EnrollmentPattern are not both empty for enrollments
1 parent 5175bb8 commit bb177bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

v3/api/certificate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ func (c *Client) EnrollPFXV2(ea *EnrollPFXFctArgsV2) (*EnrollResponseV2, error)
113113
var missingFields []string
114114

115115
// TODO: Probably a better way to express these if blocks
116-
if ea.Template == "" {
117-
missingFields = append(missingFields, "Template")
116+
if ea.Template == "" && ea.EnrollmentPatternId == 0 {
117+
missingFields = append(missingFields, "Template or EnrollmentPatternId")
118118
}
119119
if ea.CertificateAuthority == "" {
120120
missingFields = append(missingFields, "CertificateAuthority")

0 commit comments

Comments
 (0)