Update permission implementation for ST V3

This commit is contained in:
Tuan Dang
2023-09-30 12:52:35 +01:00
parent d723d26d2e
commit 3779209ed5
12 changed files with 96 additions and 40 deletions
@@ -0,0 +1,4 @@
export enum Permission {
READ = "read",
WRITE = "write"
}
@@ -1,3 +1,5 @@
import { Permission } from "./enums";
export type ServiceTokenScope = {
environment: string;
secretPath: string;
@@ -37,7 +39,7 @@ export type DeleteServiceTokenRes = { serviceTokenData: ServiceToken };
// --- v3
export type ServiceTokenV3Scope = {
permission: string;
permissions: Permission[];
environment: string;
secretPath: string;
};
@@ -48,6 +50,7 @@ export type ServiceTokenDataV3 = {
workspace: string;
isActive: boolean;
lastUsed?: string;
usageCount: number;
scopes: ServiceTokenV3Scope[];
expiresAt?: string;
createdAt: string;