Repository navigation
[HorizonDB] Validate pool firewall rules and add cluster authentication commands #10611
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
Merged
Yeming Liu (isra-fel)
merged 7 commits into
Azure:main
from
rmendiza:feature-horizondb-firewall
Nov 23, 2026
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f2b25dc
[HorizonDB] Validate pool firewall rule ranges and correct help
rmendiza 6d31549
[HorizonDB] Add cluster authentication and password commands
rmendiza 62b85d1
[HorizonDB] Document firewall validation in the next preview release
rmendiza 913f204
[HorizonDB] Add recordable password authentication lifecycle scenario
rmendiza 97baa54
[HorizonDB] Combine authentication and firewall changes and warn abou…
rmendiza b79911a
Merge upstream maintenance release and use HorizonDB 1.0.0b11
rmendiza f08b59e
[HorizonDB] Record password authentication lifecycle against a provis…
rmendiza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,10 +16,10 @@ | |
| is_preview=True, | ||
| ) | ||
| class Create(AAZCommand): | ||
| """Create a HorizonDB pool firewall rule. | ||
| """Create or replace a HorizonDB pool firewall rule. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove replace |
||
|
|
||
| :example: Create or replace a firewall rule on a HorizonDB pool | ||
| az horizondb cluster pool firewall-rule create --resource-group example-resource-group --cluster-name example-cluster --pool-name example-pool-01 --firewall-rule-name example-firewall-rule-01 --start-ip-address 10.0.0.1 --end-ip-address 10.0.0.254 --description Allow access from the corporate network | ||
| az horizondb cluster pool firewall-rule create --resource-group example-resource-group --cluster-name example-cluster --pool-name example-pool-01 --firewall-rule-name example-firewall-rule-01 --start-ip-address 10.0.0.1 --end-ip-address 10.0.0.254 --description "Allow access from the corporate network" | ||
| """ | ||
|
|
||
| _aaz_info = { | ||
|
|
@@ -95,6 +95,7 @@ def _build_arguments_schema(cls, *args, **kwargs): | |
| options=["--end-ip-address"], | ||
| arg_group="Properties", | ||
| help="The end IPv4 address of the firewall rule in dotted-decimal notation. This address must be numerically greater than or equal to startIpAddress.", | ||
| required=True, | ||
| fmt=AAZStrArgFormat( | ||
| pattern="^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])$", | ||
| ), | ||
|
|
@@ -103,6 +104,7 @@ def _build_arguments_schema(cls, *args, **kwargs): | |
| options=["--start-ip-address"], | ||
| arg_group="Properties", | ||
| help="The start IPv4 address of the firewall rule in dotted-decimal notation.", | ||
| required=True, | ||
| fmt=AAZStrArgFormat( | ||
| pattern="^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])$", | ||
| ), | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/horizondb/azext_horizondb/aaz/latest/horizondb/cluster/pool/firewall_rule/custom.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| from ipaddress import AddressValueError, IPv4Address | ||
|
|
||
| from azure.cli.core.azclierror import InvalidArgumentValueError | ||
|
|
||
| from ._create import Create | ||
| from ._update import Update | ||
|
|
||
|
|
||
| def _address(value, option): | ||
| try: | ||
| return IPv4Address(value.to_serialized_data()) | ||
| except AddressValueError as exc: | ||
| raise InvalidArgumentValueError(f'{option} must be a dotted-decimal IPv4 address.') from exc | ||
|
|
||
|
|
||
| def _validate_range(properties): | ||
| start = _address(properties.start_ip_address, '--start-ip-address') | ||
| end = _address(properties.end_ip_address, '--end-ip-address') | ||
| if end < start: | ||
| raise InvalidArgumentValueError('--end-ip-address must be greater than or equal to --start-ip-address.') | ||
|
|
||
|
|
||
| class FirewallRuleCreate(Create): | ||
| def pre_operations(self): | ||
| _validate_range(self.ctx.args) | ||
|
|
||
|
|
||
| class FirewallRuleUpdate(Update): | ||
| def post_instance_update(self, instance): | ||
| # A partial update must be checked against the endpoint retained by the GET. | ||
| _validate_range(instance.properties) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Create is not to be used as replace.