Skip to content

Resolve Dr.Egeria credentials at run time with one precedence chain (ISSUE-161) - #477

Merged
dwolfson merged 2 commits into
odpi:mainfrom
dwolfson:fix/issue-161-dr-egeria-credentials
Oct 22, 2026
Merged

dwolfson merged 2 commits into
odpi:mainfrom
dwolfson:fix/issue-161-dr-egeria-credentials

Conversation

@dwolfson

Copy link
Copy Markdown
Member

Fixes ISSUE-161 (PYEGERIA_ISSUES.md; the entry is added in this PR): Dr.Egeria's entry points resolved the Egeria user differently, and two CLIs fixed their user defaults at import time.

Problem

  • dr_egeria and dr_egeria_folder computed their --userid / --user_pass defaults when the module was imported. A caller that set EGERIA_USER after importing pyegeria in the same process still got the earlier user.
  • md_processing/dr_egeria.py (its constants and its python -m entry point) and common_md_utils.py read EGERIA_USER straight from the environment, bypassing config.json and .env. So the entry points disagreed whenever the user was set only in config.

Change

  • New pyegeria.core.config.resolve_egeria_credentials(user_id=None, user_pwd=None). Precedence, read when called: explicit value > EGERIA_USER / EGERIA_USER_PASSWORD environment variables > the User Profile in pyegeria's settings (config.json / .env) > the quickstart defaults.
  • Both CLIs default --userid / --user_pass to None and resolve when the command runs. The help text says so.
  • md_processing/dr_egeria.py and common_md_utils.py use the same helper. The module-level EGERIA_USER / EGERIA_USER_PASSWORD names are kept for code that imports them.

Note: the report that prompted this (RE's Dr.Egeria runs writing as erinoverview) turned out to be RE's own configuration. These are the pyegeria inconsistencies found while checking it.

Testing

  • tests/micro-tests/test_issue_161_dr_egeria_credentials.py: 5 cases.
    • Precedence order.
    • EGERIA_USER set after import, for dr_egeria and dr_egeria_folder.
    • A user set only in config.
    • An explicit --userid wins.
      The three behaviour cases fail with the previous callers and pass with this change.
  • The full micro-test suite (1,425 tests) passes in a clean python:3.13-slim container with no Egeria.

🤖 Generated with Claude Code

dwolfson and others added 2 commits October 21, 2026 16:45
…r differently

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
…ain (ISSUE-161)

The dr_egeria and dr_egeria_folder CLIs fixed their --userid/--user_pass
defaults when the module was imported, and md_processing/dr_egeria.py
and common_md_utils.py read EGERIA_USER straight from the environment,
bypassing config.json/.env. So the entry points could disagree, and a
user set after import was ignored.

New pyegeria.core.config.resolve_egeria_credentials(): explicit value >
EGERIA_USER/EGERIA_USER_PASSWORD env (read at call time) > settings User
Profile (config.json/.env) > quickstart defaults. Both CLIs default the
options to None and resolve when they run; the md_processing constants
and __main__ path use the same helper. Module-level names are kept.

Micro-tests: tests/micro-tests/test_issue_161_dr_egeria_credentials.py
(the three behaviour cases fail with the old callers). Full micro-test
suite passes in a clean python:3.13-slim container.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
@dwolfson
dwolfson merged commit 6a88566 into odpi:main Oct 22, 2026
5 checks passed
dwolfson added a commit that referenced this pull request Oct 22, 2026
Ships #477 (ISSUE-161: Dr.Egeria entry points resolve the Egeria user
at run time with one precedence chain, via resolve_egeria_credentials)
and #478 (Dr.Egeria Postgres Server/Database Element commands take
secrets-store attributes; Database User Id / Database Password removed).

Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant