Spaces:
Sleeping
Sleeping
Download src/modules/auth/entities/api-key.entity.ts from jinksQspider/openWa: direct link, hf CLI and curl.
- Browser
- Download file 1.16 kB
-
https://huggingface.co/spaces/jinksQspider/openWa/resolve/main/src/modules/auth/entities/api-key.entity.ts
- Command line
-
hf download hf://spaces/jinksQspider/openWa/src/modules/auth/entities/api-key.entity.ts
-
curl -L -o api-key.entity.ts https://huggingface.co/spaces/jinksQspider/openWa/resolve/main/src/modules/auth/entities/api-key.entity.ts
1.16 kB
| import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn, UpdateDateColumn, Index } from 'typeorm'; | |
| export enum ApiKeyRole { | |
| ADMIN = 'admin', | |
| OPERATOR = 'operator', | |
| VIEWER = 'viewer', | |
| } | |
| ('api_keys') | |
| export class ApiKey { | |
| ('uuid') | |
| id: string; | |
| ({ type: 'varchar', length: 100 }) | |
| name: string; | |
| ({ unique: true }) | |
| ({ type: 'varchar', length: 64 }) | |
| keyHash: string; | |
| ({ type: 'varchar', length: 8 }) | |
| keyPrefix: string; | |
| ({ | |
| type: 'varchar', | |
| length: 20, | |
| default: ApiKeyRole.OPERATOR, | |
| }) | |
| role: ApiKeyRole; | |
| ({ type: 'simple-array', nullable: true }) | |
| allowedIps: string[] | null; | |
| ({ type: 'simple-array', nullable: true }) | |
| allowedSessions: string[] | null; | |
| ({ type: 'boolean', default: true }) | |
| isActive: boolean; | |
| ({ type: 'datetime', nullable: true }) | |
| expiresAt: Date | null; | |
| ({ type: 'datetime', nullable: true }) | |
| lastUsedAt: Date | null; | |
| ({ type: 'int', default: 0 }) | |
| usageCount: number; | |
| () | |
| createdAt: Date; | |
| () | |
| updatedAt: Date; | |
| } | |