-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for client_certificate_v2 posture rule #1685
Conversation
changelog detected ✅ |
device_posture_rule.go
Outdated
State string `json:"state,omitempty"` | ||
LastSeen string `json:"last_seen,omitempty"` | ||
ExtendedKeyUsage []string `json:"extended_key_usage,omitempty"` | ||
CheckPrivateKey bool `json:"check_private_key,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you'll want this to be a *bool
- see https://github.com/cloudflare/cloudflare-go/blob/master/docs/conventions.md#booleans
feel free to ping me once the API docs are out and we'll get this merged. |
device_posture_rule_test.go
Outdated
@@ -354,10 +354,10 @@ func TestDevicePostureRules(t *testing.T) { | |||
Input: DevicePostureRuleInput{ | |||
ID: "9e597887-345e-4a32-a09c-68811b129768", | |||
Path: "/tmp/data.zta", | |||
Exists: true, | |||
Exists: newBoolPointer(true), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exists: newBoolPointer(true), | |
Exists: BoolPtr(true), |
device_posture_rule_test.go
Outdated
Thumbprint: "asdfasdfasdfasdf", | ||
Sha256: "D75398FC796D659DEB4170569DCFEC63E3897C71E3AE8642FD3139A554AEE21E", | ||
Running: true, | ||
Running: newBoolPointer(true), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running: newBoolPointer(true), | |
Running: BoolPtr(true), |
device_posture_rule_test.go
Outdated
@@ -413,7 +413,7 @@ func TestDevicePostureFileRule(t *testing.T) { | |||
Match: []DevicePostureRuleMatch{{Platform: "ios"}}, | |||
Input: DevicePostureRuleInput{ | |||
Path: "/tmp/test", | |||
Exists: true, | |||
Exists: newBoolPointer(true), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exists: newBoolPointer(true), | |
Exists: BoolPtr(true), |
device_posture_rule_test.go
Outdated
@@ -468,7 +468,7 @@ func TestDevicePostureDiskEncryptionRule(t *testing.T) { | |||
Expiration: "1h", | |||
Match: []DevicePostureRuleMatch{{Platform: "ios"}}, | |||
Input: DevicePostureRuleInput{ | |||
RequireAll: true, | |||
RequireAll: newBoolPointer(true), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RequireAll: newBoolPointer(true), | |
RequireAll: BoolPtr(true), |
device_posture_rule_test.go
Outdated
@@ -693,7 +691,7 @@ func TestDevicePostureClientCertificateRuleV2(t *testing.T) { | |||
Input: DevicePostureRuleInput{ | |||
CertificateID: "d2c04b78-3ba2-4294-8efa-4e85aef0777f", | |||
CommonName: "example.com", | |||
CheckPrivateKey: &checkPrivateKey, | |||
CheckPrivateKey: newBoolPointer(true), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CheckPrivateKey: newBoolPointer(true), | |
CheckPrivateKey: BoolPtr(true), |
device_posture_rule_test.go
Outdated
|
||
func newBoolPointer(b bool) *bool { | ||
return &b | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
func newBoolPointer(b bool) *bool { | |
return &b | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for the back and forth here but we have a built in for the non-pointer => pointer values you can use here :)
(note: i'd apply these but you've sent the PR using your master
branch which is protected. if you send it using a feature branch, i can automatically fix these ones for you)
This functionality has been released in v0.101.0. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
Description
Added fields to DevicePostureRuleInput to accommodate needed inputs for the new posture type client_certificate_v2
This requires the merge and deployment of documentation changes found here: WDAPI-1954
Has your change been tested?
Because it is just adding fields to the DevicePostureRuleInput struct, this should not affect existing uses of it. There has been a test created to test the creation of the client_certificate_v2 posture rule to test out the added fields.
Screenshots (if appropriate):
Types of changes
What sort of change does your code introduce/modify?
Checklist:
and relies on stable APIs.