UNPKG

@vigilbase/cli

Version:

Vigilbase CLI — security scanners, agent tools, and Vigilbase One from the terminal.

24 lines (23 loc) • 1.3 kB
import { type CliConfig } from '../lib/config.js'; /** * `resource` is the one resource a new sign-in requests: https://api.vigilbase.com/one for production One (its * v1 API), `<origin>/one` for a loopback One, and One's origin where no API resource exists (staging). Never two: * Identity intersects the scopes of every requested resource. Saved sign-ins refresh with the resource they hold. */ export interface AuthProvider { issuer: string; tokenEndpoint: string; deviceEndpoint: string; userinfoEndpoint: string; revocationEndpoint: string; resource: string; } /** An issuer (discovered from One, or saved with credentials) is trusted only when its origin is exactly trustedIdentityIssuer(config). */ export declare function validateIdentityIssuer(raw: string, config: Pick<CliConfig, 'oneBaseUrl' | 'identityBaseUrl'>): string; export declare function identityProvider(config: CliConfig, issuer: string): Promise<AuthProvider>; /** * Older One deployments answer the protected-resource path with a sign-in * redirect or an HTML page; those mean "no Identity metadata" (legacy login). * JSON that is present but malformed or names another resource still aborts. */ export declare function discoverAuthProvider(config: CliConfig): Promise<AuthProvider | undefined>;