Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1411
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9310ae6fd17ecb7b743b6d9e34cd838d0a626af0f2a786c07c9d17085b7893ed.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d6dd7ea434d79d52578f28ebdc5ddd1fbf9e68526bf0e32285f1c3725ccacb4d.yml
60 changes: 47 additions & 13 deletions src/cloudflare/types/zero_trust/access_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing_extensions import TypeAlias

from .ip_rule import IPRule
from ..._models import BaseModel
from .email_rule import EmailRule
from .group_rule import GroupRule
from .domain_rule import DomainRule
Expand All @@ -23,26 +24,59 @@
from .authentication_method_rule import AuthenticationMethodRule
from .any_valid_service_token_rule import AnyValidServiceTokenRule

__all__ = ["AccessRule"]
__all__ = [
"AccessRule",
"AccessAuthContextRule",
"AccessAuthContextRuleAuthContext",
"AccessCommonNameRule",
"AccessCommonNameRuleCommonName",
]


class AccessAuthContextRuleAuthContext(BaseModel):
id: str
"""The ID of an Authentication context."""

ac_id: str
"""The ACID of an Authentication context."""

identity_provider_id: str
"""The ID of your Azure identity provider."""


class AccessAuthContextRule(BaseModel):
auth_context: AccessAuthContextRuleAuthContext


class AccessCommonNameRuleCommonName(BaseModel):
common_name: str
"""The common name to match."""


class AccessCommonNameRule(BaseModel):
common_name: AccessCommonNameRuleCommonName


AccessRule: TypeAlias = Union[
EmailRule,
EmailListRule,
DomainRule,
EveryoneRule,
IPRule,
IPListRule,
CertificateRule,
GroupRule,
AnyValidServiceTokenRule,
AccessAuthContextRule,
AuthenticationMethodRule,
AzureGroupRule,
CertificateRule,
AccessCommonNameRule,
CountryRule,
AccessDevicePostureRule,
DomainRule,
EmailListRule,
EmailRule,
EveryoneRule,
ExternalEvaluationRule,
GitHubOrganizationRule,
GSuiteGroupRule,
IPListRule,
IPRule,
OktaGroupRule,
SAMLGroupRule,
ServiceTokenRule,
AnyValidServiceTokenRule,
ExternalEvaluationRule,
CountryRule,
AuthenticationMethodRule,
AccessDevicePostureRule,
]
61 changes: 47 additions & 14 deletions src/cloudflare/types/zero_trust/access_rule_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import annotations

from typing import Union
from typing_extensions import TypeAlias
from typing_extensions import Required, TypeAlias, TypedDict

from .ip_rule_param import IPRuleParam
from .email_rule_param import EmailRuleParam
Expand All @@ -25,26 +25,59 @@
from .authentication_method_rule_param import AuthenticationMethodRuleParam
from .any_valid_service_token_rule_param import AnyValidServiceTokenRuleParam

__all__ = ["AccessRuleParam"]
__all__ = [
"AccessRuleParam",
"AccessAuthContextRule",
"AccessAuthContextRuleAuthContext",
"AccessCommonNameRule",
"AccessCommonNameRuleCommonName",
]


class AccessAuthContextRuleAuthContext(TypedDict, total=False):
id: Required[str]
"""The ID of an Authentication context."""

ac_id: Required[str]
"""The ACID of an Authentication context."""

identity_provider_id: Required[str]
"""The ID of your Azure identity provider."""


class AccessAuthContextRule(TypedDict, total=False):
auth_context: Required[AccessAuthContextRuleAuthContext]


class AccessCommonNameRuleCommonName(TypedDict, total=False):
common_name: Required[str]
"""The common name to match."""


class AccessCommonNameRule(TypedDict, total=False):
common_name: Required[AccessCommonNameRuleCommonName]


