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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
- `telemetryrouter`:
- [v0.6.0](services/telemetryrouter/CHANGELOG.md#v060)
- **Feature:** Add `disabled` field to `ConfigFilter` to allow disabling a filter without removing it
- `vpn`:
- [v0.7.2](services/vpn/CHANGELOG.md#v072)
- **Breaking Change:** `predefined_network_prefix` attribute in `NetworkConfig` model class changed type from `Optional[List[str]]` to `Optional[str]` to match actual API behavior
- **Improvement:** Relax minimum ASN validation to `1` (previously `64512`) for `as_path_contains_any` and `first_asn` in `BGPFilterRuleMatch` and `remote_asn` in `BGPTunnelConfig`

## Release (2026-09-14)

Expand Down
4 changes: 4 additions & 0 deletions services/vpn/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v0.7.2
- **Breaking Change:** `predefined_network_prefix` attribute in `NetworkConfig` model class changed type from `Optional[List[str]]` to `Optional[str]` to match actual API behavior
- **Improvement:** Relax minimum ASN validation to `1` (previously `64512`) for `as_path_contains_any` and `first_asn` in `BGPFilterRuleMatch` and `remote_asn` in `BGPTunnelConfig`

## v0.7.1
- **Fix:** Corrected an invalid `pyproject.toml` build configuration (`wheel-sources` instead of `wheel.sources`) that caused `import stackit.vpn` to fail with `ModuleNotFoundError`

Expand Down
2 changes: 1 addition & 1 deletion services/vpn/oas_commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b7d1b614138d667d378a5fd45e2a91539a7fb02e
7e7c0c6d141ef436fa9dee1e9724936562b7d6da
2 changes: 1 addition & 1 deletion services/vpn/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "stackit-vpn"
version = "v0.7.1"
version = "v0.7.2"
description = "STACKIT VPN API"
authors = [{name = "STACKIT Developer Tools", email = "developer-tools@stackit.cloud"}]
requires-python = ">=3.10,<4.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class BGPFilterRuleMatch(BaseModel):
""" # noqa: E501

as_path_contains_any: Optional[
Annotated[List[Annotated[int, Field(le=4294967294, strict=True, ge=64512)]], Field(max_length=10)]
Annotated[List[Annotated[int, Field(le=4294967294, strict=True, ge=1)]], Field(max_length=10)]
] = Field(
default=None,
description="Matches if the AS-PATH contains any one of the listed ASNs (logical OR within the list). Treated as an unordered set; ordering is not preserved by the storage layer. When combined with firstASN, both conditions must hold (logical AND, consistent with the rest of the match block). If firstASN is also listed here, its presence as the first hop is sufficient to satisfy this list; no duplicate hop is required. ",
Expand All @@ -39,7 +39,7 @@ class BGPFilterRuleMatch(BaseModel):
default=None,
description="Matches if the route carries any one of these BGP standard communities (logical OR within the list). Format is 'asn:value' per RFC 1997 (both halves must fit in a uint32, i.e. 0..4294967295). Extended, large and well-known communities are not supported. ",
)
first_asn: Optional[Annotated[int, Field(le=4294967294, strict=True, ge=64512)]] = Field(
first_asn: Optional[Annotated[int, Field(le=4294967294, strict=True, ge=1)]] = Field(
default=None,
description="Matches if the first ASN (immediate neighbor) in the AS-PATH equals this ASN. Combines with asPathContainsAny using logical AND: when both are set, the first ASN must equal firstASN AND the path must additionally contain at least one ASN from asPathContainsAny. ",
alias="firstASN",
Expand Down
4 changes: 2 additions & 2 deletions services/vpn/src/stackit/vpn/models/bgp_tunnel_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ class BGPTunnelConfig(BaseModel):
description="UUID of the BGPFilter to apply to incoming routes from this tunnel's BGP neighbor. The filter must exist in the same gateway. Multiple tunnels may reference the same BGPFilter; in that case the rules' 'match.peer' field can be used to scope behavior per neighbor. Outbound filtering is not yet supported; use gateway.bgp.overrideAdvertisedRoutes to control what is advertised. ",
alias="inboundFilterId",
)
remote_asn: Annotated[int, Field(le=4294967294, strict=True, ge=64512)] = Field(
description="ASN for private use (reserved by IANA), both 16Bit and 32Bit ranges are valid (RFC 6996). ",
remote_asn: Annotated[int, Field(le=4294967294, strict=True, ge=1)] = Field(
description='Number of an Autonomous System. Both 16Bit and 32Bit ranges are supported, excluding values reserved by: * RFC 7607 (0) * RFC 6793 (23456, AS_TRANS) * RFC 7300 (65535 and 4294967295, the "Last ASNs") ',
alias="remoteAsn",
)
__properties: ClassVar[List[str]] = ["inboundFilterId", "remoteAsn"]
Expand Down
20 changes: 18 additions & 2 deletions services/vpn/src/stackit/vpn/models/network_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@

import json
import pprint
import re # noqa: F401
from typing import Any, ClassVar, Dict, List, Optional, Set
from uuid import UUID

from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, field_validator
from pydantic_core import to_jsonable_python
from typing_extensions import Annotated, Self

Expand All @@ -28,7 +29,7 @@ class NetworkConfig(BaseModel):
NetworkConfig
""" # noqa: E501

predefined_network_prefix: Optional[List[Annotated[str, Field(strict=True)]]] = Field(
predefined_network_prefix: Optional[Annotated[str, Field(strict=True)]] = Field(
default=None,
description="The IPv4 network prefix (CIDR notation) allocated for the VPN gateway. Must have a prefix length of /28 or larger. Once the gateway is created, is not possible to change this attribute. ",
alias="predefinedNetworkPrefix",
Expand All @@ -38,6 +39,21 @@ class NetworkConfig(BaseModel):
)
__properties: ClassVar[List[str]] = ["predefinedNetworkPrefix", "routingTableId"]

@field_validator("predefined_network_prefix")
def predefined_network_prefix_validate_regular_expression(cls, value):
"""Validates the regular expression"""
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}(\/([0-9]|[1-2][0-9]|3[0-2]))?$", value):
raise ValueError(
r"must validate the regular expression /^((25[0-5]|(2[0-4]|1\d|[1-9]|)\d)\.?\b){4}(\/([0-9]|[1-2][0-9]|3[0-2]))?$/"
)
return value

model_config = ConfigDict(
validate_by_name=True,
validate_by_alias=True,
Expand Down
2 changes: 1 addition & 1 deletion services/vpn/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading