touchop 0.1.0__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.
- touchop-0.1.0/LICENSE +21 -0
- touchop-0.1.0/PKG-INFO +247 -0
- touchop-0.1.0/README.md +197 -0
- touchop-0.1.0/pyproject.toml +47 -0
- touchop-0.1.0/setup.cfg +4 -0
- touchop-0.1.0/tests/test_bridge_integration.py +229 -0
- touchop-0.1.0/tests/test_policy.py +96 -0
- touchop-0.1.0/touchop/__init__.py +3 -0
- touchop-0.1.0/touchop/assets/icon.png +0 -0
- touchop-0.1.0/touchop/cli.py +431 -0
- touchop-0.1.0/touchop/config.py +174 -0
- touchop-0.1.0/touchop/macos_app.py +213 -0
- touchop-0.1.0/touchop/policy.py +207 -0
- touchop-0.1.0/touchop/server.py +326 -0
- touchop-0.1.0/touchop/shim.py +356 -0
- touchop-0.1.0/touchop.egg-info/PKG-INFO +247 -0
- touchop-0.1.0/touchop.egg-info/SOURCES.txt +18 -0
- touchop-0.1.0/touchop.egg-info/dependency_links.txt +1 -0
- touchop-0.1.0/touchop.egg-info/entry_points.txt +3 -0
- touchop-0.1.0/touchop.egg-info/top_level.txt +1 -0
touchop-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Saran Siva
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
touchop-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: touchop
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Touch ID-gated 1Password CLI bridge for remote VMs, containers, AI coding agents, and secondary machines over Tailscale or SSH.
|
|
5
|
+
Author: Saran Siva
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Saran Siva
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/saran-007/touchop
|
|
29
|
+
Project-URL: Repository, https://github.com/saran-007/touchop
|
|
30
|
+
Project-URL: Issues, https://github.com/saran-007/touchop/issues
|
|
31
|
+
Keywords: 1password,touch-id,tailscale,ssh,secrets,ai-agents,fly-sprites,cli
|
|
32
|
+
Classifier: Development Status :: 4 - Beta
|
|
33
|
+
Classifier: Environment :: Console
|
|
34
|
+
Classifier: Intended Audience :: Developers
|
|
35
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
36
|
+
Classifier: Operating System :: MacOS
|
|
37
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
38
|
+
Classifier: Programming Language :: Python :: 3
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
42
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
43
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
44
|
+
Classifier: Topic :: Security
|
|
45
|
+
Classifier: Topic :: Utilities
|
|
46
|
+
Requires-Python: >=3.9
|
|
47
|
+
Description-Content-Type: text/markdown
|
|
48
|
+
License-File: LICENSE
|
|
49
|
+
Dynamic: license-file
|
|
50
|
+
|
|
51
|
+
<p align="center">
|
|
52
|
+
<img src="assets/icon.png" alt="touchop icon" width="112" height="112" />
|
|
53
|
+
</p>
|
|
54
|
+
|
|
55
|
+
<h1 align="center">touchop</h1>
|
|
56
|
+
|
|
57
|
+
<p align="center">
|
|
58
|
+
<strong>Touch ID-gated 1Password CLI (<code>op</code>) bridge for remote VMs, containers, AI coding agents, and secondary machines.</strong>
|
|
59
|
+
</p>
|
|
60
|
+
|
|
61
|
+
<p align="center">
|
|
62
|
+
<a href="https://github.com/saran-007/touchop/releases"><img src="https://img.shields.io/github/v/release/saran-007/touchop?color=3b82f6&label=release" alt="Release" /></a>
|
|
63
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-10b981" alt="MIT License" /></a>
|
|
64
|
+
<img src="https://img.shields.io/badge/python-3.9%2B-6366f1" alt="Python 3.9+" />
|
|
65
|
+
<img src="https://img.shields.io/badge/dependencies-0-0ea5e9" alt="Zero Dependencies" />
|
|
66
|
+
</p>
|
|
67
|
+
|
|
68
|
+
<p align="center">
|
|
69
|
+
<img src="assets/hero.png" alt="touchop remote terminal triggering Mac Touch ID prompt" width="100%" />
|
|
70
|
+
</p>
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Why `touchop`?
|
|
75
|
+
|
|
76
|
+
On a local Mac or Linux desktop, `op read` and `op run` talk to the 1Password Desktop app and prompt for **Touch ID** (or PolKit biometrics). On a remote Linux VM (Fly.io Sprites, EC2, Hetzner, Docker, WSL) or a headless secondary Mac running AI coding agents (Claude Code, Codex, Cursor, OpenClaw), there is no local biometric sensor.
|
|
77
|
+
|
|
78
|
+
Usually you have to put a long-lived 1Password Service Account token on the remote disk. `touchop` gives you another option:
|
|
79
|
+
|
|
80
|
+
- **Your 1Password credentials never touch the remote machine.**
|
|
81
|
+
- The remote machine installs a drop-in `op` shim on `$PATH` that works seamlessly across **any runtime** (Node.js, Python, Go, Rust, Ruby, Bash, Docker, Claude Code, Codex, OpenClaw).
|
|
82
|
+
- When a remote process runs `op read`, `op inject`, or `op run --env-file=.env.tpl -- npm run dev`, `touchop` forwards only the read request over Tailscale (or an SSH reverse tunnel) to your Mac's Aqua GUI LaunchAgent.
|
|
83
|
+
- **1Password Desktop prompts for Touch ID on your Mac** (showing the custom **touchop** icon and app name via a lightweight headless `touchop.app` bundle), and only the requested secret returns to the remote process in memory.
|
|
84
|
+
|
|
85
|
+
> Unofficial community project. Not affiliated with or endorsed by 1Password or Tailscale.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Comparison
|
|
90
|
+
|
|
91
|
+
| Approach | Mac Touch ID Gate | 1Password Creds on Remote Disk | Works for `op read` / `op run` | Works When Laptop Asleep | Best Fit |
|
|
92
|
+
| :--- | :---: | :---: | :---: | :---: | :--- |
|
|
93
|
+
| **`touchop`** | **Yes** | **None** | **Yes** (with log masking) | No (unless fallback SA set) | Personal dev VMs, Fly Sprites, remote AI coding agents |
|
|
94
|
+
| **1Password Service Account** | No | Long-lived token | Yes | Yes | CI/CD, unattended servers, scoped team dev vaults |
|
|
95
|
+
| **1Password Connect Server** | No | Connect token + self-hosted server | Yes | Yes | Production services, Kubernetes, team infra |
|
|
96
|
+
| **1Password SSH Agent (`ForwardAgent`)** | Yes | None | SSH & Git signing only | No | `git push`, commit signing, remote SSH hops |
|
|
97
|
+
| **Plaintext `.env` files** | No | Plaintext secrets on disk | N/A | Yes | Never recommended for real credentials |
|
|
98
|
+
|
|
99
|
+
You can also combine approaches: `touchop` automatically delegates to the native `op` binary whenever `OP_SERVICE_ACCOUNT_TOKEN` or `OP_CONNECT_TOKEN` is set in the environment.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Architecture
|
|
104
|
+
|
|
105
|
+
<p align="center">
|
|
106
|
+
<img src="assets/architecture.png" alt="touchop architecture diagram" width="100%" />
|
|
107
|
+
</p>
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Key Features
|
|
112
|
+
|
|
113
|
+
- **Zero external dependencies**: Pure Python 3.9+ standard library (`brew`, `uv`, `pipx`, `pip`, or single-command `scripts/install.sh`).
|
|
114
|
+
- **Works across runtimes & platforms**: Drop-in `op` shim works anywhere a process calls `op` (Node, Python, Go, Rust, Makefiles, Fly.io Sprites, EC2, Docker containers, WSL, secondary Macs).
|
|
115
|
+
- **Native macOS Touch ID branding**: `init-host` builds a headless `~/Applications/touchop.app` bundle (`LSUIElement=true`) with `AppIcon.icns`, so 1Password's biometric prompt shows **"Allow touchop to get CLI access"** with the `touchop` icon instead of a generic bare executable icon.
|
|
116
|
+
- **`op run` with secret masking**: Resolves `op://` references via your Mac, injects them strictly into child process memory on the remote machine, and redacts secret values from child stdout/stderr (`<concealed by touchop>`) unless `--no-masking` is passed.
|
|
117
|
+
- **Read-only by default**: Hard allowlist of read/query `op` subcommands (`read`, `item get/list`, `vault list/get`, `document get/list`, `inject`, `whoami`, `account list/get`, `--version`). Mutations (`item delete`, `item create`, `item edit`, `vault delete`, `run` on host, etc.) are rejected with `HTTP 403`.
|
|
118
|
+
- **Vault allowlists (`--allow-vault`)**: Restrict remote machines to specific vaults (for example `Engineering-Dev` or `Sandbox-Secrets`) so remote agents can never even request items from `Personal` or `Prod Admin`.
|
|
119
|
+
- **Optional per-request macOS dialog (`--require-confirm`)**: Because 1Password Desktop caches CLI biometric unlocks for ~10 minutes by default, `--require-confirm` adds an explicit native macOS dialog showing the requesting host and exact `op` command before every call.
|
|
120
|
+
- **Multi-host failover**: Pass multiple `--url` values on a client to automatically fail over if your primary Mac is asleep.
|
|
121
|
+
- **Seamless native fallback**: Setting `OP_SERVICE_ACCOUNT_TOKEN`, `OP_CONNECT_TOKEN`, `OP_SESSION_*`, or `TOUCHOP_DISABLE=1` automatically delegates straight to the machine's native `op` binary.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Quickstart
|
|
126
|
+
|
|
127
|
+
### 1. Install `touchop` (on both host and client)
|
|
128
|
+
|
|
129
|
+
**Homebrew (macOS / Linux):**
|
|
130
|
+
```bash
|
|
131
|
+
brew install saran-007/tap/touchop
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**Python (`uv` / `pipx` / `pip`):**
|
|
135
|
+
```bash
|
|
136
|
+
uv tool install git+https://github.com/saran-007/touchop.git
|
|
137
|
+
# or: pip install git+https://github.com/saran-007/touchop.git
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
**Zero-dependency install (no Homebrew, pip, or venv needed):**
|
|
141
|
+
```bash
|
|
142
|
+
git clone https://github.com/saran-007/touchop.git
|
|
143
|
+
cd touchop && ./scripts/install.sh
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### 2. Initialize your biometric host (Mac or Linux Desktop)
|
|
147
|
+
|
|
148
|
+
Make sure **1Password Desktop** has **Settings > Developer > Integrate with 1Password CLI** enabled.
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
touchop init-host \
|
|
152
|
+
--allow-ip 100.64.0.42 \
|
|
153
|
+
--allow-vault "Engineering-Dev" \
|
|
154
|
+
--allow-vault "Sandbox-Secrets" \
|
|
155
|
+
--account acme.1password.com
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
This will:
|
|
159
|
+
- Auto-detect your Tailscale IPv4 address (or fall back to `127.0.0.1` for SSH tunnel mode).
|
|
160
|
+
- Generate a 256-bit bearer token at `~/.config/touchop/token` (`chmod 600`).
|
|
161
|
+
- Write `~/.config/touchop/host.json` (`chmod 600`).
|
|
162
|
+
- Install and start a **macOS Aqua LaunchAgent** (`dev.touchop.bridge`, wrapped in a headless `~/Applications/touchop.app` bundle with `AppIcon.icns` so Touch ID prompts show the **touchop** name and icon) or a **Linux `systemd --user` service** so the bridge runs inside your GUI session and can trigger biometrics.
|
|
163
|
+
|
|
164
|
+
Want an explicit click confirmation on your Mac for every remote secret read? Add `--require-confirm`.
|
|
165
|
+
|
|
166
|
+
### 3. Initialize a remote client (Fly.io Sprite, Linux VM, Docker, or secondary Mac)
|
|
167
|
+
|
|
168
|
+
Copy `~/.config/touchop/token` securely from your host to the remote machine (for example via `scp` or stdin pipe), then run:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
touchop init-client \
|
|
172
|
+
--url http://<HOST_TAILSCALE_IP>:18765 \
|
|
173
|
+
--token-file /path/to/copied/token
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Add more clients anytime from your host:
|
|
177
|
+
```bash
|
|
178
|
+
touchop allow-ip 100.64.0.30
|
|
179
|
+
touchop doctor
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Usage on Remote Machines
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# Read a single secret (triggers Touch ID on your Mac)
|
|
188
|
+
op read "op://Engineering-Dev/Postgres/password"
|
|
189
|
+
|
|
190
|
+
# Run a Node or Python app with secrets injected in memory only (masked in logs)
|
|
191
|
+
op run --env-file=.env.tpl -- npm run dev
|
|
192
|
+
op run --env-file=.env.tpl -- uv run python app.py
|
|
193
|
+
|
|
194
|
+
# Inject secrets into a local config file on the remote machine
|
|
195
|
+
op inject -i config.tpl.yml -o config.yml
|
|
196
|
+
|
|
197
|
+
# Bypass the bridge when using a headless Service Account in CI or unattended runs
|
|
198
|
+
OP_SERVICE_ACCOUNT_TOKEN=ops_... op read "op://Engineering-Dev/Postgres/password"
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Transport Options
|
|
204
|
+
|
|
205
|
+
### Tailscale (Recommended)
|
|
206
|
+
`touchop init-host` automatically binds strictly to your Tailscale IP (`100.x.y.z:18765`). Traffic is WireGuard-encrypted end-to-end by Tailscale, never exposed to LAN or public Wi-Fi. You can additionally pin allowed Tailscale node names via `--allow-node <node-name>` (checked with `tailscale whois`).
|
|
207
|
+
|
|
208
|
+
### SSH Reverse Tunnel (No Tailscale required)
|
|
209
|
+
Bind the host strictly to localhost:
|
|
210
|
+
```bash
|
|
211
|
+
touchop init-host --bind 127.0.0.1 --allow-ip 127.0.0.1
|
|
212
|
+
```
|
|
213
|
+
Forward port `18765` when connecting via SSH:
|
|
214
|
+
```bash
|
|
215
|
+
ssh -R 127.0.0.1:18765:127.0.0.1:18765 user@remote-host
|
|
216
|
+
```
|
|
217
|
+
Initialize the client with `--url http://127.0.0.1:18765`.
|
|
218
|
+
|
|
219
|
+
### Multi-Host Failover
|
|
220
|
+
Pass `--url` multiple times during `init-client` (or list one URL per line in `~/.config/touchop/urls`):
|
|
221
|
+
```bash
|
|
222
|
+
touchop init-client \
|
|
223
|
+
--url http://100.64.0.10:18765 \
|
|
224
|
+
--url http://100.64.0.11:18765 \
|
|
225
|
+
--token-file /path/to/token
|
|
226
|
+
```
|
|
227
|
+
If the primary host is asleep or unreachable, `touchop` fails over automatically to the next URL. Explicit policy/auth errors (`401`/`403`) do not fail over.
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## Security & Threat Model
|
|
232
|
+
|
|
233
|
+
See [SECURITY.md](SECURITY.md) for the full threat model, hardening controls, audit log format, and what `touchop` does and does not protect against.
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## Contributing & Development
|
|
238
|
+
|
|
239
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). Run the zero-dependency test suite locally with:
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
python3 -W error::ResourceWarning -m unittest discover -s tests -v
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## License
|
|
246
|
+
|
|
247
|
+
[MIT](LICENSE)
|
touchop-0.1.0/README.md
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/icon.png" alt="touchop icon" width="112" height="112" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">touchop</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>Touch ID-gated 1Password CLI (<code>op</code>) bridge for remote VMs, containers, AI coding agents, and secondary machines.</strong>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://github.com/saran-007/touchop/releases"><img src="https://img.shields.io/github/v/release/saran-007/touchop?color=3b82f6&label=release" alt="Release" /></a>
|
|
13
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-10b981" alt="MIT License" /></a>
|
|
14
|
+
<img src="https://img.shields.io/badge/python-3.9%2B-6366f1" alt="Python 3.9+" />
|
|
15
|
+
<img src="https://img.shields.io/badge/dependencies-0-0ea5e9" alt="Zero Dependencies" />
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<img src="assets/hero.png" alt="touchop remote terminal triggering Mac Touch ID prompt" width="100%" />
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Why `touchop`?
|
|
25
|
+
|
|
26
|
+
On a local Mac or Linux desktop, `op read` and `op run` talk to the 1Password Desktop app and prompt for **Touch ID** (or PolKit biometrics). On a remote Linux VM (Fly.io Sprites, EC2, Hetzner, Docker, WSL) or a headless secondary Mac running AI coding agents (Claude Code, Codex, Cursor, OpenClaw), there is no local biometric sensor.
|
|
27
|
+
|
|
28
|
+
Usually you have to put a long-lived 1Password Service Account token on the remote disk. `touchop` gives you another option:
|
|
29
|
+
|
|
30
|
+
- **Your 1Password credentials never touch the remote machine.**
|
|
31
|
+
- The remote machine installs a drop-in `op` shim on `$PATH` that works seamlessly across **any runtime** (Node.js, Python, Go, Rust, Ruby, Bash, Docker, Claude Code, Codex, OpenClaw).
|
|
32
|
+
- When a remote process runs `op read`, `op inject`, or `op run --env-file=.env.tpl -- npm run dev`, `touchop` forwards only the read request over Tailscale (or an SSH reverse tunnel) to your Mac's Aqua GUI LaunchAgent.
|
|
33
|
+
- **1Password Desktop prompts for Touch ID on your Mac** (showing the custom **touchop** icon and app name via a lightweight headless `touchop.app` bundle), and only the requested secret returns to the remote process in memory.
|
|
34
|
+
|
|
35
|
+
> Unofficial community project. Not affiliated with or endorsed by 1Password or Tailscale.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Comparison
|
|
40
|
+
|
|
41
|
+
| Approach | Mac Touch ID Gate | 1Password Creds on Remote Disk | Works for `op read` / `op run` | Works When Laptop Asleep | Best Fit |
|
|
42
|
+
| :--- | :---: | :---: | :---: | :---: | :--- |
|
|
43
|
+
| **`touchop`** | **Yes** | **None** | **Yes** (with log masking) | No (unless fallback SA set) | Personal dev VMs, Fly Sprites, remote AI coding agents |
|
|
44
|
+
| **1Password Service Account** | No | Long-lived token | Yes | Yes | CI/CD, unattended servers, scoped team dev vaults |
|
|
45
|
+
| **1Password Connect Server** | No | Connect token + self-hosted server | Yes | Yes | Production services, Kubernetes, team infra |
|
|
46
|
+
| **1Password SSH Agent (`ForwardAgent`)** | Yes | None | SSH & Git signing only | No | `git push`, commit signing, remote SSH hops |
|
|
47
|
+
| **Plaintext `.env` files** | No | Plaintext secrets on disk | N/A | Yes | Never recommended for real credentials |
|
|
48
|
+
|
|
49
|
+
You can also combine approaches: `touchop` automatically delegates to the native `op` binary whenever `OP_SERVICE_ACCOUNT_TOKEN` or `OP_CONNECT_TOKEN` is set in the environment.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Architecture
|
|
54
|
+
|
|
55
|
+
<p align="center">
|
|
56
|
+
<img src="assets/architecture.png" alt="touchop architecture diagram" width="100%" />
|
|
57
|
+
</p>
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Key Features
|
|
62
|
+
|
|
63
|
+
- **Zero external dependencies**: Pure Python 3.9+ standard library (`brew`, `uv`, `pipx`, `pip`, or single-command `scripts/install.sh`).
|
|
64
|
+
- **Works across runtimes & platforms**: Drop-in `op` shim works anywhere a process calls `op` (Node, Python, Go, Rust, Makefiles, Fly.io Sprites, EC2, Docker containers, WSL, secondary Macs).
|
|
65
|
+
- **Native macOS Touch ID branding**: `init-host` builds a headless `~/Applications/touchop.app` bundle (`LSUIElement=true`) with `AppIcon.icns`, so 1Password's biometric prompt shows **"Allow touchop to get CLI access"** with the `touchop` icon instead of a generic bare executable icon.
|
|
66
|
+
- **`op run` with secret masking**: Resolves `op://` references via your Mac, injects them strictly into child process memory on the remote machine, and redacts secret values from child stdout/stderr (`<concealed by touchop>`) unless `--no-masking` is passed.
|
|
67
|
+
- **Read-only by default**: Hard allowlist of read/query `op` subcommands (`read`, `item get/list`, `vault list/get`, `document get/list`, `inject`, `whoami`, `account list/get`, `--version`). Mutations (`item delete`, `item create`, `item edit`, `vault delete`, `run` on host, etc.) are rejected with `HTTP 403`.
|
|
68
|
+
- **Vault allowlists (`--allow-vault`)**: Restrict remote machines to specific vaults (for example `Engineering-Dev` or `Sandbox-Secrets`) so remote agents can never even request items from `Personal` or `Prod Admin`.
|
|
69
|
+
- **Optional per-request macOS dialog (`--require-confirm`)**: Because 1Password Desktop caches CLI biometric unlocks for ~10 minutes by default, `--require-confirm` adds an explicit native macOS dialog showing the requesting host and exact `op` command before every call.
|
|
70
|
+
- **Multi-host failover**: Pass multiple `--url` values on a client to automatically fail over if your primary Mac is asleep.
|
|
71
|
+
- **Seamless native fallback**: Setting `OP_SERVICE_ACCOUNT_TOKEN`, `OP_CONNECT_TOKEN`, `OP_SESSION_*`, or `TOUCHOP_DISABLE=1` automatically delegates straight to the machine's native `op` binary.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Quickstart
|
|
76
|
+
|
|
77
|
+
### 1. Install `touchop` (on both host and client)
|
|
78
|
+
|
|
79
|
+
**Homebrew (macOS / Linux):**
|
|
80
|
+
```bash
|
|
81
|
+
brew install saran-007/tap/touchop
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Python (`uv` / `pipx` / `pip`):**
|
|
85
|
+
```bash
|
|
86
|
+
uv tool install git+https://github.com/saran-007/touchop.git
|
|
87
|
+
# or: pip install git+https://github.com/saran-007/touchop.git
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Zero-dependency install (no Homebrew, pip, or venv needed):**
|
|
91
|
+
```bash
|
|
92
|
+
git clone https://github.com/saran-007/touchop.git
|
|
93
|
+
cd touchop && ./scripts/install.sh
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 2. Initialize your biometric host (Mac or Linux Desktop)
|
|
97
|
+
|
|
98
|
+
Make sure **1Password Desktop** has **Settings > Developer > Integrate with 1Password CLI** enabled.
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
touchop init-host \
|
|
102
|
+
--allow-ip 100.64.0.42 \
|
|
103
|
+
--allow-vault "Engineering-Dev" \
|
|
104
|
+
--allow-vault "Sandbox-Secrets" \
|
|
105
|
+
--account acme.1password.com
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
This will:
|
|
109
|
+
- Auto-detect your Tailscale IPv4 address (or fall back to `127.0.0.1` for SSH tunnel mode).
|
|
110
|
+
- Generate a 256-bit bearer token at `~/.config/touchop/token` (`chmod 600`).
|
|
111
|
+
- Write `~/.config/touchop/host.json` (`chmod 600`).
|
|
112
|
+
- Install and start a **macOS Aqua LaunchAgent** (`dev.touchop.bridge`, wrapped in a headless `~/Applications/touchop.app` bundle with `AppIcon.icns` so Touch ID prompts show the **touchop** name and icon) or a **Linux `systemd --user` service** so the bridge runs inside your GUI session and can trigger biometrics.
|
|
113
|
+
|
|
114
|
+
Want an explicit click confirmation on your Mac for every remote secret read? Add `--require-confirm`.
|
|
115
|
+
|
|
116
|
+
### 3. Initialize a remote client (Fly.io Sprite, Linux VM, Docker, or secondary Mac)
|
|
117
|
+
|
|
118
|
+
Copy `~/.config/touchop/token` securely from your host to the remote machine (for example via `scp` or stdin pipe), then run:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
touchop init-client \
|
|
122
|
+
--url http://<HOST_TAILSCALE_IP>:18765 \
|
|
123
|
+
--token-file /path/to/copied/token
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Add more clients anytime from your host:
|
|
127
|
+
```bash
|
|
128
|
+
touchop allow-ip 100.64.0.30
|
|
129
|
+
touchop doctor
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Usage on Remote Machines
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# Read a single secret (triggers Touch ID on your Mac)
|
|
138
|
+
op read "op://Engineering-Dev/Postgres/password"
|
|
139
|
+
|
|
140
|
+
# Run a Node or Python app with secrets injected in memory only (masked in logs)
|
|
141
|
+
op run --env-file=.env.tpl -- npm run dev
|
|
142
|
+
op run --env-file=.env.tpl -- uv run python app.py
|
|
143
|
+
|
|
144
|
+
# Inject secrets into a local config file on the remote machine
|
|
145
|
+
op inject -i config.tpl.yml -o config.yml
|
|
146
|
+
|
|
147
|
+
# Bypass the bridge when using a headless Service Account in CI or unattended runs
|
|
148
|
+
OP_SERVICE_ACCOUNT_TOKEN=ops_... op read "op://Engineering-Dev/Postgres/password"
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Transport Options
|
|
154
|
+
|
|
155
|
+
### Tailscale (Recommended)
|
|
156
|
+
`touchop init-host` automatically binds strictly to your Tailscale IP (`100.x.y.z:18765`). Traffic is WireGuard-encrypted end-to-end by Tailscale, never exposed to LAN or public Wi-Fi. You can additionally pin allowed Tailscale node names via `--allow-node <node-name>` (checked with `tailscale whois`).
|
|
157
|
+
|
|
158
|
+
### SSH Reverse Tunnel (No Tailscale required)
|
|
159
|
+
Bind the host strictly to localhost:
|
|
160
|
+
```bash
|
|
161
|
+
touchop init-host --bind 127.0.0.1 --allow-ip 127.0.0.1
|
|
162
|
+
```
|
|
163
|
+
Forward port `18765` when connecting via SSH:
|
|
164
|
+
```bash
|
|
165
|
+
ssh -R 127.0.0.1:18765:127.0.0.1:18765 user@remote-host
|
|
166
|
+
```
|
|
167
|
+
Initialize the client with `--url http://127.0.0.1:18765`.
|
|
168
|
+
|
|
169
|
+
### Multi-Host Failover
|
|
170
|
+
Pass `--url` multiple times during `init-client` (or list one URL per line in `~/.config/touchop/urls`):
|
|
171
|
+
```bash
|
|
172
|
+
touchop init-client \
|
|
173
|
+
--url http://100.64.0.10:18765 \
|
|
174
|
+
--url http://100.64.0.11:18765 \
|
|
175
|
+
--token-file /path/to/token
|
|
176
|
+
```
|
|
177
|
+
If the primary host is asleep or unreachable, `touchop` fails over automatically to the next URL. Explicit policy/auth errors (`401`/`403`) do not fail over.
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Security & Threat Model
|
|
182
|
+
|
|
183
|
+
See [SECURITY.md](SECURITY.md) for the full threat model, hardening controls, audit log format, and what `touchop` does and does not protect against.
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Contributing & Development
|
|
188
|
+
|
|
189
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). Run the zero-dependency test suite locally with:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
python3 -W error::ResourceWarning -m unittest discover -s tests -v
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## License
|
|
196
|
+
|
|
197
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "touchop"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Touch ID-gated 1Password CLI bridge for remote VMs, containers, AI coding agents, and secondary machines over Tailscale or SSH."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { file = "LICENSE" }
|
|
11
|
+
requires-python = ">=3.9"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Saran Siva" }
|
|
14
|
+
]
|
|
15
|
+
keywords = ["1password", "touch-id", "tailscale", "ssh", "secrets", "ai-agents", "fly-sprites", "cli"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Environment :: Console",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Operating System :: MacOS",
|
|
22
|
+
"Operating System :: POSIX :: Linux",
|
|
23
|
+
"Programming Language :: Python :: 3",
|
|
24
|
+
"Programming Language :: Python :: 3.9",
|
|
25
|
+
"Programming Language :: Python :: 3.10",
|
|
26
|
+
"Programming Language :: Python :: 3.11",
|
|
27
|
+
"Programming Language :: Python :: 3.12",
|
|
28
|
+
"Programming Language :: Python :: 3.13",
|
|
29
|
+
"Topic :: Security",
|
|
30
|
+
"Topic :: Utilities",
|
|
31
|
+
]
|
|
32
|
+
dependencies = []
|
|
33
|
+
|
|
34
|
+
[project.urls]
|
|
35
|
+
Homepage = "https://github.com/saran-007/touchop"
|
|
36
|
+
Repository = "https://github.com/saran-007/touchop"
|
|
37
|
+
Issues = "https://github.com/saran-007/touchop/issues"
|
|
38
|
+
|
|
39
|
+
[project.scripts]
|
|
40
|
+
touchop = "touchop.cli:main"
|
|
41
|
+
touchop-op = "touchop.shim:main"
|
|
42
|
+
|
|
43
|
+
[tool.setuptools.packages.find]
|
|
44
|
+
include = ["touchop*"]
|
|
45
|
+
|
|
46
|
+
[tool.setuptools.package-data]
|
|
47
|
+
touchop = ["assets/*.png"]
|
touchop-0.1.0/setup.cfg
ADDED