Skip to content
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

GATE-4979: Add support for resolver policies #1436

Merged
merged 3 commits into from Nov 6, 2023

Conversation

joebb97
Copy link
Contributor

@joebb97 joebb97 commented Nov 6, 2023

Description

Resolver policies allow a Zero Trust customer to configure which upstream DNS Resolver to use when criteria in a a rule are matched.

This PR provides this functionality to Golang API Clients.

Has your change been tested?

Additional serialization tests have been added

Types of changes

What sort of change does your code introduce/modify?

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • This change is using publicly documented in cloudflare/api-schemas
    and relies on stable APIs.

teams_rules.go Outdated
@@ -57,6 +57,12 @@ type TeamsRuleSettings struct {

// Action taken when an untrusted origin certificate error occurs in a http allow rule
UntrustedCertSettings *UntrustedCertSettings `json:"untrusted_cert"`

// Specifies that a resolver policy should use Cloudflare's DNS Resolver.
ResolveDnsThroughCF bool `json:"resolve_dns_through_cloudflare,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as the JSON is resolve_dns_through_cloudflare, let's keep the struct matching it.

also, per https://github.com/cloudflare/cloudflare-go/blob/master/docs/conventions.md#booleans (and eventually semgrep checks when the queue clears), we'll want to use *bool, not bool here.

teams_rules.go Outdated
@@ -101,6 +107,28 @@ type TeamsCheckSessionSettings struct {
Duration Duration `json:"duration"`
}

type (
DnsResolverSettings struct {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we please prefix these types (like the others) to avoid polluting the global namespace?

@jacobbednarz
Copy link
Member

couple of small convention changes to address but looks good overall 👍

@joebb97
Copy link
Contributor Author

joebb97 commented Nov 6, 2023

thanks Jacob, will fix these now

Copy link
Contributor

github-actions bot commented Nov 6, 2023

changelog detected ✅

.changelog/1436.txt Outdated Show resolved Hide resolved
@jacobbednarz
Copy link
Member

swapped to using inbuilt helpers in 553f4e2 but other than that, looks great! thanks 🏆

@jacobbednarz jacobbednarz merged commit c06b981 into cloudflare:master Nov 6, 2023
11 checks passed
@github-actions github-actions bot added this to the v0.81.0 milestone Nov 6, 2023
github-actions bot pushed a commit that referenced this pull request Nov 6, 2023
@joebb97 joebb97 deleted the jbuiteweg/GATE-4979 branch November 7, 2023 02:27
Copy link
Contributor

This functionality has been released in v0.81.0.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants