Skip to content

Commit 2e14a95

Browse files
add the concept of a namespace for the config injector.
1 parent 2523bf1 commit 2e14a95

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/planet_auth_config_injection/builtins_provider.py

+10
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ class BuiltinConfigurationProviderInterface(ABC):
5151
Built-in trust environments are expected to be all uppercase.
5252
"""
5353

54+
def namespace(self) -> str:
55+
"""
56+
Application namespace. This will be used as a prefix in various contexts
57+
so that multiple applications may use the Planet auth libraries in the same
58+
environment without collisions. Presently, this includes being
59+
used as a prefix for environment variables, and as a prefix for config
60+
settings store to the user's `~/.planet.json` file.
61+
"""
62+
return ""
63+
5464
@abstractmethod
5565
def builtin_client_authclient_config_dicts(self) -> Dict[str, dict]:
5666
"""

src/planet_auth_utils/builtins.py

+5
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ def _load_builtin_jit():
9292
Builtins._builtin = _load_builtins()
9393
auth_logger.debug(msg=f"Successfully loaded built-in provider: {Builtins._builtin.__class__.__name__}")
9494

95+
@staticmethod
96+
def namespace() -> str:
97+
Builtins._load_builtin_jit()
98+
return Builtins._builtin.namespace()
99+
95100
@staticmethod
96101
def is_builtin_profile(profile: str) -> bool:
97102
Builtins._load_builtin_jit()

0 commit comments

Comments
 (0)