Skip to content

Commit cda89ec

Browse files
committed
chore: bump to v0.5.0 — library API, tests, CI, and publish metadata
- Add AuthyClient API test suite (19 tests) in tests/api_test.rs - Add CI workflow with lib-only build/test job (--no-default-features) - Fill Cargo.toml with repository, homepage, keywords, categories, rust-version - Add v0.5 milestone, update changelog, README, landing page with library API docs - Bump version to 0.5.0 across Cargo.toml, SKILL.md, web locales, and index.html
1 parent a6d5f76 commit cda89ec

File tree

21 files changed

+523
-27
lines changed

21 files changed

+523
-27
lines changed

.github/workflows/ci.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
test:
14+
name: Test
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install Rust toolchain
20+
run: |
21+
rustup update stable
22+
rustup default stable
23+
24+
- name: Cache cargo registry & build
25+
uses: actions/cache@v4
26+
with:
27+
path: |
28+
~/.cargo/registry
29+
~/.cargo/git
30+
target
31+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
32+
restore-keys: ${{ runner.os }}-cargo-
33+
34+
- name: Build (default features)
35+
run: cargo build
36+
37+
- name: Test (all)
38+
run: cargo test
39+
40+
- name: Clippy
41+
run: cargo clippy -- -D warnings
42+
43+
lib:
44+
name: Library (no default features)
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- name: Install Rust toolchain
50+
run: |
51+
rustup update stable
52+
rustup default stable
53+
54+
- name: Cache cargo registry & build
55+
uses: actions/cache@v4
56+
with:
57+
path: |
58+
~/.cargo/registry
59+
~/.cargo/git
60+
target
61+
key: ${{ runner.os }}-cargo-lib-${{ hashFiles('**/Cargo.lock') }}
62+
restore-keys: ${{ runner.os }}-cargo-lib-
63+
64+
- name: Build lib (no default features)
65+
run: cargo build --lib --no-default-features
66+
67+
- name: Test lib (no default features)
68+
run: cargo test --lib --no-default-features
69+
70+
- name: Test API (lib integration tests)
71+
run: cargo test --test api

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.5.0] - 2026-02-20
6+
7+
### Added
8+
9+
- **Library API (`AuthyClient`)** — Use Authy as a Rust crate. `AuthyClient` provides a high-level facade for programmatic vault access: `get`, `store`, `remove`, `rotate`, `list`, `init_vault`, `audit_entries`, `verify_audit_chain`. Authenticate with `with_passphrase()`, `with_keyfile()`, or `from_env()`.
10+
- **Feature-gated CLI** — CLI dependencies (`clap`, `dialoguer`, `ratatui`, `crossterm`, `humantime`) are behind the `cli` feature (on by default). Build with `--no-default-features` for a minimal library-only build.
11+
- **API test suite** — 19 tests exercising the `AuthyClient` API directly (init, store/get, remove, rotate, list, audit, wrong passphrase, env auth, custom actor).
12+
- **CI workflow** — GitHub Actions CI with two jobs: full test suite + clippy, and library-only build/test with `--no-default-features`.
13+
- **Cargo.toml publish metadata**`repository`, `homepage`, `readme`, `keywords`, `categories`, `rust-version` for crates.io readiness.
14+
15+
### Changed
16+
17+
- `auth::read_keyfile` visibility changed to `pub` for library API access
18+
- All internal module visibility adjusted for `lib.rs` re-exports
19+
- CLI modules use `authy::` crate paths instead of `crate::`
20+
521
## [0.4.0] - 2026-02-19
622

723
### Added

CLAUDE.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@ cargo clippy -- -D warnings # lint (must pass clean)
2121
- `src/cli/env.rs``authy env` command (output secrets as env vars)
2222
- `src/cli/import.rs``authy import` command (import from .env files)
2323
- `src/cli/export.rs``authy export` command (export as .env or JSON)
24+
- `src/lib.rs` — library crate root, re-exports core modules
25+
- `src/api.rs``AuthyClient` high-level programmatic API facade
2426
- `src/vault/` — encrypted vault storage (age encryption, MessagePack serialization)
2527
- `src/auth/` — authentication dispatcher (passphrase / keyfile / session token)
2628
- `src/policy/` — glob-based access control policies
2729
- `src/session/` — HMAC session token generation and validation
2830
- `src/audit/` — append-only JSONL audit log with HMAC chain
2931
- `src/subprocess/` — child process spawning with env var injection
30-
- `tests/integration/` — integration tests using assert_cmd + tempfile
32+
- `tests/api_test.rs` — lib-level tests for `AuthyClient` API (serial, isolated HOME)
33+
- `tests/integration/` — CLI integration tests using assert_cmd + tempfile
3134
- `skills/authy/` — Agent Skills standard skill (works with Claude Code, Cursor, OpenClaw, etc.)
3235

