website/docs: add expression example for geoip (#7739)

* Update expression.mdx

Added example for GeoIP 

Signed-off-by: Rukk385 <39340512+Rukk385@users.noreply.github.com>

* Update website/docs/policies/expression.mdx

Co-authored-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
Signed-off-by: Rukk385 <39340512+Rukk385@users.noreply.github.com>

---------

Signed-off-by: Rukk385 <39340512+Rukk385@users.noreply.github.com>
Co-authored-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
Rukk385 2023-12-20 15:33:58 +01:00 committed by GitHub
parent 6628088e3b
commit 256187ebc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -54,6 +54,11 @@ import Objects from "../expressions/_objects.md";
- `request.context`: A dictionary with dynamic data. This depends on the origin of the execution. - `request.context`: A dictionary with dynamic data. This depends on the origin of the execution.
- `geoip`: GeoIP object, see [GeoIP](https://geoip2.readthedocs.io/en/latest/#geoip2.models.City) - `geoip`: GeoIP object, see [GeoIP](https://geoip2.readthedocs.io/en/latest/#geoip2.models.City)
```python
return context["geoip"].country.iso_code == "US"
```
- `ak_is_sso_flow`: Boolean which is true if request was initiated by authenticating through an external provider. - `ak_is_sso_flow`: Boolean which is true if request was initiated by authenticating through an external provider.
- `ak_client_ip`: Client's IP Address or 255.255.255.255 if no IP Address could be extracted. Can be [compared](#comparing-ip-addresses), for example - `ak_client_ip`: Client's IP Address or 255.255.255.255 if no IP Address could be extracted. Can be [compared](#comparing-ip-addresses), for example