Spaces:
Runtime error
Runtime error
Download src/modules/integration/redrive.controller.spec.ts from MuhammadNoman7600/qwen_2.5_model: direct link, hf CLI and curl.
- Browser
- Download file 728 Bytes
-
https://huggingface.co/spaces/MuhammadNoman7600/qwen_2.5_model/resolve/main/src/modules/integration/redrive.controller.spec.ts
- Command line
-
hf download hf://spaces/MuhammadNoman7600/qwen_2.5_model/src/modules/integration/redrive.controller.spec.ts
-
curl -L -o redrive.controller.spec.ts https://huggingface.co/spaces/MuhammadNoman7600/qwen_2.5_model/resolve/main/src/modules/integration/redrive.controller.spec.ts
728 Bytes
| import { Reflector } from '@nestjs/core'; | |
| import { RedriveController } from './redrive.controller'; | |
| import { ApiKeyRole } from '../auth/entities/api-key.entity'; | |
| import { REQUIRED_ROLE_KEY } from '../auth/decorators/auth.decorators'; | |
| describe('RedriveController authz', () => { | |
| it('is ADMIN-gated (re-dispatching DLQ payloads can cause real sends; a VIEWER/OPERATOR key must not)', () => { | |
| // The ApiKeyGuard only enforces a role when REQUIRED_ROLE_KEY metadata is present; without this | |
| // decorator any authenticated key (incl. read-only VIEWER) could POST the redrive action. | |
| const role = new Reflector().get<ApiKeyRole>(REQUIRED_ROLE_KEY, RedriveController); | |
| expect(role).toBe(ApiKeyRole.ADMIN); | |
| }); | |
| }); | |