Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Url filtering v1 model #638

Merged
merged 2 commits into from
May 7, 2024
Merged

Url filtering v1 model #638

merged 2 commits into from
May 7, 2024

Conversation

radkrawczyk
Copy link
Collaborator

Pull Request summary:

Introducing URL filtering v1 model

Checklist:

  • Make sure to run pre-commit before committing changes
  • Make sure all checks have passed
  • PR description is clear and comprehensive
  • Mentioned the issue that this PR solves (if applicable)
  • Make sure you test the changes

@radkrawczyk radkrawczyk changed the base branch from main to dev-uxmt May 7, 2024 12:07
alerts: Set[UrlFilteringAlerts] = Field(default=[], validation_alias="alerts", serialization_alias="alerts")
target_vpns: List[VpnId] = Field(default=[], validation_alias="targetVpns", serialization_alias="targetVpns")

@field_validator("url_black_list", "url_white_list", mode="before")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am not sure, if it's the best solution.
in some cases the url_black_list / white_list is not None, but empty dict, which cannot be deserialised do the Reference object.

The validator checks if value is an empty dict and the returns None,.

Everything works as expected. Tested a few cases

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks good to me 👍

@radkrawczyk radkrawczyk requested a review from jpkrajewski May 7, 2024 12:11
@radkrawczyk radkrawczyk merged commit ef493b7 into dev-uxmt May 7, 2024
10 checks passed
@radkrawczyk radkrawczyk deleted the url_filtering_v1_model branch May 7, 2024 12:44
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.

2 participants