Implement the following plan: Local test script for Kiro SQLite auth injection Context…
- User
Implement the following plan:
Local test script for Kiro SQLite auth injection
Context
The workflow changes are already applied. This plan adds a local test script that mirrors the CI "Inject Kiro auth token" step so we can verify auth works before pushing.
Approach
Create
scripts/test-kiro-auth.shthat:- Reads auth values from the real macOS kiro DB (
~/Library/Application Support/kiro-cli/data.sqlite3) - Backs up the real DB
- Replaces it with a fresh DB built using the exact same logic as CI (sqlite3 schema + python3 parameterized insert)
- Runs
kiro-cli-chat whoami -f jsonto verify auth works - Restores the original DB (via trap, so it restores even on failure)
Why swap the real DB?
kiro-cli-chatignoresXDG_DATA_HOMEon macOS — it always reads~/Library/Application Support/kiro-cli/data.sqlite3. So we must temporarily replace it.File to create
scripts/test-kiro-auth.sh
bash - Reads auth values from the real macOS kiro DB (
Assistant
★ Insight ─────────────────────────────────────This script uses a backup-and-restore pattern withtrap ... EXIT— a shell idiom that guarantees cleanup even if the script fails midway. The Python parameterized insert (?placeholders) prevents SQL injection from auth token values that might contain quotes or special characters.─────────────────────────────────────────────────Assistant
Now let me make it executable.
Assistant
Created
scripts/test-kiro-auth.shand made it executable.★ Insight ─────────────────────────────────────- The
trap restore EXITpattern ensures the original DB is restored even if the script fails at any point (e.g.,sqlite3errors,kiro-cli-chatcrash). TheEXITsignal fires on both success and failure. - Using
$$(current PID) in the backup filename avoids collisions if the script is accidentally run twice concurrently. - The Python parameterized insert (
?placeholders) is critical here — auth tokens often contain characters like',",;that would break raw SQL string interpolation.─────────────────────────────────────────────────
Run it with:
bashbash scripts/test-kiro-auth.sh- The
- User
just commit whats already staged and push
Assistant
Staged changes are the two workflow files. Committing and pushing now.
Assistant
Pushed
40ee0d1etoorigin/alisha/kiro-oneshot.