From e55a16d0f92a9f3ef10562a4c871f6b5bb6eb348 Mon Sep 17 00:00:00 2001 From: natalia Date: Wed, 14 Feb 2024 13:35:19 +0100 Subject: [PATCH 1/2] feat: support user email and name custom headers --- lib/charms/oathkeeper/v0/auth_proxy.py | 4 ++-- templates/oathkeeper.yaml.j2 | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/charms/oathkeeper/v0/auth_proxy.py b/lib/charms/oathkeeper/v0/auth_proxy.py index da6ff0ee..368ee60d 100644 --- a/lib/charms/oathkeeper/v0/auth_proxy.py +++ b/lib/charms/oathkeeper/v0/auth_proxy.py @@ -78,14 +78,14 @@ def _configure_auth_proxy(self): # Increment this PATCH version before using `charmcraft publish-lib` or reset # to 0 if you are raising the major API version -LIBPATCH = 4 +LIBPATCH = 5 RELATION_NAME = "auth-proxy" INTERFACE_NAME = "auth_proxy" logger = logging.getLogger(__name__) -ALLOWED_HEADERS = ["X-User"] +ALLOWED_HEADERS = ["X-User", "X-Email", "X-Name"] url_regex = re.compile( r"(^http://)|(^https://)" # http:// or https:// diff --git a/templates/oathkeeper.yaml.j2 b/templates/oathkeeper.yaml.j2 index db270e2c..efeee920 100644 --- a/templates/oathkeeper.yaml.j2 +++ b/templates/oathkeeper.yaml.j2 @@ -75,3 +75,5 @@ mutators: config: headers: X-User: {% raw %}"{{ print .Subject }}"{% endraw %} + X-Email: {% raw %}"{{ print .Extra.identity.traits.email }}"{% endraw %} + X-Name: {% raw %}"{{ print .Extra.identity.traits.name }}"{% endraw %} From c724a817dbb9e9053b6fcc226cb976fcac0463be Mon Sep 17 00:00:00 2001 From: natalia Date: Wed, 14 Feb 2024 17:32:27 +0100 Subject: [PATCH 2/2] chore: pin python-libjuju --- integration-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-requirements.txt b/integration-requirements.txt index 596b00b3..761e9808 100644 --- a/integration-requirements.txt +++ b/integration-requirements.txt @@ -1,5 +1,5 @@ protobuf~=3.20.1 pytest -juju +juju==3.3.0.0 pytest-operator==0.31.1 -r requirements.txt