bashboy 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bashboy-0.2.0 → bashboy-0.2.1}/PKG-INFO +10 -1
- {bashboy-0.2.0 → bashboy-0.2.1}/README.md +9 -0
- {bashboy-0.2.0 → bashboy-0.2.1}/pyproject.toml +1 -1
- {bashboy-0.2.0 → bashboy-0.2.1}/src/bashboy/__init__.py +1 -1
- {bashboy-0.2.0 → bashboy-0.2.1}/src/bashboy/cli.py +2 -2
- {bashboy-0.2.0 → bashboy-0.2.1}/src/bashboy/provider.py +5 -0
- {bashboy-0.2.0 → bashboy-0.2.1}/tests/test_cli.py +2 -2
- {bashboy-0.2.0 → bashboy-0.2.1}/tests/test_provider.py +2 -0
- {bashboy-0.2.0 → bashboy-0.2.1}/uv.lock +1 -1
- {bashboy-0.2.0 → bashboy-0.2.1}/.github/workflows/release.yml +0 -0
- {bashboy-0.2.0 → bashboy-0.2.1}/.gitignore +0 -0
- {bashboy-0.2.0 → bashboy-0.2.1}/LICENSE +0 -0
- {bashboy-0.2.0 → bashboy-0.2.1}/src/bashboy/__main__.py +0 -0
- {bashboy-0.2.0 → bashboy-0.2.1}/src/bashboy/classify.py +0 -0
- {bashboy-0.2.0 → bashboy-0.2.1}/src/bashboy/config.py +0 -0
- {bashboy-0.2.0 → bashboy-0.2.1}/src/bashboy/credentials.py +0 -0
- {bashboy-0.2.0 → bashboy-0.2.1}/src/bashboy/hooks/__init__.py +0 -0
- {bashboy-0.2.0 → bashboy-0.2.1}/src/bashboy/hooks/claude.py +0 -0
- {bashboy-0.2.0 → bashboy-0.2.1}/src/bashboy/installers/__init__.py +0 -0
- {bashboy-0.2.0 → bashboy-0.2.1}/src/bashboy/installers/claude.py +0 -0
- {bashboy-0.2.0 → bashboy-0.2.1}/src/bashboy/installers/opencode.py +0 -0
- {bashboy-0.2.0 → bashboy-0.2.1}/src/bashboy/rules.py +0 -0
- {bashboy-0.2.0 → bashboy-0.2.1}/tests/conftest.py +0 -0
- {bashboy-0.2.0 → bashboy-0.2.1}/tests/test_classify.py +0 -0
- {bashboy-0.2.0 → bashboy-0.2.1}/tests/test_claude_hook.py +0 -0
- {bashboy-0.2.0 → bashboy-0.2.1}/tests/test_config.py +0 -0
- {bashboy-0.2.0 → bashboy-0.2.1}/tests/test_credentials.py +0 -0
- {bashboy-0.2.0 → bashboy-0.2.1}/tests/test_installers.py +0 -0
- {bashboy-0.2.0 → bashboy-0.2.1}/tests/test_rules.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: bashboy
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Classify shell commands as allow or deny before an agent runs them.
|
|
5
5
|
Project-URL: Homepage, https://github.com/Mann10/bashboy
|
|
6
6
|
Project-URL: Issues, https://github.com/Mann10/bashboy/issues
|
|
@@ -97,6 +97,15 @@ bashboy auth clear # delete after confirmation
|
|
|
97
97
|
echo "$CLOCKED_API_KEY" | bashboy auth set --stdin --force
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
+
On Windows, `getpass` reads raw keystrokes with echo off, and pasting into that
|
|
101
|
+
prompt is unreliable — Ctrl+V can land nothing or drop characters. If the
|
|
102
|
+
prompt seems to ignore your paste, put the key on the clipboard and pipe it
|
|
103
|
+
instead (it never touches shell history):
|
|
104
|
+
|
|
105
|
+
```powershell
|
|
106
|
+
Get-Clipboard | bashboy auth set --stdin --force
|
|
107
|
+
```
|
|
108
|
+
|
|
100
109
|
`auth set` writes the file atomically, creates `~/.bashboy` with mode `0700` on
|
|
101
110
|
POSIX, and sets the file itself to `0600`. The token is never accepted as a
|
|
102
111
|
command-line argument — it would land in shell history and process listings — and
|
|
@@ -80,6 +80,15 @@ bashboy auth clear # delete after confirmation
|
|
|
80
80
|
echo "$CLOCKED_API_KEY" | bashboy auth set --stdin --force
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
+
On Windows, `getpass` reads raw keystrokes with echo off, and pasting into that
|
|
84
|
+
prompt is unreliable — Ctrl+V can land nothing or drop characters. If the
|
|
85
|
+
prompt seems to ignore your paste, put the key on the clipboard and pipe it
|
|
86
|
+
instead (it never touches shell history):
|
|
87
|
+
|
|
88
|
+
```powershell
|
|
89
|
+
Get-Clipboard | bashboy auth set --stdin --force
|
|
90
|
+
```
|
|
91
|
+
|
|
83
92
|
`auth set` writes the file atomically, creates `~/.bashboy` with mode `0700` on
|
|
84
93
|
POSIX, and sets the file itself to `0600`. The token is never accepted as a
|
|
85
94
|
command-line argument — it would land in shell history and process listings — and
|
|
@@ -143,9 +143,9 @@ def _cmd_auth_set(args: argparse.Namespace) -> int:
|
|
|
143
143
|
if args.stdin:
|
|
144
144
|
token = sys.stdin.read().strip()
|
|
145
145
|
else:
|
|
146
|
-
token = _getpass("Clocked API key: ").strip()
|
|
146
|
+
token = _getpass("Clocked API key (input hidden): ").strip()
|
|
147
147
|
if token:
|
|
148
|
-
confirm = _getpass("Repeat to confirm: ").strip()
|
|
148
|
+
confirm = _getpass("Repeat to confirm (input hidden): ").strip()
|
|
149
149
|
if confirm != token:
|
|
150
150
|
print("bashboy: tokens did not match", file=sys.stderr)
|
|
151
151
|
return 2
|
|
@@ -22,6 +22,7 @@ from collections import deque
|
|
|
22
22
|
from dataclasses import dataclass
|
|
23
23
|
from typing import Any, Callable
|
|
24
24
|
|
|
25
|
+
from . import __version__
|
|
25
26
|
from .config import ProviderConfig
|
|
26
27
|
|
|
27
28
|
Transport = Callable[[str, bytes, dict[str, str], float], tuple[int, bytes]]
|
|
@@ -178,6 +179,10 @@ class Provider:
|
|
|
178
179
|
"Authorization": f"Bearer {key}",
|
|
179
180
|
"Content-Type": "application/json",
|
|
180
181
|
"Idempotency-Key": str(uuid.uuid4()),
|
|
182
|
+
# The endpoint sits behind Cloudflare, which answers 403 (error 1010)
|
|
183
|
+
# to urllib's default `Python-urllib/3.x` signature. Any honest
|
|
184
|
+
# product UA gets through; omitting this breaks every request.
|
|
185
|
+
"User-Agent": f"bashboy/{__version__}",
|
|
181
186
|
}
|
|
182
187
|
timeout = max(int(self.cfg.timeout_ms), 0) / 1000.0
|
|
183
188
|
|
|
@@ -9,7 +9,7 @@ from pathlib import Path
|
|
|
9
9
|
import pytest
|
|
10
10
|
|
|
11
11
|
import bashboy.provider as provider_module
|
|
12
|
-
from bashboy import cli, credentials
|
|
12
|
+
from bashboy import __version__, cli, credentials
|
|
13
13
|
from bashboy.config import DEFAULT_CONFIG_TOML
|
|
14
14
|
from bashboy.provider import ProviderError
|
|
15
15
|
|
|
@@ -105,7 +105,7 @@ def test_version(capsys: pytest.CaptureFixture[str]) -> None:
|
|
|
105
105
|
code = run(["version"])
|
|
106
106
|
out = capsys.readouterr().out
|
|
107
107
|
assert code == 0
|
|
108
|
-
assert "bashboy
|
|
108
|
+
assert f"bashboy {__version__}" in out
|
|
109
109
|
|
|
110
110
|
|
|
111
111
|
def test_selftest_without_key(capsys: pytest.CaptureFixture[str]) -> None:
|
|
@@ -81,6 +81,8 @@ def test_request_headers_and_timeout() -> None:
|
|
|
81
81
|
assert headers["Authorization"] == "Bearer k"
|
|
82
82
|
assert headers["Content-Type"] == "application/json"
|
|
83
83
|
assert uuid.UUID(headers["Idempotency-Key"]).version == 4
|
|
84
|
+
# Cloudflare bans urllib's default signature with a 403 (error 1010).
|
|
85
|
+
assert headers["User-Agent"].startswith("bashboy/")
|
|
84
86
|
assert timeout == 4.0
|
|
85
87
|
decoded = json.loads(raw_body.decode("utf-8"))
|
|
86
88
|
assert decoded["text"] == "cwd: /tmp\ncommand: git push"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|