Skip to content

Commit

Permalink
Add add_host and remove_host methods to Authorization
Browse files Browse the repository at this point in the history
  • Loading branch information
pehala committed Aug 2, 2022
1 parent 6e0eeeb commit 1f9e82d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
12 changes: 12 additions & 0 deletions testsuite/objects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ class Authorization(LifecycleObject):
def add_oidc_identity(self, name, endpoint):
"""Adds OIDC identity provider"""

@abc.abstractmethod
def add_host(self, hostname):
"""Adds host"""

@abc.abstractmethod
def remove_host(self, hostname):
"""Remove host"""

@abc.abstractmethod
def remove_all_hosts(self):
"""Remove host"""


class PreexistingAuthorino(Authorino):
"""Authorino which is already deployed prior to the testrun"""
Expand Down
9 changes: 9 additions & 0 deletions testsuite/openshift/objects/auth_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ def commit(self):
self.create(["--save-config=true"])
return self.refresh()

def add_host(self, hostname):
self.model.spec.hosts.append(hostname)

def remove_host(self, hostname):
self.model.spec.hosts.remove(hostname)

def remove_all_hosts(self):
self.model.spec.hosts = []

def add_oidc_identity(self, name, endpoint):
"""Adds OIDC identity"""
identities = self.model.spec.setdefault("identity", [])
Expand Down

0 comments on commit 1f9e82d

Please sign in to comment.