1 | import { RemoteUser } from '../commons';
|
2 | import { PackageAccess } from '../manifest';
|
3 | import { AuthAccessCallback, AuthCallback } from './auth';
|
4 | import { IPlugin } from './commons';
|
5 | export interface AllowAccess {
|
6 | name: string;
|
7 | version?: string;
|
8 | tag?: string;
|
9 | }
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | export interface IPluginAuth<T> extends IPlugin<T> {
|
16 | |
17 |
|
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 | }
|
30 | export * from './auth';
|
31 | export * from './storage';
|
32 | export * from './middleware';
|
33 | export * from './commons';
|
34 | export * from './filter';
|