2024-08-21 16:20:20 +00:00
|
|
|
export interface IToken {
|
|
|
|
token: string;
|
|
|
|
expiresAt: number;
|
|
|
|
assignedRoles: string[];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* an identity is assumed by authentication as a user
|
|
|
|
* an identity is ephemeral and has to be renewed regularly
|
|
|
|
*/
|
|
|
|
export interface IIdentity {
|
|
|
|
name: string;
|
|
|
|
userId: string;
|
|
|
|
type: 'machine' | 'human';
|
|
|
|
role: 'admin' | 'user' | 'api' | 'cluster';
|
|
|
|
expiresAt: number;
|
|
|
|
/** the jwt token should contain above data for verification */
|
|
|
|
jwt: string;
|
|
|
|
}
|
|
|
|
|
2024-05-31 13:14:08 +00:00
|
|
|
export interface IUser {
|
|
|
|
id: string;
|
|
|
|
data: {
|
2024-08-21 16:20:20 +00:00
|
|
|
type: 'machine' | 'human';
|
2024-05-31 14:52:23 +00:00
|
|
|
role: 'admin' | 'user' | 'api' | 'cluster';
|
2024-08-21 16:20:20 +00:00
|
|
|
username?: string;
|
|
|
|
password?: string;
|
|
|
|
tokens?: IToken[];
|
2024-05-31 13:14:08 +00:00
|
|
|
}
|
|
|
|
}
|