feat: rotate an API key (#30801)

* feat: rotate an API key

* fix: test response

* chore: create new api key scope

* chore: code review
This commit is contained in:
Brandon Wees
2026-08-18 16:07:39 -04:00
committed by GitHub
parent c8c9d703ef
commit 93d2d30fe0
13 changed files with 264 additions and 3 deletions
@@ -44,6 +44,14 @@ describe(ApiKeyController.name, () => {
});
});
describe('POST /api-keys/:id/rotate', () => {
it('should require a valid uuid', async () => {
const { status, body } = await request(ctx.getHttpServer()).post(`/api-keys/123/rotate`);
expect(status).toBe(400);
expect(body).toEqual(factory.responses.validationError([{ path: ['id'], message: 'Invalid UUID' }]));
});
});
describe('DELETE /api-keys/:id', () => {
it('should require a valid uuid', async () => {
const { status, body } = await request(ctx.getHttpServer()).delete(`/api-keys/123`);