From 17acc9457d00427c2d793901ea4ec0b5268a9fd1 Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Wed, 26 Jun 2024 22:07:25 +0900 Subject: [PATCH] website/docs: update geoip and asn example to use the proper syntax (cherry-pick #10249) (#10250) website/docs: update geoip and asn example to use the proper syntax (#10249) Co-authored-by: Marc 'risson' Schmitt --- website/docs/policies/expression.mdx | 4 ++-- website/docs/releases/2024/v2024.6.md | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/website/docs/policies/expression.mdx b/website/docs/policies/expression.mdx index 68aa595fe450..66932de0583a 100644 --- a/website/docs/policies/expression.mdx +++ b/website/docs/policies/expression.mdx @@ -56,13 +56,13 @@ import Objects from "../expressions/_objects.md"; - `geoip`: GeoIP object, see [GeoIP](https://geoip2.readthedocs.io/en/latest/#geoip2.models.City) ```python - return context["geoip"].country.iso_code == "US" + return context["geoip"]["country"]["iso_code"] == "US" ``` - `asn`: ASN object, see [GeoIP](https://geoip2.readthedocs.io/en/latest/#geoip2.models.ASN) ```python - return context["asn"].autonomous_system_number == 64496 + return context["asn"]["autonomous_system_number"] == 64496 ``` - `ak_is_sso_flow`: Boolean which is true if request was initiated by authenticating through an external provider. diff --git a/website/docs/releases/2024/v2024.6.md b/website/docs/releases/2024/v2024.6.md index 2e854ccca2c7..06585f1574ac 100644 --- a/website/docs/releases/2024/v2024.6.md +++ b/website/docs/releases/2024/v2024.6.md @@ -23,6 +23,12 @@ The provided Compose file was updated with PostgreSQL 16. You can follow the pro With this release, authentik now enforces unique group names. Existing groups with name collisions that were created in earlier versions can still exist, but any new groups you create will need a unique name. If changing attributes, permission-level, or parent on an existing group with a name collision, you need to also change its name to be unique. Note that changing members or roles associated with the group does not require a rename. +### GeoIP and ASN context object + +The `context["geoip"]` and `context["asn"]` objects available in expression policies are now dictionaries. Attributes must now be accessed via dictionary accessors. See [our policy examples](../../policies/expression.mdx) for the updated syntax. + +For instance, `context["geoip"].country.iso_code` must now become `context["geoip"]["country"]["iso_code"]`. + ## New features - **Google Workspace Provider** Enterprise Preview