Skip to content

Commit 59ce70c

Browse files
feat(api): api update (#2321)
1 parent d23ab1a commit 59ce70c

File tree

3 files changed

+77
-17
lines changed

3 files changed

+77
-17
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1493
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3d78f855257b55bbb80884f99c3802cae877968d140eed3557fcb2cdd5f937b3.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-56f3021fb085763371fa342d21f231ef420fbfdddf6599c584bc84e609c421fa.yml

src/resources/zero-trust/gateway/rules.ts

Lines changed: 74 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -390,9 +390,9 @@ export interface RuleSetting {
390390

391391
/**
392392
* Add your own custom resolvers to route queries that match the resolver policy.
393-
* Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will
394-
* route to the address closest to their origin. Only valid when a rule's action is
395-
* set to 'resolve'.
393+
* Cannot be used when 'resolve_dns_through_cloudflare' or 'resolve_dns_internally'
394+
* are set. DNS queries will route to the address closest to their origin. Only
395+
* valid when a rule's action is set to 'resolve'.
396396
*/
397397
dns_resolvers?: RuleSetting.DNSResolvers;
398398

@@ -458,10 +458,19 @@ export interface RuleSetting {
458458
*/
459459
quarantine?: RuleSetting.Quarantine;
460460

461+
/**
462+
* Configure to forward the query to the internal DNS service, passing the
463+
* specified 'view_id' as input. Cannot be set when 'dns_resolvers' are specified
464+
* or 'resolve_dns_through_cloudflare' is set. Only valid when a rule's action is
465+
* set to 'resolve'.
466+
*/
467+
resolve_dns_internally?: RuleSetting.ResolveDNSInternally;
468+
461469
/**
462470
* Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS
463-
* resolver. Cannot be set when dns_resolvers are specified. Only valid when a
464-
* rule's action is set to 'resolve'.
471+
* resolver. Cannot be set when 'dns_resolvers' are specified or
472+
* 'resolve_dns_internally' is set. Only valid when a rule's action is set to
473+
* 'resolve'.
465474
*/
466475
resolve_dns_through_cloudflare?: boolean;
467476

@@ -529,9 +538,9 @@ export namespace RuleSetting {
529538

530539
/**
531540
* Add your own custom resolvers to route queries that match the resolver policy.
532-
* Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will
533-
* route to the address closest to their origin. Only valid when a rule's action is
534-
* set to 'resolve'.
541+
* Cannot be used when 'resolve_dns_through_cloudflare' or 'resolve_dns_internally'
542+
* are set. DNS queries will route to the address closest to their origin. Only
543+
* valid when a rule's action is set to 'resolve'.
535544
*/
536545
export interface DNSResolvers {
537546
ipv4?: Array<RulesAPI.DNSResolverSettingsV4>;
@@ -634,6 +643,26 @@ export namespace RuleSetting {
634643
>;
635644
}
636645

646+
/**
647+
* Configure to forward the query to the internal DNS service, passing the
648+
* specified 'view_id' as input. Cannot be set when 'dns_resolvers' are specified
649+
* or 'resolve_dns_through_cloudflare' is set. Only valid when a rule's action is
650+
* set to 'resolve'.
651+
*/
652+
export interface ResolveDNSInternally {
653+
/**
654+
* The fallback behavior to apply when the internal DNS response code is different
655+
* from 'NOERROR' or when the response data only contains CNAME records for 'A' or
656+
* 'AAAA' queries.
657+
*/
658+
fallback?: 'none' | 'public_dns';
659+
660+
/**
661+
* The internal DNS view identifier that's passed to the internal DNS service.
662+
*/
663+
view_id?: string;
664+
}
665+
637666
/**
638667
* Configure behavior when an upstream cert is invalid or an SSL error occurs.
639668
*/
@@ -694,9 +723,9 @@ export interface RuleSettingParam {
694723

695724
/**
696725
* Add your own custom resolvers to route queries that match the resolver policy.
697-
* Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will
698-
* route to the address closest to their origin. Only valid when a rule's action is
699-
* set to 'resolve'.
726+
* Cannot be used when 'resolve_dns_through_cloudflare' or 'resolve_dns_internally'
727+
* are set. DNS queries will route to the address closest to their origin. Only
728+
* valid when a rule's action is set to 'resolve'.
700729
*/
701730
dns_resolvers?: RuleSettingParam.DNSResolvers;
702731

@@ -762,10 +791,19 @@ export interface RuleSettingParam {
762791
*/
763792
quarantine?: RuleSettingParam.Quarantine;
764793

794+
/**
795+
* Configure to forward the query to the internal DNS service, passing the
796+
* specified 'view_id' as input. Cannot be set when 'dns_resolvers' are specified
797+
* or 'resolve_dns_through_cloudflare' is set. Only valid when a rule's action is
798+
* set to 'resolve'.
799+
*/
800+
resolve_dns_internally?: RuleSettingParam.ResolveDNSInternally;
801+
765802
/**
766803
* Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS
767-
* resolver. Cannot be set when dns_resolvers are specified. Only valid when a
768-
* rule's action is set to 'resolve'.
804+
* resolver. Cannot be set when 'dns_resolvers' are specified or
805+
* 'resolve_dns_internally' is set. Only valid when a rule's action is set to
806+
* 'resolve'.
769807
*/
770808
resolve_dns_through_cloudflare?: boolean;
771809

@@ -833,9 +871,9 @@ export namespace RuleSettingParam {
833871

834872
/**
835873
* Add your own custom resolvers to route queries that match the resolver policy.
836-
* Cannot be used when resolve_dns_through_cloudflare is set. DNS queries will
837-
* route to the address closest to their origin. Only valid when a rule's action is
838-
* set to 'resolve'.
874+
* Cannot be used when 'resolve_dns_through_cloudflare' or 'resolve_dns_internally'
875+
* are set. DNS queries will route to the address closest to their origin. Only
876+
* valid when a rule's action is set to 'resolve'.
839877
*/
840878
export interface DNSResolvers {
841879
ipv4?: Array<RulesAPI.DNSResolverSettingsV4Param>;
@@ -938,6 +976,26 @@ export namespace RuleSettingParam {
938976
>;
939977
}
940978

979+
/**
980+
* Configure to forward the query to the internal DNS service, passing the
981+
* specified 'view_id' as input. Cannot be set when 'dns_resolvers' are specified
982+
* or 'resolve_dns_through_cloudflare' is set. Only valid when a rule's action is
983+
* set to 'resolve'.
984+
*/
985+
export interface ResolveDNSInternally {
986+
/**
987+
* The fallback behavior to apply when the internal DNS response code is different
988+
* from 'NOERROR' or when the response data only contains CNAME records for 'A' or
989+
* 'AAAA' queries.
990+
*/
991+
fallback?: 'none' | 'public_dns';
992+
993+
/**
994+
* The internal DNS view identifier that's passed to the internal DNS service.
995+
*/
996+
view_id?: string;
997+
}
998+
941999
/**
9421000
* Configure behavior when an upstream cert is invalid or an SSL error occurs.
9431001
*/

tests/api-resources/zero-trust/gateway/rules.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ describe('resource rules', () => {
7575
override_ips: ['1.1.1.1', '2.2.2.2'],
7676
payload_log: { enabled: true },
7777
quarantine: { file_types: ['exe'] },
78+
resolve_dns_internally: { fallback: 'none', view_id: 'view_id' },
7879
resolve_dns_through_cloudflare: true,
7980
untrusted_cert: { action: 'pass_through' },
8081
},
@@ -158,6 +159,7 @@ describe('resource rules', () => {
158159
override_ips: ['1.1.1.1', '2.2.2.2'],
159160
payload_log: { enabled: true },
160161
quarantine: { file_types: ['exe'] },
162+
resolve_dns_internally: { fallback: 'none', view_id: 'view_id' },
161163
resolve_dns_through_cloudflare: true,
162164
untrusted_cert: { action: 'pass_through' },
163165
},

0 commit comments

Comments
 (0)