You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
558 B
26 lines
558 B
/** 管理员 JWT 有效期(秒) */
|
|
export const JWT_EXPIRY_SECONDS = 86_400;
|
|
|
|
export const ADMIN_ROLE = "admin" as const;
|
|
|
|
export type Permission =
|
|
| "pricing:markup:write"
|
|
| "alert:read"
|
|
| "rpa:operate";
|
|
|
|
/** 管理员角色默认权限(不含宿主侧加价写权限) */
|
|
export const ADMIN_PERMISSIONS: readonly Permission[] = [
|
|
"alert:read",
|
|
"rpa:operate",
|
|
] as const;
|
|
|
|
export type AdminJwtPayload = {
|
|
sub: string;
|
|
role: typeof ADMIN_ROLE;
|
|
};
|
|
|
|
export type ServiceTokenEntry = {
|
|
customerId: string;
|
|
permissions: Permission[];
|
|
};
|