Skip to content

Harden Config Parsing / Validation - #268

Open
benthecarman wants to merge 4 commits into
lightningdevkit:mainfrom
benthecarman:codex/loupe-client-config
Open

Harden Config Parsing / Validation#268
benthecarman wants to merge 4 commits into
lightningdevkit:mainfrom
benthecarman:codex/loupe-client-config

Conversation

@benthecarman

Copy link
Copy Markdown
Collaborator

Various issues by project loupe where we could silently fallback to a default config or file location in an unexpected way. Better to force the user to be explicit upfront to prevent potential issues.

@ldk-reviews-bot

ldk-reviews-bot commented Sep 1, 2026

Copy link
Copy Markdown

👋 Thanks for assigning @joostjager as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@benthecarman
benthecarman force-pushed the codex/loupe-client-config branch from a56ef0c to 36cc238 Compare September 1, 2026 02:45
@benthecarman
benthecarman requested review from joostjager and removed request for wpaulino September 1, 2026 16:35
joostjager
joostjager previously approved these changes Sep 2, 2026

@joostjager joostjager left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sensible changes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When storage_dir(config) is Some, a failed read no longer falls back to the default data directory. Please update the function documentation and the CLI/MCP error messages accordingly. Currently, a missing key in configured storage tells the user to populate the default path, but doing so cannot resolve the error because that path is never checked.

Stop API key resolution when a loaded configuration names an
unsupported network. This prevents a malformed config from selecting the
Bitcoin key.

This commit was created with assistance from Codex.
Stop API key lookup after an explicit storage directory is selected. A
missing instance key must not fall back to another node's credentials.

This commit was created with assistance from Codex.
Return an error when the operator selects a config path that is missing
or is not a file. This prevents silent fallback to the default node.

This commit was created with assistance from Codex.
Return an error when an explicit MCP config path is missing or is not a
file. This prevents the bridge from selecting the default node instead.

This commit was created with assistance from Codex.
@benthecarman
benthecarman force-pushed the codex/loupe-client-config branch from 9d03f24 to 72341f0 Compare September 4, 2026 02:45

@joostjager joostjager left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems something went wrong in the rebase? https://github.com/lightningdevkit/ldk-server/pull/268/changes#r3912262959 was addressed, but then reverted again in the second push.

Also it would be helpful for review to get a link with the diff that addresses the comments, excluding the rebase. I am not sure what happened.

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.

3 participants