@@ -50,13 +50,13 @@ def builtin_client_authclient_config_dicts(self) -> Dict[str, dict]:
50
50
`planet_auth.AuthClientConfig.config_from_dict`
51
51
"""
52
52
53
- @abstractmethod
54
53
def builtin_client_profile_aliases (self ) -> Dict [str , str ]:
55
54
"""
56
55
Return a dictionary profile aliases. Aliases allow
57
56
for a single built-in configuration to be referred to
58
57
by multiple names.
59
58
"""
59
+ return {}
60
60
61
61
@abstractmethod
62
62
def builtin_default_profile_by_client_type (self ) -> Dict [str , str ]:
@@ -70,18 +70,30 @@ def builtin_default_profile(self) -> str:
70
70
Return the built-in default fallback auth profile name of last resort.
71
71
"""
72
72
73
- @abstractmethod
74
73
def builtin_trust_environment_names (self ) -> List [str ]:
75
74
"""
76
75
Return a list of the names of built-in trust environments.
77
76
"""
77
+ _realms = self .builtin_trust_environments ()
78
+ if _realms :
79
+ return list (_realms .keys ())
80
+ return []
78
81
79
- @abstractmethod
80
82
def builtin_trust_environments (self ) -> Dict [str , Optional [List [dict ]]]:
81
83
"""
82
84
Return a dictionary of the trust environment configurations.
83
85
Each item in the lists should be valid AuthClient config dictionary.
86
+
87
+ This is primarily used for cases where planet_auth is used to validate
88
+ tokens on the service side. This is the flip side of most of the other
89
+ BuiltinConfigurationProviderInterface methods which are geared towards
90
+ helping clients obtain tokens.
84
91
"""
92
+ return {
93
+ # "PRODUCTION": [MY_REALM_PRODUCTION],
94
+ # "STAGING": [MY_REALM_STAGING],
95
+ "CUSTOM" : None ,
96
+ }
85
97
86
98
87
99
class EmptyBuiltinProfileConstants (BuiltinConfigurationProviderInterface ):
@@ -95,29 +107,15 @@ class EmptyBuiltinProfileConstants(BuiltinConfigurationProviderInterface):
95
107
BUILTIN_PROFILE_NAME_NONE : NONE_AUTH_CLIENT_CONFIG ,
96
108
}
97
109
98
- _builtin_profile_aliases : Dict [str , str ] = {}
99
-
100
110
_builtin_profile_default_by_client_type = {
101
111
"none" : BUILTIN_PROFILE_NAME_NONE ,
102
112
}
103
- _builtin_trust_realms : Dict [str , Optional [List [dict ]]] = {
104
- "CUSTOM" : None ,
105
- }
106
113
107
114
def builtin_client_authclient_config_dicts (self ) -> Dict [str , dict ]:
108
115
return EmptyBuiltinProfileConstants ._builtin_profile_auth_client_configs
109
116
110
- def builtin_client_profile_aliases (self ) -> Dict [str , str ]:
111
- return EmptyBuiltinProfileConstants ._builtin_profile_aliases
112
-
113
117
def builtin_default_profile_by_client_type (self ) -> Dict [str , str ]:
114
118
return EmptyBuiltinProfileConstants ._builtin_profile_default_by_client_type
115
119
116
120
def builtin_default_profile (self ) -> str :
117
121
return EmptyBuiltinProfileConstants .BUILTIN_PROFILE_NAME_NONE
118
-
119
- def builtin_trust_environment_names (self ) -> List [str ]:
120
- return list (EmptyBuiltinProfileConstants ._builtin_trust_realms .keys ())
121
-
122
- def builtin_trust_environments (self ) -> Dict [str , Optional [List [dict ]]]:
123
- return EmptyBuiltinProfileConstants ._builtin_trust_realms
0 commit comments