mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-11-07 02:55:24 +00:00
feat: limit api keys to actions when they are made
This commit is contained in:
1 parent
03029cd372
commit
2e79bf9d0d
8 files changed
+47
-5
No files matched your search
@@ -17,6 +17,8 @@ export interface ApiKeyListRecord {
|
||||
expiresAt: string | null;
|
||||
lastUsedAt: string | null;
|
||||
isActive: boolean;
|
||||
/** JSON list, or null for full access. */
|
||||
scopes: string | null;
|
||||
}
|
||||
|
||||
export class ApiKeyRepository {
|
||||
@@ -43,6 +45,7 @@ export class ApiKeyRepository {
|
||||
expiresAt: apiKeys.expiresAt,
|
||||
lastUsedAt: apiKeys.lastUsedAt,
|
||||
isActive: apiKeys.isActive,
|
||||
scopes: apiKeys.scopes,
|
||||
})
|
||||
.from(apiKeys)
|
||||
.leftJoin(users, eq(apiKeys.userId, users.id))
|
||||
|
||||
Reference in new issue
Block a user