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
« 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
3from typing import Any, Dict, List, Optional
4from ocp_resources.resource import Resource
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 """
13 api_group: str = Resource.ApiGroup.CONFIG_OPENSHIFT_IO
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.
28 templates (Dict[str, Any]): templates allow you to customize pages like the login page.
30 token_config (Dict[str, Any]): tokenConfig contains options for authorization and access tokens
32 """
33 super().__init__(**kwargs)
35 self.identity_providers = identity_providers
36 self.templates = templates
37 self.token_config = token_config
39 def to_dict(self) -> None:
40 super().to_dict()
42 if not self.kind_dict and not self.yaml_file:
43 self.res["spec"] = {}
44 _spec = self.res["spec"]
46 if self.identity_providers:
47 _spec["identityProviders"] = self.identity_providers
49 if self.templates:
50 _spec["templates"] = self.templates
52 if self.token_config:
53 _spec["tokenConfig"] = self.token_config
55 # End of generated code