recovered snapshot from suspended aaronjaworski710 (history unavailable)

This commit is contained in:
reform
2026-10-23 20:03:52 +03:00
commit 7b59a16866
20 changed files with 3891 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
# Factory 8090 Credential Collector (Chrome MV3)
Расширение автоматически ловит auth-заголовки (authorization, x-sofa-cognito-id-token, x-zed-token, …) запросов твоей сессии на factory.8090.ai и **само** отправляет их в прокси `127.0.0.1:18090`. Никакого ручного копирования.
## Установка
1. Chrome → `chrome://extensions`
2. Включи **Developer mode** (справа сверху)
3. **Load unpacked** → выбери папку `factory_ext`
4. Убедись, что прокси запущен: `node C:/Users/User/tmp/factory_proxy/server.mjs` (порт 18090)
## Как работает
1. Открой factory.8090.ai, войди в аккаунт
2. Отправь боту любое сообщение
3. Расширение перехватит POST `api.factory.8090.dev/v2/project/<id>/agents/chat-agent/input`, соберёт заголовки и запушит их на `POST /dashboard/credentials` прокси
4. На дашборде `http://127.0.0.1:18090/` статус станет `ready`, появятся модели
Расширение только читает исходящие заголовки — ничего не блокирует и не меняет. Креды уходят только на `127.0.0.1` (твой локальный прокси).
Данные последнего перехвата: `chrome://extensions` → Factory 8090 Credential Collector → service worker → Storage (lastText / lastUrl).
Токены Cognito живут ~час — просто отправь боту ещё одно сообщение, расширение обновит креды само.
+41
View File
@@ -0,0 +1,41 @@
// Factory 8090 Credential Collector — MV3 service worker.
// Watches outgoing requests to api.factory.8090.dev; when it sees a
// chat-agent/input request with an authorization header, it formats the
// headers and POSTs them to the local proxy dashboard endpoint.
// Read-only: never modifies or blocks requests.
const PROXY_ENDPOINT = 'http://127.0.0.1:18090/dashboard/credentials';
const TARGET = /api\.factory\.8090\.dev\/v2\/project\/[0-9a-f-]+\/agents\/chat-agent\/input/i;
chrome.webRequest.onBeforeSendHeaders.addListener(
(details) => {
try {
if (details.method !== 'POST' || !TARGET.test(details.url)) return;
const headers = {};
for (const h of details.requestHeaders || []) {
headers[h.name.toLowerCase()] = h.value || '';
}
if (!headers.authorization) return;
const text = Object.keys(headers)
.map((k) => k + ': ' + headers[k])
.join('\n');
chrome.storage.local.get({ lastSent: 0 }, ({ lastSent }) => {
// Debounce: the site sends several requests per message.
if (Date.now() - lastSent < 2000) return;
chrome.storage.local.set({ lastSent: Date.now(), lastText: text, lastUrl: details.url });
fetch(PROXY_ENDPOINT, {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ text, url: details.url }),
})
.then((r) => r.text())
.then((t) => console.log('[factory-collector] proxy response:', t))
.catch((e) => console.warn('[factory-collector] proxy unreachable:', e.message));
});
} catch (e) {
console.warn('[factory-collector] error:', e);
}
},
{ urls: ['https://api.factory.8090.dev/*'] },
['requestHeaders']
);
+13
View File
@@ -0,0 +1,13 @@
{
"manifest_version": 3,
"name": "Factory 8090 Credential Collector",
"version": "1.0.0",
"description": "Перехватывает auth-заголовки запросов factory.8090.ai и автоматически отправляет их в локальный прокси (127.0.0.1:18090)",
"permissions": ["webRequest"],
"host_permissions": [
"https://api.factory.8090.dev/*",
"https://factory.8090.ai/*",
"http://127.0.0.1:18090/*"
],
"background": { "service_worker": "background.js" }
}