Skip to content
docs.
WORKSPACE

Your documentation

Explore the project catalog
Localzet ServerАсинхронный PHP-серверTriangleФреймворк и компонентыMIX IDИдентификация и интеграцииHack APIПубличные API хакатонаACNПроект и компонентыUserlay / UserNetПроект и компонентыAxiomПроект и компонентыМесседжинг через почтуПроект и компонентыLWT / JWT / JOSEПроект и компонентыФинансовая аналитика KimaiПроект и компонентыМультипарадигмальная БДПроект и компонентыZorin PlatformПроект и компонентыZorin TrustПроект и компонентыFloraScope / VegwatchПроект и компонентыaegis-qДокументация проектаaevumdbДокументация проектаauditДокументация проектаauto-invest-managerАвтотрейдерcaine-companionДокументация проектаcertbot-cloudflareДокументация проектаClusterLocalzet Server / ClustercmdveilДокументация проектаConsolePHP CLICronБиблиотеки Localzet Serverdata-connectorДокументация проектаdevice-controlDevice Controlenn-projectДокументация проектаEventsБиблиотеки Localzet ServerflowsintДокументация проектаforgeДокументация проектаHttpClientБиблиотеки Localzet ServerinterpreterСобственный языкinvariaДокументация проектаkeynotesДокументация проектаknotrouteKnotroutelaravel-personal-analyticsДокументация проектаlocalzet-osДокументация проектаmeridianДокументация проектаMQTTБиблиотеки Localzet Servernano-kernelСобственная ОСNoterДокументация проектаpersonal-analyticsДокументация проектаProxyБиблиотеки Localzet ServerPSRБиблиотеки Localzet ServerPSR-7Библиотеки Localzet Serverrschs-monitorДокументация проектаsemsealДокументация проектаshardsealДокументация проектаSocketIOБиблиотеки Localzet ServerSOCKS5Библиотеки Localzet Serverstandalone-analyticsДокументация проектаstatic-php-cliДокументация проектаStorageБиблиотеки Localzet ServersutureДокументация проектаtempoweaveДокументация проектаttsСинтез речиTunnelБиблиотеки Localzet Serverui-kitUI KitvesperДокументация проектаWebAnalyzerWebAnalyzerzorin-access-brokerДокументация проектаzorin-authority-brokerДокументация проектаzorin-authority-sdk-phpДокументация проектаzorin-authority-sdk-pythonДокументация проектаzorin-authority-sdk-tsДокументация проекта✓zorin-client-intelДокументация проектаzorin-device-core-aospДокументация проектаzorin-host-agentДокументация проектаzorin-native-labДокументация проектаzorin-nodeДокументация проектаzorin-opsДокументация проектаdonstu-python-sdkДокументация проектаfloortraceFloortraceserver-rsLocalzet Server / Cluster
Catalog
Documentation/zorin-authority-sdk-ts

zorin-authority-sdk-ts — API

src/index.ts

export type AuthorizeInput = {
projectId: string;
origin: string;
challenge: string;
action: string;
resource: string;
message?: string;
ttlSeconds?: number;
};

src/index.ts

export type AuthorityRequest = {
id: string;
project_id: string;
origin: string;
challenge: string;
action: string;
resource: string;
message: string;
status: 'pending' | 'approved' | 'denied' | 'expired' | 'error';
error?: string;
assertion?: string;
created_at: string;
expires_at: string;
};

src/index.ts

export type OwnerProof = {
version: 'ZOWNER/1';
action: string;
resource: string;
host_fingerprint: string;
phone_fingerprint: string;
phone_public_key_der_hex: string;
nonce: string;
issued_unix: number;
expires_unix: number;
signature_der_hex: string;
};

src/index.ts

export type AssertionPayload = {
v: 'ZAUTH/1';
iss: string;
aud: string;
origin: string;
challenge: string;
action: string;
resource: string;
iat: number;
exp: number;
jti: string;
assurance: string;
host_fp: string;
phone_fp: string;
owner_proof: OwnerProof;
};

src/index.ts

export type VerifyExpected = {
aud: string;
origin: string;
challenge: string;
action: string;
resource: string;
phonePublicKeyDERHex: string;
};

src/index.ts

export async function authorize(input: AuthorizeInput, opts: {
baseUrl?: string;
timeoutMs?: number;
} = {}): Promise<AuthorityRequest>

src/index.ts

export function parseAssertion(assertion: string): AssertionPayload

src/index.ts

export async function verifyAssertion(assertion: string, brokerPublicKeyPem: string, expected: VerifyExpected, now = Math.floor(Date.now() / 1000)): Promise<AssertionPayload>