AccessRuleParam: TypeAlias = Union[
EmailRuleParam,
EmailListRuleParam,
DomainRuleParam,
EveryoneRuleParam,
IPRuleParam,
IPListRuleParam,
CertificateRuleParam,
GroupRuleParam,
AnyValidServiceTokenRuleParam,
AccessAuthContextRule,
AuthenticationMethodRuleParam,
AzureGroupRuleParam,
CertificateRuleParam,
AccessCommonNameRule,
CountryRuleParam,
AccessDevicePostureRuleParam,
DomainRuleParam,
EmailListRuleParam,
EmailRuleParam,
EveryoneRuleParam,
ExternalEvaluationRuleParam,
GitHubOrganizationRuleParam,
GSuiteGroupRuleParam,
IPListRuleParam,
IPRuleParam,
OktaGroupRuleParam,
SAMLGroupRuleParam,
ServiceTokenRuleParam,
AnyValidServiceTokenRuleParam,
ExternalEvaluationRuleParam,
CountryRuleParam,
AuthenticationMethodRuleParam,
AccessDevicePostureRuleParam,
]
4 changes: 4 additions & 0 deletions src/cloudflare/types/zero_trust/github_organization_rule.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional

from pydantic import Field as FieldInfo

Expand All @@ -15,6 +16,9 @@ class GitHubOrganization(BaseModel):
name: str
"""The name of the organization."""

team: Optional[str] = None
"""The name of the team"""


class GitHubOrganizationRule(BaseModel):
github_organization: GitHubOrganization = FieldInfo(alias="github-organization")
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ class GitHubOrganization(TypedDict, total=False):
name: Required[str]
"""The name of the organization."""

team: str
"""The name of the team"""


class GitHubOrganizationRuleParam(TypedDict, total=False):
github_organization: Required[Annotated[GitHubOrganization, PropertyInfo(alias="github-organization")]]
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
account_id="023e105f4ecef8ad9ca31a8372d0c353",
id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
decision="allow",
exclude=[{"email": {"email": "test@example.com"}}],
include=[{"email": {"email": "test@example.com"}}],
exclude=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
name="Allow devs",
require=[{"email": {"email": "test@example.com"}}],
require=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
)
assert_matches_type(PolicyTestCreateResponse, policy_test, path=["response"])

Expand Down Expand Up @@ -136,10 +136,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
account_id="023e105f4ecef8ad9ca31a8372d0c353",
id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
decision="allow",
exclude=[{"email": {"email": "test@example.com"}}],
include=[{"email": {"email": "test@example.com"}}],
exclude=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
name="Allow devs",
require=[{"email": {"email": "test@example.com"}}],
require=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
)
assert_matches_type(PolicyTestCreateResponse, policy_test, path=["response"])

Expand Down
24 changes: 12 additions & 12 deletions tests/api_resources/zero_trust/access/test_applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,10 +984,10 @@ def test_method_create_with_all_params_overload_9(self, client: Cloudflare) -> N
policies=[
{
"decision": "allow",
"include": [{"email": {"email": "test@example.com"}}],
"include": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
"name": "Allow devs",
"exclude": [{"email": {"email": "test@example.com"}}],
"require": [{"email": {"email": "test@example.com"}}],
"exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
"require": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
}
],
)
Expand Down Expand Up @@ -2131,10 +2131,10 @@ def test_method_update_with_all_params_overload_9(self, client: Cloudflare) -> N
policies=[
{
"decision": "allow",
"include": [{"email": {"email": "test@example.com"}}],
"include": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
"name": "Allow devs",
"exclude": [{"email": {"email": "test@example.com"}}],
"require": [{"email": {"email": "test@example.com"}}],
"exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
"require": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
}
],
)
Expand Down Expand Up @@ -3453,10 +3453,10 @@ async def test_method_create_with_all_params_overload_9(self, async_client: Asyn
policies=[
{
"decision": "allow",
"include": [{"email": {"email": "test@example.com"}}],
"include": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
"name": "Allow devs",
"exclude": [{"email": {"email": "test@example.com"}}],
"require": [{"email": {"email": "test@example.com"}}],
"exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
"require": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
}
],
)
Expand Down Expand Up @@ -4600,10 +4600,10 @@ async def test_method_update_with_all_params_overload_9(self, async_client: Asyn
policies=[
{
"decision": "allow",
"include": [{"email": {"email": "test@example.com"}}],
"include": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
"name": "Allow devs",
"exclude": [{"email": {"email": "test@example.com"}}],
"require": [{"email": {"email": "test@example.com"}}],
"exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
"require": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
}
],
)
Expand Down
Loading