feat(droid): support encrypted auth.v2 file format#26819
feat(droid): support encrypted auth.v2 file format#26819wenyuanw wants to merge 4 commits intoraycast:mainfrom
Conversation
|
Thank you for your contribution! 🎉 🔔 @natsustan @alexibuild @AdrianBonpin you might want to have a look. You can use this guide to learn how to check out the Pull Request locally in order to test it. 📋 Quick checkout commandsBRANCH="ext/agent-usage"
FORK_URL="https://github.com/wenyuanw/raycast-extensions.git"
EXTENSION_NAME="agent-usage"
REPO_NAME="raycast-extensions"
git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run devWe're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days. |
Greptile SummaryThis PR adds support for Factory Droid's new AES-256-GCM encrypted credential format ( Key changes:
Confidence Score: 5/5Safe to merge — the crypto logic is sound and backward compatibility is preserved; only a missing CHANGELOG entry remains. All findings are P2 (style/policy). The AES-256-GCM implementation is correct, error handling is robust, and the fallback to legacy files works as expected. The sole outstanding item is the missing CHANGELOG update, which does not affect runtime behaviour. CHANGELOG.md — needs a new entry with the {PR_MERGE_DATE} placeholder prepended. Important Files Changed
Prompt To Fix All With AIThis is a comment left during a code review.
Path: extensions/agent-usage/CHANGELOG.md
Line: 1
Comment:
**CHANGELOG not updated for this PR**
The custom repo policy requires a new CHANGELOG entry for every pull request, using the `{PR_MERGE_DATE}` placeholder. The current top of the file still points to the previous release (`2026-03-16`).
Please prepend a new entry, for example:
```suggestion
## [Encrypted Auth v2 Support] - {PR_MERGE_DATE}
- Support Factory Droid's new `auth.v2.*` encrypted credential format (AES-256-GCM)
- Fall back to legacy `auth.json` / `auth.encrypted` when v2 files are absent
# Agent Usage Changelog
```
**Rule Used:** What: Ensure that CHANGELOG.md is created or updat... ([source](https://app.greptile.com/review/custom-context?memory=97cd51bc-963b-43f5-acc3-9ba85fe7bb2d))
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "chore: add changelog for Droid encrypted..." | Re-trigger Greptile |
| @@ -1,5 +1,11 @@ | |||
| # Agent Usage Changelog | |||
There was a problem hiding this comment.
CHANGELOG not updated for this PR
The custom repo policy requires a new CHANGELOG entry for every pull request, using the {PR_MERGE_DATE} placeholder. The current top of the file still points to the previous release (2026-03-16).
Please prepend a new entry, for example:
| # Agent Usage Changelog | |
| ## [Encrypted Auth v2 Support] - {PR_MERGE_DATE} | |
| - Support Factory Droid's new `auth.v2.*` encrypted credential format (AES-256-GCM) | |
| - Fall back to legacy `auth.json` / `auth.encrypted` when v2 files are absent | |
| # Agent Usage Changelog |
Rule Used: What: Ensure that CHANGELOG.md is created or updat... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/agent-usage/CHANGELOG.md
Line: 1
Comment:
**CHANGELOG not updated for this PR**
The custom repo policy requires a new CHANGELOG entry for every pull request, using the `{PR_MERGE_DATE}` placeholder. The current top of the file still points to the previous release (`2026-03-16`).
Please prepend a new entry, for example:
```suggestion
## [Encrypted Auth v2 Support] - {PR_MERGE_DATE}
- Support Factory Droid's new `auth.v2.*` encrypted credential format (AES-256-GCM)
- Fall back to legacy `auth.json` / `auth.encrypted` when v2 files are absent
# Agent Usage Changelog
```
**Rule Used:** What: Ensure that CHANGELOG.md is created or updat... ([source](https://app.greptile.com/review/custom-context?memory=97cd51bc-963b-43f5-acc3-9ba85fe7bb2d))
How can I resolve this? If you propose a fix, please make it concise.|
Crypto implementation is correct, backward compatibility is preserved, and error handling is solid. |
Description
Support Factory Droid's new encrypted auth file format (
auth.v2).Factory (Droid) has migrated its local credential storage from plain-text JSON (
~/.factory/auth.json) to an AES-256-GCM encrypted format using two files:~/.factory/auth.v2.file— encrypted payload (iv:authTag:ciphertext, base64-encoded)~/.factory/auth.v2.key— 256-bit encryption key (base64-encoded)This PR updates the Droid auth module to:
crypto.createDecipheriv("aes-256-gcm").auth.json/auth.encryptedif v2 files are not present, ensuring backward compatibility.Files Changed
src/droid/auth.tstryParseAuthV2()for decryption,saveAuthV2()for re-encryption, updatedloadAuthFromFiles()to prioritize v2 formatsrc/droid/fetcher.tsauth.v2.*pathsScreencast
N/A — This is an internal auth resolution change with no UI modifications.
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare located outside the metadata folder if they were not generated with our metadata tool