openvibe-sdk/auth/delegated

Generated at from openvibe-contracts v0.454.0 and openvibe-sdk v0.193.0.

From types/auth-delegated.d.ts (server only). Declarations are shown verbatim.

interface DelegatedInfo

A delegated token's claims as a site sees them (0.187.0): the person, role 'user', no staff claims.

export interface DelegatedInfo { by: string; scope: 'read' | 'write'; services: string[] }

const DELEGATED_TYP

export declare const DELEGATED_TYP: 'delegated';

const DELEGATED_MAX_TTL_SEC

export declare const DELEGATED_MAX_TTL_SEC: number;

function delegatedClaims

export declare function delegatedClaims(opts: {
    user: { id?: number | string; subject_id?: string; username?: string; display_name?: string; avatar_url?: string | null };
    by: string; services: string | string[]; scope?: 'read' | 'write'; ttlSec?: number; issuer?: string; audience?: string | string[]; now?: number;
}): UserTokenClaims & { typ: 'delegated'; svc: string[]; act: { sub: string }; scope: 'read' | 'write'; jti: string };

function checkDelegated

export declare function checkDelegated(claims: UserTokenClaims, service: string): UserTokenClaims & { delegated: DelegatedInfo };

function isDelegated

export declare function isDelegated(userOrClaims: unknown): boolean;

const STAFF_CLAIMS

export declare const STAFF_CLAIMS: readonly string[];