CH-J Toolsإدارة الخوادم عبر SSH
القائمة
المصدر المنشور

CH-J Tools

تصفّح الأدلة والملفات الخاصة بإصدار محدد من التطبيق.

تنزيل الشيفرة المصدرية بصيغة ZIP
CH-J / Server Manager 1704 ملفات
0.1.2-beta تاريخ الإضافة: · تاريخ البناء:
vault.ts تاريخ الإضافة: لم يُسجَّل التاريخ ١٫٨ KB · 28 أسطر
الشيفرة تنزيل الملف
1/** Encrypted vault and OS-protected (biometric) unlocking. Secrets never leave the Rust Core. */
2import { call } from "../transport";
3import type { BiometricStatus, Result, VaultStatus } from "../types";
5async function unwrap<T>(command: string, channel: string): Promise<T> {
6 const result = await call<Result<T>>(command, channel);
7 if (!result.ok) throw Object.assign(new Error(result.error.message), { code: result.error.code });
8 return result.value;
9}
11export const vault = Object.freeze({
12 status: () => call<VaultStatus>("core_vault_status", "vault:status"),
13 create: (password: string) => call<VaultStatus>("core_vault_create", "vault:create", { password }),
14 unlock: (password: string) => call<VaultStatus>("core_vault_unlock", "vault:unlock", { password }),
15 lock: () => call<VaultStatus>("core_vault_lock", "vault:lock"),
16 reset: (confirmation: string) => call<VaultStatus>("core_vault_reset", "vault:reset", { confirmation })
17});
19export const biometrics = Object.freeze({
20 status: () => unwrap<BiometricStatus>("core_biometrics_status", "biometrics:status"),
21 enable: () => unwrap<BiometricStatus>("core_biometrics_enable", "biometrics:enable"),
22 disable: () => unwrap<{ enabled: false; enrolled: false }>("core_biometrics_disable", "biometrics:disable"),
23 unlock: () => unwrap<VaultStatus>("core_biometrics_unlock", "biometrics:unlock"),
24 autoUnlock: () => unwrap<{ attempted: boolean; reason?: string; status?: VaultStatus; error?: { code: string } }>("core_biometrics_auto_unlock", "biometrics:autoUnlock"),
25 authenticate: () => unwrap<{ authenticated: true }>("core_biometrics_authenticate", "biometrics:authenticate")
26});
28export const keychain = (action: string, options: Record<string, unknown> = {}) => call<Record<string, unknown>>("core_keychain", "keychain", { ...options, action });
SHA-2560c4214e706abf96295d54d81f021310dbe25d3e5deafe3eb5b710ee054f22ddd

CH-J Proprietary Software License 1.14 · تُتاح الشيفرة المصدرية بموجب CH-J Proprietary Software License 1.14. وإتاحتها لا تغيّر شروط الترخيص ولا تمنح حقوقًا إضافية.

SHA-256 للأرشيفac8fe790f4ba60fc098f8c985fc2656cfcc6cdc21fb34b30e308a2b54e62258f
الملفات