CH-J ToolsSSH-এর মাধ্যমে সার্ভার ব্যবস্থাপনা
মেনু
প্রকাশিত সোর্স

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-256ac8fe790f4ba60fc098f8c985fc2656cfcc6cdc21fb34b30e308a2b54e62258f
ফাইল