Skip to content

Commit 4c41668

Browse files
committed
fix(models): certificate_models.GetCertificateContextArgs now allows IncludeHasPrivateKey query param
fix(certificates): Certificate lookups w/o certificate ID now allow for `IncludeHasPrivateKey`
1 parent 7e5c8aa commit 4c41668

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

v2/api/certificate.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ func (c *Client) GetCertificateContext(gca *GetCertificateContextArgs) (*GetCert
337337
query := apiQuery{
338338
Query: []StringTuple{},
339339
}
340-
if gca.IncludeLocations != nil || gca.CollectionId != nil || gca.IncludeMetadata != nil {
340+
if gca.IncludeLocations != nil || gca.CollectionId != nil || gca.IncludeMetadata != nil || gca.IncludeHasPrivateKey != nil {
341341
if gca.IncludeLocations != nil {
342342
query.Query = append(query.Query, StringTuple{
343343
"includeLocations", strconv.FormatBool(*gca.IncludeLocations),
@@ -353,6 +353,11 @@ func (c *Client) GetCertificateContext(gca *GetCertificateContextArgs) (*GetCert
353353
"collectionId", fmt.Sprintf("%d", *gca.CollectionId),
354354
})
355355
}
356+
if gca.IncludeHasPrivateKey != nil {
357+
query.Query = append(query.Query, StringTuple{
358+
"includeHasPrivateKey", strconv.FormatBool(*gca.IncludeHasPrivateKey),
359+
})
360+
}
356361
}
357362

358363
var endpoint string

v2/api/certificate_models.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,13 @@ type RevokeCertArgs struct {
5353

5454
// GetCertificateContextArgs holds the function arguments used for calling the GetCertificateContext method.
5555
type GetCertificateContextArgs struct {
56-
IncludeMetadata *bool // Query
57-
IncludeLocations *bool // Query
58-
CollectionId *int // Query
59-
Thumbprint string // Query
60-
CommonName string // Query
61-
Id int // Query
56+
IncludeMetadata *bool // Query
57+
IncludeLocations *bool // Query
58+
CollectionId *int // Query
59+
Thumbprint string // Query
60+
CommonName string // Query
61+
Id int // Query
62+
IncludeHasPrivateKey *bool
6263
}
6364

6465
// DeployPFXArgs holds the function arguments used for calling the DeployPFXCertificate method.

0 commit comments

Comments
 (0)