diff --git a/README.md b/README.md index 0d02a9c71..333e6df1f 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,9 @@ For more details on setting up your configuration and available variables, see [ # EGERIA_USER_PASSWORD=mypassword # EGERIA_WIDTH=280 +Your password: where pyegeria looks for it, how to set it, and the change coming in 6.4 (the CLIs' demo-password +fallback goes) are in [docs/setting-your-egeria-password.md](docs/setting-your-egeria-password.md). + Lines starting with # are comments. Quotes are optional; python-dotenv/pydantic-settings handle both. ### Example config.json (minimal) diff --git a/commands/cat/dr_egeria_jupyter.py b/commands/cat/dr_egeria_jupyter.py index bd6951e3d..9ef9aa8b1 100644 --- a/commands/cat/dr_egeria_jupyter.py +++ b/commands/cat/dr_egeria_jupyter.py @@ -28,8 +28,8 @@ EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) -EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_WIDTH = os.environ.get("EGERIA_WIDTH", 220) diff --git a/commands/cat/exp_list_glossaries.py b/commands/cat/exp_list_glossaries.py index 93443bcdb..4a250ed69 100755 --- a/commands/cat/exp_list_glossaries.py +++ b/commands/cat/exp_list_glossaries.py @@ -39,8 +39,8 @@ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) EGERIA_INTEGRATION_DAEMON = os.environ.get("EGERIA_INTEGRATION_DAEMON", "integration-daemon") -EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) diff --git a/commands/cat/get_collection_tree.py b/commands/cat/get_collection_tree.py index 5ad875342..ae64379b9 100755 --- a/commands/cat/get_collection_tree.py +++ b/commands/cat/get_collection_tree.py @@ -32,8 +32,8 @@ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) EGERIA_INTEGRATION_DAEMON = os.environ.get("EGERIA_INTEGRATION_DAEMON", "integration-daemon") -EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) diff --git a/commands/cat/get_project_dependencies.py b/commands/cat/get_project_dependencies.py index 45e892b7a..440ee0a52 100755 --- a/commands/cat/get_project_dependencies.py +++ b/commands/cat/get_project_dependencies.py @@ -35,8 +35,8 @@ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) EGERIA_INTEGRATION_DAEMON = os.environ.get("EGERIA_INTEGRATION_DAEMON", "integration-daemon") -EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) diff --git a/commands/cat/get_project_structure.py b/commands/cat/get_project_structure.py index a31506d2d..63de2f1b3 100755 --- a/commands/cat/get_project_structure.py +++ b/commands/cat/get_project_structure.py @@ -33,8 +33,8 @@ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) EGERIA_INTEGRATION_DAEMON = os.environ.get("EGERIA_INTEGRATION_DAEMON", "integration-daemon") -EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) diff --git a/commands/cat/list_assets.py b/commands/cat/list_assets.py index 1b804e960..c1cb36cb2 100755 --- a/commands/cat/list_assets.py +++ b/commands/cat/list_assets.py @@ -32,8 +32,8 @@ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) EGERIA_INTEGRATION_DAEMON = os.environ.get("EGERIA_INTEGRATION_DAEMON", "integration-daemon") -EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) diff --git a/commands/cat/list_glossaries.py b/commands/cat/list_glossaries.py index 71e148c8a..bb484d6a3 100755 --- a/commands/cat/list_glossaries.py +++ b/commands/cat/list_glossaries.py @@ -37,8 +37,8 @@ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) EGERIA_INTEGRATION_DAEMON = os.environ.get("EGERIA_INTEGRATION_DAEMON", "integration-daemon") -EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) diff --git a/commands/cat/list_projects.py b/commands/cat/list_projects.py index 5266678f4..33d38f080 100755 --- a/commands/cat/list_projects.py +++ b/commands/cat/list_projects.py @@ -39,8 +39,8 @@ EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) -EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) diff --git a/commands/cat/list_user_actions.py b/commands/cat/list_user_actions.py index 2b5bd07ba..2893190eb 100755 --- a/commands/cat/list_user_actions.py +++ b/commands/cat/list_user_actions.py @@ -37,8 +37,8 @@ EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) -EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) diff --git a/commands/cat/list_user_ids.py b/commands/cat/list_user_ids.py index 12e6d2eba..15837f588 100644 --- a/commands/cat/list_user_ids.py +++ b/commands/cat/list_user_ids.py @@ -29,8 +29,8 @@ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) EGERIA_INTEGRATION_DAEMON = os.environ.get("EGERIA_INTEGRATION_DAEMON", "integration-daemon") -EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) diff --git a/commands/deprecated/list_data_designer.py b/commands/deprecated/list_data_designer.py index fcf0ae680..f0febfd8e 100755 --- a/commands/deprecated/list_data_designer.py +++ b/commands/deprecated/list_data_designer.py @@ -42,8 +42,8 @@ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) EGERIA_INTEGRATION_DAEMON = os.environ.get("EGERIA_INTEGRATION_DAEMON", "integration-daemon") -EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) diff --git a/commands/deprecated/list_data_structures_full.py b/commands/deprecated/list_data_structures_full.py index a915f06d5..e47c389fe 100755 --- a/commands/deprecated/list_data_structures_full.py +++ b/commands/deprecated/list_data_structures_full.py @@ -35,8 +35,8 @@ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) EGERIA_INTEGRATION_DAEMON = os.environ.get("EGERIA_INTEGRATION_DAEMON", "integration-daemon") -EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) diff --git a/commands/doc/Visual Command Reference/README.md b/commands/doc/Visual Command Reference/README.md index 93117368e..3c282bc2b 100644 --- a/commands/doc/Visual Command Reference/README.md +++ b/commands/doc/Visual Command Reference/README.md @@ -244,7 +244,7 @@ Input: * userid (required) - default is "erinoverview", one of the fictitious Coco Pharmaceuticals employees. Note: -Set the EGERIA_USER and EGERIA_USER_PASSWORD environment variables for your desired default user. +Set the EGERIA_USER and EGERIA_USER_PASSWORD environment variables for your desired default user (see [Setting your Egeria password](../../../docs/setting-your-egeria-password.md); pyegeria 6.4 removes the demo-password fallback). ![my_profile 2024-12-14 at 16.29.27@2x.png](my/show/my_profile 2024-12-14 at 16.29.27@2x.png) diff --git a/commands/doc/hey_egeria: a pyegeria command line interface/README.md b/commands/doc/hey_egeria: a pyegeria command line interface/README.md index 419ab4dbd..a876da4d6 100644 --- a/commands/doc/hey_egeria: a pyegeria command line interface/README.md +++ b/commands/doc/hey_egeria: a pyegeria command line interface/README.md @@ -262,13 +262,17 @@ as many of our samples, labs and demos. These defaults can be easily changed; bo the values of the corresponding environment variables or in the TUI by over-riding defaults using the optional parameters. Here is a list of the variables and their defaults: +> **Coming in pyegeria 6.4:** if `EGERIA_USER_PASSWORD` isn't set, the CLIs stop falling back to the QuickStart +> demo password, and a command fails with "No password to sign in to Egeria…". Set your password now: see +> [Setting your Egeria password](../../../docs/setting-your-egeria-password.md). + | Environment Variable | Default | Command Option | Description | |-------------------------------|------------------------|--------------------------|------------------------------------------------------------| | EGERIA_JUPYTER | True | --jupyter | Set to True for better display in Jupyter notebooks | | EGERIA_USER | erinoverview | --userid | A typical Egeria user | -| EGERIA_USER_PASSWORD | secret | --password | User password | -| EGERIA_ADMIN_USE | garygeeke | --admin_user | A user that configures and operates Egeria platform | -| EGERIA_ADMIN_PASSWORD | secret | --admin_user_password | Admin password | +| EGERIA_USER_PASSWORD | demo password, until 6.4 | --password | User password. Set it: pyegeria 6.4 removes the CLIs' demo-password fallback ([how](../../../docs/setting-your-egeria-password.md)) | +| ADMIN_USER | none (PY-35) | --admin_user | A user that configures and operates Egeria platform | +| ADMIN_PASSWORD | none (PY-35) | --admin_user_password | Admin password; pyegeria has no built-in default | | EGERIA_ENGINE_HOST | engine-host | --engine_host | Egeria Engine host to use for governance actions/processes | | EGERIA_ENGINE_HOST_URL | https://localhost:9443 | --engine_host_url | Platform URL where Engine host is running | | EGERIA_INTEGRATION_DAEMON | integration-daemon | --integration_daemon | Egeria integration daemon to use | @@ -278,7 +282,7 @@ Here is a list of the variables and their defaults: | EGERIA_PLATFORM_URL | https://localhost:9443 | --url | Platform URL where chosen Egeria metadata store is running | | EGERIA_METADATA_STORE | active-metadata-store | --server | Egeria metadata store to use | | EGERIA_WIDTH | 200 | --width | Width of the terminal screen to use for displaying results | -| EGERIA_TIMEOUT | 60 | --timeout | Timeout for Egeria actions | +| PYEGERIA_TIMEOUT_SECONDS | 30 | --timeout | Timeout for Egeria actions, in seconds | Egeria workspaces changes some of these defaults for the Docker environment it sets up. A kubernetes deployment may similarly alter the defaults to accommodate deployment. Note that this is a very simplistic use of user identity and password. This can be augmented by using the diff --git a/commands/my/get_my_profile.py b/commands/my/get_my_profile.py index 95a48cff6..f816d8882 100755 --- a/commands/my/get_my_profile.py +++ b/commands/my/get_my_profile.py @@ -32,8 +32,8 @@ EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) -EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) diff --git a/commands/my/list_my_roles.py b/commands/my/list_my_roles.py index 40600319f..9e4a79aac 100755 --- a/commands/my/list_my_roles.py +++ b/commands/my/list_my_roles.py @@ -33,8 +33,8 @@ EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) -EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) diff --git a/commands/my/monitor_my_actions.py b/commands/my/monitor_my_actions.py index c7791a7ce..75178197b 100755 --- a/commands/my/monitor_my_actions.py +++ b/commands/my/monitor_my_actions.py @@ -33,8 +33,8 @@ EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) -EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) diff --git a/commands/my/todo_actions.py b/commands/my/todo_actions.py index 55222ec35..f11e2ba6b 100644 --- a/commands/my/todo_actions.py +++ b/commands/my/todo_actions.py @@ -41,8 +41,8 @@ EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) -EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") diff --git a/commands/ops/monitor_engine_status.py b/commands/ops/monitor_engine_status.py index 7704eab2d..fb4c11e87 100755 --- a/commands/ops/monitor_engine_status.py +++ b/commands/ops/monitor_engine_status.py @@ -47,7 +47,7 @@ "EGERIA_ENGINE_HOST_URL", "https://localhost:9443" ) EGERIA_ADMIN_USER = os.environ.get("EGERIA_ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("EGERIA_ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_PASSWORD = os.environ.get("EGERIA_ADMIN_PASSWORD") # PY-35: no built-in admin password EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) diff --git a/commands/ops/monitor_server_status.py b/commands/ops/monitor_server_status.py index 331678eed..5af80276f 100755 --- a/commands/ops/monitor_server_status.py +++ b/commands/ops/monitor_server_status.py @@ -40,8 +40,8 @@ EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) -EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) diff --git a/commands/tech/element_actions.py b/commands/tech/element_actions.py index 556cbe179..bc1168e53 100644 --- a/commands/tech/element_actions.py +++ b/commands/tech/element_actions.py @@ -31,8 +31,8 @@ EGERIA_INTEGRATION_DAEMON_URL = os.environ.get( "EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443" ) -EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_WIDTH = os.environ.get("EGERIA_WIDTH", 200) diff --git a/commands/tech/list_related_specification.py b/commands/tech/list_related_specification.py index 3b0f0bb80..98aa2d54d 100644 --- a/commands/tech/list_related_specification.py +++ b/commands/tech/list_related_specification.py @@ -33,8 +33,8 @@ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) EGERIA_INTEGRATION_DAEMON = os.environ.get("EGERIA_INTEGRATION_DAEMON", "integration-daemon") -EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) diff --git a/commands/tech/table_tech_templates.py b/commands/tech/table_tech_templates.py index 916b517ef..edbc55a43 100644 --- a/commands/tech/table_tech_templates.py +++ b/commands/tech/table_tech_templates.py @@ -36,8 +36,8 @@ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) EGERIA_INTEGRATION_DAEMON = os.environ.get("EGERIA_INTEGRATION_DAEMON", "integration-daemon") -EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) diff --git a/commands/tech/x_list_related_elements.py b/commands/tech/x_list_related_elements.py index 3b14c62b6..22461a2b9 100644 --- a/commands/tech/x_list_related_elements.py +++ b/commands/tech/x_list_related_elements.py @@ -33,8 +33,8 @@ "EGERIA_VIEW_SERVER_URL", "https://localhost:9443" ) EGERIA_INTEGRATION_DAEMON = os.environ.get("EGERIA_INTEGRATION_DAEMON", "integration-daemon") -EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER") +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD") EGERIA_USER = os.environ.get("EGERIA_USER", "erinoverview") EGERIA_USER_PASSWORD = os.environ.get("EGERIA_USER_PASSWORD", "secret") EGERIA_JUPYTER = bool(os.environ.get("EGERIA_JUPYTER", "False")) diff --git a/docs/dr_egeria_manual.md b/docs/dr_egeria_manual.md index aa319929f..95c7720e2 100644 --- a/docs/dr_egeria_manual.md +++ b/docs/dr_egeria_manual.md @@ -636,7 +636,7 @@ process_md_file( server=env.egeria_view_server, url=env.egeria_view_server_url, userid=os.environ.get("EGERIA_USER", "erinoverview"), - user_pass=os.environ.get("EGERIA_USER_PASSWORD", "secret"), + user_pass=os.environ["EGERIA_USER_PASSWORD"], ) ``` @@ -657,7 +657,7 @@ process_md_file( server=env.egeria_view_server, url=env.egeria_view_server_url, userid=os.environ.get("EGERIA_USER", "erinoverview"), - user_pass=os.environ.get("EGERIA_USER_PASSWORD", "secret"), + user_pass=os.environ["EGERIA_USER_PASSWORD"], summary_only=True, ) ``` @@ -705,7 +705,7 @@ env = settings.Environment client = EgeriaTech(env.egeria_view_server, env.egeria_view_server_url, user_id=os.environ.get("EGERIA_USER", "erinoverview")) client.create_egeria_bearer_token(os.environ.get("EGERIA_USER", "erinoverview"), - os.environ.get("EGERIA_USER_PASSWORD", "secret")) + os.environ["EGERIA_USER_PASSWORD"]) files = ["glossary.md", "projects.md", "data_structures.md"] @@ -734,7 +734,7 @@ env = settings.Environment client = EgeriaTech(env.egeria_view_server, env.egeria_view_server_url, user_id=os.environ.get("EGERIA_USER", "erinoverview")) client.create_egeria_bearer_token(os.environ.get("EGERIA_USER", "erinoverview"), - os.environ.get("EGERIA_USER_PASSWORD", "secret")) + os.environ["EGERIA_USER_PASSWORD"]) # In a Jupyter cell, the event loop is already running — use await directly await process_md_file_v2( diff --git a/docs/release-notes/next.md b/docs/release-notes/next.md index e433cb904..7e856c911 100644 --- a/docs/release-notes/next.md +++ b/docs/release-notes/next.md @@ -60,10 +60,24 @@ notes and are not repeated here. - **No default password, and no built-in identity outside a named demo profile.** pyegeria 6.4 or the next release drops the quickstart defaults (`erinoverview` / `secret`): a client gets credentials only from its arguments, the environment, config.json, or a demo profile named explicitly. + - **The command-line tools lose their demo-password fallback.** Until 6.4, `hey_egeria` and the other CLIs read the + password only from `--password` / `--user_pass` and the `EGERIA_USER_PASSWORD` environment variable, and fall back + to the QuickStart demo password otherwise. They don't read `config.json` or `.env` for it, so a password set only + there isn't used. From 6.4 they read it the same way as the library, and a command with no password set fails with + "No password to sign in to Egeria…". **Set the `EGERIA_USER_PASSWORD` environment variable now**: see + [Setting your Egeria password](../setting-your-egeria-password.md). ## Changed +- **No built-in password or admin credential in the library, from this release** (PY-33, PY-35; 6.3.0 still had the + demo-password fallback). `resolve_egeria_credentials` no longer + falls back to a built-in password, and the library's `ADMIN_USER` / `ADMIN_PASSWORD` reads and its settings model + have no literal defaults either. With no password set, `create_egeria_bearer_token` raises + `PyegeriaInvalidParameterException` ("No password to sign in to Egeria as '' …") before any request is sent. + **A behaviour change:** before, the request went to Egeria and came back as a 401, so code that catches that 401 for + a missing password should catch the new exception. The CLIs keep their demo-password fallback until 6.4 (above). + See [Setting your Egeria password](../setting-your-egeria-password.md). - `md_processing/md_processing_utils/properties_class_fields.py` is now regenerated from Egeria c61bad65. - `ProjectProperties` gains `scope`; 25 SchemaType-family classes drop `queries`, matching #9448's `SchemaTypeProperties` change. diff --git a/docs/setting-your-egeria-password.md b/docs/setting-your-egeria-password.md new file mode 100644 index 000000000..ec0031ddd --- /dev/null +++ b/docs/setting-your-egeria-password.md @@ -0,0 +1,128 @@ +# Setting your Egeria password + +pyegeria signs in to Egeria as a user, with that user's password. This page explains where pyegeria looks for the +password, how to set it, and **the changes in the next releases**. + +## What's changing + +| | pyegeria 6.3.0 | The next pyegeria release | pyegeria 6.4 | +|---|---|---|---| +| The pyegeria **library** (your own code, notebooks, Dr.Egeria from Python) | Falls back to the QuickStart demo password if none is set. | **No built-in password.** If none is set, signing in fails with the message below. | The same. | +| The **command-line tools** (`hey_egeria` and the other CLIs) | Fall back to the demo password if `EGERIA_USER_PASSWORD` isn't set. | The same. | **No fallback.** They read the password the same way as the library (below), and fail with the message below if none is set. | + +If you use the CLIs today without setting `EGERIA_USER_PASSWORD`, they work only because of that demo-password +fallback. **Set `EGERIA_USER_PASSWORD` now** (see "How to set it"), and nothing changes for you in 6.4. + +When no password is set, you'll see this (in the library from the next release, and in the CLIs from 6.4): + +``` +No password to sign in to Egeria as 'erinoverview': pass one, set EGERIA_USER_PASSWORD (or the settings' +user_pwd), or set a bearer token with set_bearer_token(). pyegeria has no default password. +``` + +The sign-in stops before anything is sent to Egeria. Earlier versions sent the request and got a 401 back. Code +that catches that 401 should catch `PyegeriaInvalidParameterException` instead. + +## Where pyegeria looks for the password + +The library and the CLIs don't look in the same places until 6.4. + +**The library** (your own code, notebooks, Dr.Egeria from Python) uses the first of these that is set: + +1. **A value you pass explicitly**: `user_pwd=` when you create a client. +2. **The `EGERIA_USER_PASSWORD` environment variable.** +3. **`config.json`**: the `"user_pwd"` entry under `"User Profile"`. +4. **A `.env` file**: an `EGERIA_USER_PASSWORD=` line in a `.env` in the directory you run from (or the file you + name with `PyegeriaSettings.with_env_file`). + +**The command-line tools, until 6.4**, use only: + +1. `--password` (most CLIs) or `--user_pass` (the Dr.Egeria CLIs) on the command line; +2. the `EGERIA_USER_PASSWORD` environment variable; +3. otherwise, the QuickStart demo password. + +They don't read `config.json` or `.env` for the password. A password you set only there is **not used** by the +CLIs before 6.4: they still sign in with the demo password. From 6.4 the CLIs use the library's list. + +An `EGERIA_USER_PASSWORD` that is set but **empty** counts as set. pyegeria then doesn't look further, in +`config.json` or `.env`, and sign-in is refused. Unset the variable rather than leaving it empty. + +The user works the same way, with `--userid`, `EGERIA_USER`, `"user_name"` and `EGERIA_USER=`. + +## How to set it + +**The one that works everywhere, now and in 6.4: the `EGERIA_USER_PASSWORD` environment variable.** + +For one shell session: + +```bash +export EGERIA_USER=erinoverview +export EGERIA_USER_PASSWORD='your-password' +hey_egeria cat show glossary glossaries +``` + +To have it in every shell, put those two `export` lines in your shell's startup file (for example `~/.zshrc` or +`~/.bashrc`), which only you should be able to read. + +**For the library only** (your code and notebooks; the CLIs read these from 6.4): + +- In a `.env` file in the directory you run from: + + ```bash + # .env + EGERIA_USER=erinoverview + EGERIA_USER_PASSWORD=your-password + ``` + + Keep it private: `chmod 600 .env`, and add `.env` to your `.gitignore` so it's never committed. + +- In `config.json`, if you already keep your pyegeria settings there, **but only if that `config.json` is + git-ignored and readable only by you** (`chmod 600 config.json`). Never commit it: a `config.json` that is in a + repository is shared with everyone who can read the repository. If yours is tracked, use `.env` or the + environment variable instead. + + ```json + { + "User Profile": { + "user_name": "erinoverview", + "user_pwd": "your-password" + } + } + ``` + +- In your own code: + + ```python + import os + from pyegeria import EgeriaTech + + client = EgeriaTech("qs-view-server", "https://localhost:9443", + user_id="erinoverview", user_pwd=os.environ["EGERIA_USER_PASSWORD"]) + client.create_egeria_bearer_token() + ``` + + `os.environ["EGERIA_USER_PASSWORD"]` stops at once, with a `KeyError`, if the password isn't set. Don't write + `os.environ.get("EGERIA_USER_PASSWORD", "secret")`, which quietly signs in with a guessed password. + +**For a single CLI command**, `--password` also works (the options go before the sub-command): + +```bash +hey_egeria --userid erinoverview --password 'your-password' cat show glossary glossaries +``` + +A password typed on the command line can end up in your shell history, so prefer the environment variable for +anything you repeat. + +## Which password? + +On the Egeria QuickStart, every demo user (for example `erinoverview` or `peterprofile`) shares the QuickStart's +standard demo password, which is in the QuickStart's own documentation. On any other Egeria, use the password your +administrator gave you. + +## Servers and services are different + +`EGERIA_USER` and `EGERIA_USER_PASSWORD` are for running pyegeria **as yourself**, in a shell or a notebook. +A server that uses pyegeria (a web app, an agent, a scheduler) should sign in as **its own service account**, +under its own setting names, and should never set `EGERIA_USER` / `EGERIA_USER_PASSWORD`. Trellis uses +`RE_DAEMON_USER_ID` and `EA_DAEMON_USER_ID`, for example. Otherwise pyegeria's fallback could sign the server in +as a person. diff --git a/docs/user_programming.md b/docs/user_programming.md index 665671930..55c3896a2 100644 --- a/docs/user_programming.md +++ b/docs/user_programming.md @@ -40,7 +40,7 @@ Once loaded, the configuration is cached for the lifetime of the process — sub | `EGERIA_PLATFORM_URL` | The base URL of your Egeria platform. | | `EGERIA_VIEW_SERVER` | The name of the View Server to use. | | `EGERIA_USER` | The default user ID for authentication. | -| `EGERIA_USER_PASSWORD` | The password for the default user. | +| `EGERIA_USER_PASSWORD` | The password for the default user. No built-in default: see [Setting your Egeria password](setting-your-egeria-password.md). | | `EGERIA_LOCAL_QUALIFIER` | A prefix used when generating `qualifiedNames`. | | `PYEGERIA_ROOT_PATH` | Directory where `config.json` and `.env` are located. | | `PYEGERIA_CONFIG_FILE` | Override the config filename (default: `config.json`). | diff --git a/md_processing/dr_egeria.py b/md_processing/dr_egeria.py index 0c7370f2d..6dec87537 100644 --- a/md_processing/dr_egeria.py +++ b/md_processing/dr_egeria.py @@ -95,8 +95,8 @@ EGERIA_OUTBOX_PATH = app_config.dr_egeria_outbox # User credentials and admin credentials are only from environment variables (not stored in config for security) -EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER") # PY-35: no built-in admin user +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD") # PY-35: no built-in admin password # Same precedence as the dr_egeria CLI: env, then config.json / .env, then defaults (ISSUE-161). EGERIA_USER, EGERIA_USER_PASSWORD = resolve_egeria_credentials() diff --git a/md_processing/md_processing_utils/common_md_utils.py b/md_processing/md_processing_utils/common_md_utils.py index 966c12fe6..fdb2dcca4 100644 --- a/md_processing/md_processing_utils/common_md_utils.py +++ b/md_processing/md_processing_utils/common_md_utils.py @@ -27,8 +27,8 @@ EGERIA_VIEW_SERVER_URL = os.environ.get("EGERIA_VIEW_SERVER_URL", "https://localhost:9443") EGERIA_INTEGRATION_DAEMON = os.environ.get("EGERIA_INTEGRATION_DAEMON", "integration-daemon") EGERIA_INTEGRATION_DAEMON_URL = os.environ.get("EGERIA_INTEGRATION_DAEMON_URL", "https://localhost:9443") -EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER", "garygeeke") -EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD", "secret") +EGERIA_ADMIN_USER = os.environ.get("ADMIN_USER") # PY-35: no built-in admin user +EGERIA_ADMIN_PASSWORD = os.environ.get("ADMIN_PASSWORD") # PY-35: no built-in admin password # Same precedence as the dr_egeria CLI: env, then config.json / .env, then defaults (ISSUE-161). EGERIA_USER, EGERIA_USER_PASSWORD = resolve_egeria_credentials() EGERIA_WIDTH = settings.Environment.egeria_width diff --git a/md_processing/v2/extraction.py b/md_processing/v2/extraction.py index dd92588b7..55433a96d 100644 --- a/md_processing/v2/extraction.py +++ b/md_processing/v2/extraction.py @@ -154,6 +154,70 @@ def extract_commands(self) -> List[DrECommand]: )) return commands + def diagnose(self, command_attributes: Optional[Dict[str, List[str]]] = None) -> List[str]: + """Explain, in words, heading mistakes that make a document run less than its author meant (PY-30). + + A Dr.Egeria command is an H2 heading ``## `` with its attributes as H3 ``###