-
Notifications
You must be signed in to change notification settings - Fork 70
/
keys.ts
47 lines (43 loc) · 1.07 KB
/
keys.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) 2023 Sourcefuse Technologies
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
import {IAuthUser} from 'loopback4-authentication';
import {BindingKey} from '@loopback/context';
import {BINDING_PREFIX} from '../../constants';
export namespace BearerVerifierBindings {
export const Config = BindingKey.create<BearerVerifierConfig>(
`${BINDING_PREFIX}.bearer-verfier.config`,
);
}
export enum BearerVerifierType {
service,
facade,
}
export interface BearerVerifierConfig {
type: BearerVerifierType;
}
export interface IUserPrefs {
locale?: string;
}
export interface IAuthUserWithPermissions<
ID = string,
TID = string,
UTID = string,
> extends IAuthUser {
id?: string;
identifier?: ID;
permissions: string[];
authClientId: number;
userPreferences?: IUserPrefs;
email?: string;
role: string;
firstName: string;
lastName: string;
middleName?: string;
tenantId?: TID;
userTenantId?: UTID;
passwordExpiryTime?: Date;
allowedResources?: string[];
getIdentifier?(): string | undefined;
}