fix(#290): Secure identity verification endpoint
Added @UseGuards(AuthGuard) and rate limiting (@Throttle) to /api/v1/federation/identity/verify endpoint. Configured strict rate limit (10 req/min) to prevent abuse of this previously public endpoint. Added test to verify guards are applied. Security improvement: Prevents unauthorized access and rate limit abuse of identity verification endpoint. Fixes #290 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -90,6 +90,15 @@ describe("IdentityLinkingController", () => {
|
||||
});
|
||||
|
||||
describe("POST /identity/verify", () => {
|
||||
it("should have AuthGuard and Throttle decorators applied", () => {
|
||||
// Verify that the endpoint has proper guards and rate limiting
|
||||
const verifyMetadata = Reflect.getMetadata(
|
||||
"__guards__",
|
||||
IdentityLinkingController.prototype.verifyIdentity
|
||||
);
|
||||
expect(verifyMetadata).toBeDefined();
|
||||
});
|
||||
|
||||
it("should verify identity with valid request", async () => {
|
||||
const dto: VerifyIdentityDto = {
|
||||
localUserId: "local-user-id",
|
||||
|
||||
Reference in New Issue
Block a user