Coverage for ocp_resources/oauth.py: 0%

20 statements  

« prev     ^ index     » next       coverage.py v7.6.10, created at 2025-01-30 10:48 +0200

1# Generated using https://github.com/RedHatQE/openshift-python-wrapper/blob/main/scripts/resource/README.md 

2 

3from typing import Any, Dict, List, Optional 

4from ocp_resources.resource import Resource 

5 

6 

7class OAuth(Resource): 

8 """ 

9 OAuth holds cluster-wide information about OAuth. The canonical name is `cluster`. It is used to configure the integrated OAuth server. This configuration is only honored when the top level Authentication config has type set to IntegratedOAuth. 

10 Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). 

11 """ 

12 

13 api_group: str = Resource.ApiGroup.CONFIG_OPENSHIFT_IO 

14 

15 def __init__( 

16 self, 

17 identity_providers: Optional[List[Any]] = None, 

18 templates: Optional[Dict[str, Any]] = None, 

19 token_config: Optional[Dict[str, Any]] = None, 

20 **kwargs: Any, 

21 ) -> None: 

22 """ 

23 Args: 

24 identity_providers (List[Any]): identityProviders is an ordered list of ways for a user to identify 

25 themselves. When this list is empty, no identities are provisioned 

26 for users. 

27 

28 templates (Dict[str, Any]): templates allow you to customize pages like the login page. 

29 

30 token_config (Dict[str, Any]): tokenConfig contains options for authorization and access tokens 

31 

32 """ 

33 super().__init__(**kwargs) 

34 

35 self.identity_providers = identity_providers 

36 self.templates = templates 

37 self.token_config = token_config 

38 

39 def to_dict(self) -> None: 

40 super().to_dict() 

41 

42 if not self.kind_dict and not self.yaml_file: 

43 self.res["spec"] = {} 

44 _spec = self.res["spec"] 

45 

46 if self.identity_providers: 

47 _spec["identityProviders"] = self.identity_providers 

48 

49 if self.templates: 

50 _spec["templates"] = self.templates 

51 

52 if self.token_config: 

53 _spec["tokenConfig"] = self.token_config 

54 

55 # End of generated code