minauth
Version:
A TypeScript library for building authentication systems on top of the Mina blockchain and other zero-knowledge proofs solutions.
36 lines (35 loc) • 1.89 kB
TypeScript
/// <reference types="passport" />
import { Configuration } from './plugin-fp-api.js';
import * as expressCore from 'express-serve-static-core';
import { OutputValidity } from '../plugin/plugintype.js';
export * from '../plugin/plugintype.js';
export { configurationSchema, Configuration, UntypedPluginFactory, UntypedPluginModule } from './plugin-fp-api.js';
export * from '../plugin/interfacekind.js';
import { PluginRuntimeEnv } from './pluginruntime.js';
import { Logger } from '../plugin/logger.js';
export { RuntimePluginInstance, PluginRuntimeEnv, ActivePlugins } from './pluginruntime.js';
/** Read the configuration from a file
* The file path can be passed from $MINAUTH_CONFIG env var and
* defaults to `config.yaml` in the current working directory
*/
export declare const readConfiguration: (cfgPath?: string, logger?: Logger) => Promise<Configuration>;
/**
* Given a logger and plugin configuration, initialize the plugins.
* Provided plugins will be transformed to the functional style interface,
* to used as such by the library.
*/
export declare const initializePlugins: (cfg: Configuration, logger?: Logger) => Promise<PluginRuntimeEnv>;
/**
* Install custom routes for all the active plugins.
* The routes are installed under `/plugins/${pluginName}`.
* and come from `pluginInstance.customRoutes`.
* The routes are meant for plugin / prover communication.
*/
export declare const installCustomRoutes: (env: PluginRuntimeEnv, app: expressCore.Express) => Promise<void>;
/**
* Verify proof with given plugin and return its output.
*/
export declare const verifyProof: (env: PluginRuntimeEnv, input: unknown, pluginName: string) => Promise<unknown>;
/** Validate the output of a plugin within the active plugin runtime.
*/
export declare const validateOutput: (env: PluginRuntimeEnv, output: unknown, pluginName: string) => Promise<OutputValidity>;