-
Notifications
You must be signed in to change notification settings - Fork 9
feat: allow read-only operations with wallet addr #284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
SgtPooki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds view-only authentication mode to allow read-only operations (checking balances and status) without requiring signing capabilities. The implementation introduces a new --view-address CLI option that configures an address-only signer for querying operations.
- Adds
ReadOnlyConfigtype andreadOnlyflag to support authentication using only a wallet address - Introduces
--view-addressCLI option with environment variable support - Tightens authentication validation to ensure the four modes (standard, session-key, read-only, signer) remain mutually exclusive
- Updates test mocks and adds read-only mode test coverage
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/cli-options.ts | Adds --view-address CLI option with documentation |
| src/utils/cli-auth.ts | Implements parsing logic to convert viewAddress to walletAddress + readOnly config |
| src/core/synapse/index.ts | Adds ReadOnlyConfig type, type guard, validation, and initialization logic using AddressOnlySigner |
| src/index-types.ts | Exports new ReadOnlyConfig type for public API |
| src/test/unit/synapse-service.test.ts | Adds test coverage for read-only mode initialization |
| src/test/unit/import.test.ts | Updates mock error message to include view-address option |
| src/test/unit/data-set.test.ts | Updates mock error message to include view-address option |
| src/test/unit/add.test.ts | Updates mock error message to include view-address option |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add view-only auth path (--view-address / walletAddress + readOnly) that wires to AddressOnlySigner so balances/status can be inspected without signing.
Tighten auth parsing/validation to keep modes mutually exclusive and update messaging to mention view-only mode.
Refresh tests/mocks for the new option.