UNPKG

1.45 kBTypeScriptView Raw
1import { RemoteUser } from '../commons';
2import { PackageAccess } from '../manifest';
3import { AuthAccessCallback, AuthCallback } from './auth';
4import { IPlugin } from './commons';
5export interface AllowAccess {
6 name: string;
7 version?: string;
8 tag?: string;
9}
10/**
11 * ```typescript
12 * dasdsadsa()
13 * ```
14 */
15export interface IPluginAuth<T> extends IPlugin<T> {
16 /**
17 * @param props user from Application component
18 */
19 authenticate(user: string, password: string, cb: AuthCallback): void;
20 adduser?(user: string, password: string, cb: AuthCallback): void;
21 changePassword?(user: string, password: string, newPassword: string, cb: AuthCallback): void;
22 allow_publish?(user: RemoteUser, pkg: T & PackageAccess, cb: AuthAccessCallback): void;
23 allow_access?(user: RemoteUser, pkg: T & PackageAccess, cb: AuthAccessCallback): void;
24 allow_unpublish?(user: RemoteUser, pkg: T & PackageAccess, cb: AuthAccessCallback): void;
25 allow_publish?(user: RemoteUser, pkg: AllowAccess & PackageAccess, cb: AuthAccessCallback): void;
26 allow_access?(user: RemoteUser, pkg: AllowAccess & PackageAccess, cb: AuthAccessCallback): void;
27 allow_unpublish?(user: RemoteUser, pkg: AllowAccess & PackageAccess, cb: AuthAccessCallback): void;
28 apiJWTmiddleware?(helpers: any): Function;
29}
30export * from './auth';
31export * from './storage';
32export * from './middleware';
33export * from './commons';
34export * from './filter';