3336
## Key Conventions

Cargo.lock

Lines changed: 43 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
[package]
22
name = "authy"
3-
version = "0.4.0"
3+
version = "0.5.0"
44
edition = "2021"
5-
description = "CLI secrets store & dispatch for agents"
5+
rust-version = "1.70"
6+
description = "CLI secrets store & dispatch for AI agents — encrypted vault, scoped policies, run-only tokens, and audit logging"
67
license = "MIT"
8+
repository = "https://github.com/eric8810/authy"
9+
homepage = "https://eric8810.github.io/authy"
10+
readme = "README.md"
11+
keywords = ["secrets", "vault", "agents", "encryption", "cli"]
12+
categories = ["command-line-utilities", "cryptography"]
713

814
[lib]
915
name = "authy"
@@ -71,6 +77,10 @@ rand = "0.8"
7177
# Subtle (constant-time compare)
7278
subtle = "2"
7379

80+
[[test]]
81+
name = "api"
82+
path = "tests/api_test.rs"
83+
7484
[[test]]
7585
name = "integration"
7686
path = "tests/integration/mod.rs"
@@ -83,3 +93,4 @@ lto = true
8393
tempfile = "3"
8494
assert_cmd = "2"
8595
predicates = "3"
96+
serial_test = "3.3.1"

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,31 @@ authy resolve config.yaml.tpl --scope deploy --output config.yaml
2626

2727
`authy run` covers env vars. `authy resolve` covers config files.
2828

29+
## Library API
30+
31+
Use Authy as a Rust crate for programmatic vault access:
32+
33+
```rust
34+
use authy::api::AuthyClient;
35+
36+
let client = AuthyClient::with_passphrase("my-vault-passphrase")?;
37+
client.init_vault()?;
38+
client.store("api-key", "sk-secret-value", false)?;
39+
let value = client.get("api-key")?; // Some("sk-secret-value")
40+
```
41+
42+
```bash
43+
# Add to your project (library only, no CLI deps)
44+
cargo add authy --no-default-features
45+
```
46+
47+
Auth from environment variables:
48+
49+
```rust
50+
// Reads AUTHY_KEYFILE or AUTHY_PASSPHRASE
51+
let client = AuthyClient::from_env()?;
52+
```
53+
2954
## Install
3055

3156
```bash

landing_page.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Admin (TUI or CLI) Agent
5858

5959
| Feature | Description |
6060
|---------|-------------|
61+
| **Library API** | Use as a Rust crate — `AuthyClient` for programmatic vault access; `cargo add authy --no-default-features` |
6162
| **Encrypted Vault** | `age`-encrypted single file; passphrase or X25519 keyfile auth |
6263
| **Scoped Policies** | Glob-based allow/deny rules; deny overrides allow; default deny |
6364
| **Run-Only Mode** | Restrict agents to subprocess injection only — `get`, `env`, `export` blocked |
@@ -163,6 +164,24 @@ authy run --scope claude-code --uppercase --replace-dash _ -- claude
163164

164165
## Use Cases
165166

167+
### Library API (Rust Crate)
168+
169+
```rust
170+
use authy::api::AuthyClient;
171+
172+
// Authenticate and access the vault programmatically
173+
let client = AuthyClient::from_env()?; // reads AUTHY_KEYFILE or AUTHY_PASSPHRASE
174+
client.store("api-key", "sk-secret-value", false)?;
175+
let value = client.get("api-key")?;
176+
let names = client.list(None)?;
177+
client.rotate("api-key", "sk-new-value")?;
178+
```
179+
180+
```bash
181+
# Add to your Rust project (no CLI deps)
182+
cargo add authy --no-default-features
183+
```
184+
166185
### Config File Templates
167186

168187
```bash

milestones.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,25 +84,38 @@ Embed Authy into the places developers already are. Distribution, not features.
8484

8585
**Success criteria:** A developer setting up Claude Code, OpenClaw, or a new agent project encounters Authy as the default secrets pattern.
8686

87-
## v0.4 — File-Layer Secrets
87+
## v0.4 — File-Layer Secrets
8888

8989
`authy run` covers env vars. `authy resolve` covers config files. Together they handle both surfaces where secrets live.
9090

