-
Notifications
You must be signed in to change notification settings - Fork 2
fix(skill): address ClawHub security audit findings (#49) #53
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
Merged
IamCoder18
merged 4 commits into
main
from
IamCoder18/address-clawhub-security-audit-findings
Aug 25, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
c7f91ed
fix(skill): address ClawHub security audit findings (#49)
IamCoder18 774e625
fix(skill): address CodeRabbit review feedback
IamCoder18 b411cdb
fix(skill): address second-round review feedback
IamCoder18 ee04f52
fix(skill): address third-round review feedback on migration recipe
IamCoder18 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| --- | ||
| title: Direct SDK and HTTP access (advanced) | ||
| description: When huly-cli doesn't have a flag for what you need — `huly api` and `huly ws` for raw, unvalidated passthroughs against your self-hosted Huly workspace. Advanced use only. | ||
| --- | ||
|
|
||
| # Direct SDK and HTTP access (advanced) | ||
|
|
||
| > **Advanced only.** Two commands bypass every CLI safety check — ref resolution, type checking, cascade awareness, error mapping, and (for destructive calls) confirmation prompts: | ||
| > | ||
| > - **`huly api`** — raw HTTP passthrough. | ||
| > - **`huly ws`** — raw WebSocket RPC. | ||
| > | ||
| > Treat them like raw SQL. Most workflows do not need them. If you find yourself reaching for them often for a pattern the CLI should expose, file an issue — that's a missing-feature signal. | ||
|
|
||
| When a CLI command doesn't exist for what you need, or the flag you need isn't exposed, talk to the server directly. Both commands are pass-through — they don't filter or transform the response. | ||
|
|
||
| ## Table of contents | ||
|
|
||
| - [HTTP (`huly api`)](#http-huly-api) | ||
| - [WebSocket (`huly ws`)](#websocket-huly-ws) | ||
| - [When to use direct SDK access](#when-to-use-direct-sdk-access) | ||
|
|
||
| --- | ||
|
|
||
| ## HTTP (`huly api`) | ||
|
|
||
| ```bash | ||
| huly api GET /api/v1/version | ||
| huly api GET /config.json | ||
| huly api POST /api/v1/something --body '{"key":"value"}' | ||
| huly api GET /api/v1/things --query foo=bar --query baz=qux | ||
| huly api GET /api/v1/things --header "Authorization: Bearer ..." | ||
| ``` | ||
|
|
||
| Available methods: `GET | POST | PUT | PATCH | DELETE`. The path | ||
| is appended to the workspace's API URL. The CLI does not validate the path, method, body, or any custom headers — anything you send goes straight to the server. | ||
|
|
||
| > **`Authorization` is not overridable.** The CLI always sets `Authorization: Bearer <resolved-token>` after merging your custom headers (`packages/cli/src/raw/api.ts:43-49`), so passing `--header "Authorization: Bearer …"` has no effect. All other custom headers pass through verbatim. | ||
|
|
||
| --- | ||
|
|
||
| ## WebSocket (`huly ws`) | ||
|
|
||
| The Huly RPC protocol uses WebSocket for the SDK connection, but the | ||
| raw `huly ws` command is **text JSON only**. Use it for direct | ||
| method calls without opening the SDK's binary transport: | ||
|
|
||
| ```bash | ||
| # findAll | ||
| huly ws findAll '[{"_class":"tracker:class:Project"},{}]' | ||
|
|
||
| # tx (raw transaction) | ||
| huly ws tx '[{"_class":"core:class:TxCreateDoc",...}]' | ||
| ``` | ||
|
|
||
| > `huly ws` accepts a single positional `<method>` followed by an | ||
| > optional `[params]` argument that is a **JSON-encoded array of | ||
| > positional parameters** for that method. On Huly 0.7.x the raw | ||
| > socket dispatches a small whitelist: `findAll`, `tx`, `hello`, and | ||
| > `ping`. Do not rely on `findOne`, `createDoc`, `updateDoc`, or other | ||
| > SDK methods through this command — use the high-level commands | ||
| > for writes, or `tx` for raw transaction payloads. | ||
| > | ||
| > The `tx` RPC supports every transaction type — `TxCreateDoc`, | ||
| > `TxUpdateDoc`, `TxRemoveDoc`, `TxMixin`, `TxApplyIf`. Build the | ||
| > payload directly; the CLI doesn't validate. **Confirm with the user before invoking** — raw RPC has no CLI confirmation prompt and bypasses every safety check. | ||
|
|
||
| --- | ||
|
|
||
| ## When to use direct SDK access | ||
|
|
||
| - A command exists but doesn't expose the flag you need (rare). Use the high-level command with `--set key=value` first; reach for `huly ws` / `huly api` only when the field is not exposed at all. | ||
| - A command exists but operates on a wrong sub-resource. | ||
| - You're debugging and need to see the raw server response. | ||
| - The CLI doesn't support the surface you need (use the SDK | ||
| instead — see | ||
| [Migration — from the SDK](../guides/migration.md#from-the-huly-sdk-typescript)). | ||
|
|
||
| The commands pass through directly; the CLI handles auth and | ||
| caching, not transformation. If you find yourself reaching for | ||
| `huly ws` often, that's a signal the CLI should expose that surface | ||
| natively — file an issue. | ||
|
|
||
| **Do not use raw RPC to bypass `--yes`, validation, or duplicate-identifier checks.** Those refusals are intentional. | ||
This file was deleted.
Oops, something went wrong.
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.