diff --git a/testsuite/objects/sections.py b/testsuite/objects/sections.py index d8b3878a..473bfd40 100644 --- a/testsuite/objects/sections.py +++ b/testsuite/objects/sections.py @@ -38,6 +38,10 @@ class Identities(abc.ABC): def oidc(self, name, endpoint, credentials, selector, **common_features): """Adds OIDC identity provider""" + @abc.abstractmethod + def kubernetes(self, name: str, *audiences): + """Adds Kubernetes identity""" + @abc.abstractmethod def api_key(self, name, all_namespaces, match_label, match_expression, credentials, selector, **common_features): """Adds API Key identity""" diff --git a/testsuite/openshift/objects/auth_config/sections.py b/testsuite/openshift/objects/auth_config/sections.py index 26537e06..cab6a4af 100644 --- a/testsuite/openshift/objects/auth_config/sections.py +++ b/testsuite/openshift/objects/auth_config/sections.py @@ -64,6 +64,15 @@ def mtls(self, name: str, selector_key: str, selector_value: str, **common_featu """ self.add_item(name, {"mtls": {"selector": {"matchLabels": {selector_key: selector_value}}}}, **common_features) + @modify + def kubernetes(self, name: str, *audiences): + """Adds Kubernetes identity + Args: + :param name: name of the identity + :param audiences: token audiences + """ + self.add_item(name, {"kubernetes": {"audiences": [*audiences]}}) + @modify def oidc(self, name, endpoint, credentials="authorization_header", selector="Bearer", **common_features): """Adds OIDC identity"""