91-
- [ ] **`authy resolve <file>`** — replace `<authy:key-name>` placeholders with real values from vault, output to `--output` path or stdout
92-
- [ ] **Placeholder format**`<authy:key-name>` in any config file (yaml, json, toml, etc.), safe to commit and share
93-
- [ ] **Safe/sensitive command split** — formalize: safe commands (list, run, resolve) work with agent tokens; sensitive commands (get, store, export, import, rotate) require TTY or master key
94-
- [ ] **`authy rekey`** — change passphrase or switch between passphrase/keyfile auth
91+
- [x] **`authy resolve <file>`** — replace `<authy:key-name>` placeholders with real values from vault, output to `--output` path or stdout
92+
- [x] **Placeholder format**`<authy:key-name>` in any config file (yaml, json, toml, etc.), safe to commit and share
93+
- [x] **Safe/sensitive command split** — formalize: safe commands (list, run, resolve) work with agent tokens; sensitive commands (get, store, export, import, rotate) require TTY or master key
94+
- [x] **`authy rekey`** — change passphrase or switch between passphrase/keyfile auth
9595

9696
**Success criteria:** Secrets in config files use placeholders. `authy resolve` produces real files at deploy/launch time. Agents only see placeholder files.
9797

98-
### Deferred to v0.5+
98+
## v0.5 — Library API & Publish Readiness ✓
99+
100+
Expose core vault operations as a Rust library crate. Make Authy embeddable — not just callable.
101+
102+
- [x] **`lib.rs` + `api.rs`**`AuthyClient` high-level facade: `get`, `store`, `remove`, `rotate`, `list`, `init_vault`, `audit_entries`, `verify_audit_chain`
103+
- [x] **Feature-gated CLI** — CLI deps (`clap`, `dialoguer`, `ratatui`, etc.) behind `cli` feature; library builds with `--no-default-features`
104+
- [x] **`AuthyClient::from_env()`** — authenticate from `AUTHY_KEYFILE` or `AUTHY_PASSPHRASE` env vars without interactive prompts
105+
- [x] **Lib-level tests** — 19 tests exercising the `AuthyClient` API directly (init, store, get, remove, rotate, list, audit, wrong passphrase)
106+
- [x] **CI lib job** — GitHub Actions job that builds and tests with `--no-default-features` to prevent regressions
107+
- [x] **Cargo.toml publish metadata**`repository`, `homepage`, `readme`, `keywords`, `categories`, `rust-version` for crates.io
108+
109+
**Success criteria:** Rust programs can `cargo add authy` and use `AuthyClient` to manage secrets programmatically. CLI and library are independently buildable and tested.
110+
111+
### Deferred to v0.6+
99112

100113
- `authy up` / `authy down` (tool launcher — agent platforms already handle process management)
101114
- Agent identity (named agents with scoped access)
102115
- Per-agent audit attribution
103116
- Delegation tokens (agent-to-agent scope narrowing)
104117

105-
## v0.5 — Platform Integration Layer
118+
## v0.6 — Platform Integration Layer
106119

107120
Serve segment 3 (operators) through the platforms they already use. Serve platforms that need a service interface, not just CLI.
108121

@@ -116,7 +129,7 @@ Serve segment 3 (operators) through the platforms they already use. Serve platfo
116129

117130
**Success criteria:** Platforms can integrate Authy as their secrets backend. Operators use Authy through platforms without knowing it.
118131

119-
## v0.6 — Breach Response & Security Hardening
132+
## v0.7 — Breach Response & Security Hardening
120133

121134
When agents get compromised (not if — when), Authy is the incident response tool.
122135

@@ -134,9 +147,9 @@ Authy is on every agent's PATH like `git` is on every developer's PATH.
134147

135148
- [ ] Stable CLI interface — semver guarantee, output formats are API contracts
136149
- [ ] Daemon mode with auto-lock — keep vault unlocked in memory, lock after timeout
137-
- [ ] `lib.rs` extraction — make core modules public for Rust crate consumers
138-
- [ ] Publish to crates.io (lib + CLI split) via Trusted Publishing
139-
- [ ] Comprehensive unit test coverage
150+
- [x] `lib.rs` extraction — make core modules public for Rust crate consumers (shipped in v0.5)
151+
- [ ] Publish to crates.io via Trusted Publishing
152+
- [x] Comprehensive unit test coverage (API tests shipped in v0.5)
140153
- [ ] Vault format versioning + migration for future-proofing
141154
- [ ] cargo-dist for release automation (Homebrew tap, shell/PS installers, cargo-binstall)
142155

skills/authy/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ license: MIT
55
compatibility: Requires `authy` on PATH. Auth via AUTHY_TOKEN (run-only) + AUTHY_KEYFILE.
66
metadata:
77
author: eric8810
8-
version: "0.4.0"
8+
version: "0.5.0"
99
homepage: https://github.com/eric8810/authy
1010
openclaw:
1111
requires:

0 commit comments

Comments
 (0)