Skip to content

Commit

Permalink
Add method for Kubernetes identity
Browse files Browse the repository at this point in the history
  • Loading branch information
jsmolar committed May 23, 2023
1 parent f92f367 commit 76d4199
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions testsuite/objects/sections.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down
9 changes: 9 additions & 0 deletions testsuite/openshift/objects/auth_config/sections.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down

0 comments on commit 76d4199

Please sign in to comment.