Skip to content

Commit e8b2d9f

Browse files
Doc updates
1 parent 45d81f2 commit e8b2d9f

File tree

3 files changed

+37
-12
lines changed

3 files changed

+37
-12
lines changed

src/planet_auth_config_injection/__init__.py

+28
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,34 @@
1717
1818
This package provides interfaces and utilities for higher-level applications
1919
to inject configuration into the Planet Authentication Library.
20+
21+
The Planet Auth Library provides configuration injection to improve the
22+
end-user experience of tools built on top of the Planet Auth Library.
23+
This allows built-in default client configurations to be provided.
24+
Namespacing may also be configured to avoid collisions in the Auth Library's
25+
use of environment variables. Injected configration is primarily consumed
26+
by initialization functionality in planet_auth_utils.PlanetAuthFactory
27+
and the various planet_auth_utils provided `click` commands.
28+
29+
These concerns belong more to the final end-user application than to a
30+
library that sits between the Planet Auth library and the end-user
31+
application, that itself may be used by a variety of applications in
32+
a variety of deployment environments
33+
34+
Library writers may provide configuration injection to their developers,
35+
but should be conscious of the fact that multiple libraries within an
36+
application may depend on Planet Auth libraries. Library writers are
37+
advised to provide configuration injection as an option for their users,
38+
and not silently force it into the loaded.
39+
40+
In order to inject configuration, the application writer must do two things:
41+
42+
1. They must write a class that implements the
43+
[planet_auth_config_injection.BuiltinConfigurationProviderInterface][]
44+
interface.
45+
2. They must set the environment variable `PL_AUTH_BUILTIN_CONFIG_PROVIDER` to the
46+
fully qualified package, module, and class name of their implementation
47+
_before_ any import of the `planet_auth` or `planet_auth_utils` packages.
2048
"""
2149

2250
from .builtins_provider import (

src/planet_auth_config_injection/builtins_provider.py

+5-11
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,11 @@
3434

3535
class BuiltinConfigurationProviderInterface(ABC):
3636
"""
37-
Interface to define what profiles are built-in.
38-
39-
What auth configuration profiles are built-in is
40-
completely pluggable for users of the planet_auth and
41-
planet_auth_utils packages. This is to support reuse
42-
in different deployments, or even support reuse by a
43-
different software stack all together.
44-
45-
To inject built-in that override the coded in defaults,
46-
set the environment variable PL_AUTH_BUILTIN_CONFIG_PROVIDER
47-
to the module.classname of a class that implements this interface.
37+
Interface to define built-in application configuration.
38+
This includes providing built-in auth client configuration
39+
profiles, pre-defined trust environments for server use,
40+
and namespacing for environment and global configuration
41+
variables.
4842
4943
Built-in profile names are expected to be all lowercase.
5044

src/planet_auth_utils/commands/cli/main.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ def cmd_plauth_embedded(ctx):
8484
Embeddable version of the Planet Auth Client root command.
8585
The embedded command differs from the stand-alone command in that it
8686
expects the context to be instantiated and options to be handled by
87-
the parent command. See [planet_auth_utils.PlanetAuthFactory.initialize_auth_client_context][]
87+
the parent command. The [planet_auth.Auth][] library context _must_
88+
be set to the object field `AUTH` in the click context object.
89+
90+
See [planet_auth_utils.PlanetAuthFactory.initialize_auth_client_context][]
8891
for user-friendly auth client context initialization.
8992
9093
See [examples](/examples/#embedding-the-click-auth-command).

0 commit comments

Comments
 (0)