-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimpersonation.interface.ts
More file actions
63 lines (56 loc) · 1.32 KB
/
impersonation.interface.ts
File metadata and controls
63 lines (56 loc) · 1.32 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Copyright The Linux Foundation and each contributor to LFX.
// SPDX-License-Identifier: MIT
import type { PersonaType } from './persona.interface';
/**
* Decoded claims from an LFX access token (JWT payload).
*/
export interface LfxAccessTokenClaims {
sub: string;
'http://lfx.dev/claims/email'?: string;
'http://lfx.dev/claims/username'?: string;
'http://lfx.dev/claims/can_impersonate'?: boolean;
exp?: number;
aud?: string | string[];
iss?: string;
[key: string]: unknown;
}
/**
* Target user information during impersonation
*/
export interface ImpersonationUser {
sub: string;
email: string;
username: string;
name?: string;
picture?: string;
}
/**
* Information about the admin performing impersonation
*/
export interface Impersonator {
sub: string;
email: string;
name: string;
}
/**
* Request body for starting impersonation
*/
export interface ImpersonationStartRequest {
targetUser: string;
personaContext?: PersonaType;
}
/**
* Response for impersonation status check
*/
export interface ImpersonationStatusResponse {
impersonating: boolean;
targetUser?: ImpersonationUser;
impersonator?: Impersonator;
}
/**
* Response after successfully starting impersonation
*/
export interface ImpersonationStartResponse {
impersonating: boolean;
targetUser: ImpersonationUser;
}