feat: add diagnostics reporter for config and runtime state - #164
Open
Gipzy8 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #149
feat: add diagnostics reporter for config and runtime state
Add a redacted, allowlist-based diagnostics reporter so SDK users can
generate a safe support report covering config validity, RPC
reachability, declared role, signer presence, and compliance failure
classification — without ever risking exposure of private keys,
seeds, or Stellar addresses.
Changes:
report field-by-field from an allowlist; never throws on missing/
invalid/malformed input, reports resolution failure as a status +
ConfigErrorCode instead. RPC URL is reduced to origin+pathname only
(query string/hash, where API keys live, is never read)
reachability via rpcServer.getHealth(), reusing the existing
NetworkFailure/buildNetworkFailureDiagnostic redaction boundary on
failure; reports declared role and signer presence (never the
signer itself)
PortfolioError/RoleError/ConfigValidationError by their closed
codeenum only — never
.message/.cause, which interpolate raw valueselsewhere in the SDK
three sections; distinguishes a plain AegisClient from a role-aware
client (both have a
.roleproperty with different, incompatiblemeanings) to read the declared role safely
appears in serialized output (whole or partial), an unlisted
invented sensitive field never appears (proves the allowlist default
rather than a remembered denylist), RPC URL credentials redacted,
invalid/incomplete config reflected as a status without throwing,
unsupported/unavailable network names distinguished from unset,
compliance failure classification (133 total tests pass)
warning to review a report before sharing it