feat: introducing rate-limiting on queries, mutations and most of the REST endpoints (HBE-111) (#46)
* feat: rate-limiting guard added and configured in app module * feat: rate-limit annotation added in controllers and resolvers (query, mutation, not subscription) * docs: added comments
This commit is contained in:
@@ -34,7 +34,10 @@ import { TeamInviteViewerGuard } from './team-invite-viewer.guard';
|
||||
import { TeamInviteTeamOwnerGuard } from './team-invite-team-owner.guard';
|
||||
import { UserService } from 'src/user/user.service';
|
||||
import { PubSubService } from 'src/pubsub/pubsub.service';
|
||||
import { GqlThrottlerGuard } from 'src/guards/gql-throttler.guard';
|
||||
import { SkipThrottle } from '@nestjs/throttler';
|
||||
|
||||
@UseGuards(GqlThrottlerGuard)
|
||||
@Resolver(() => TeamInvitation)
|
||||
export class TeamInvitationResolver {
|
||||
constructor(
|
||||
@@ -199,6 +202,7 @@ export class TeamInvitationResolver {
|
||||
description: 'Listens to when a Team Invitation is added',
|
||||
resolve: (value) => value,
|
||||
})
|
||||
@SkipThrottle()
|
||||
@UseGuards(GqlAuthGuard, GqlTeamMemberGuard)
|
||||
@RequiresTeamRole(
|
||||
TeamMemberRole.OWNER,
|
||||
@@ -220,6 +224,7 @@ export class TeamInvitationResolver {
|
||||
description: 'Listens to when a Team Invitation is removed',
|
||||
resolve: (value) => value,
|
||||
})
|
||||
@SkipThrottle()
|
||||
@UseGuards(GqlAuthGuard, GqlTeamMemberGuard)
|
||||
@RequiresTeamRole(
|
||||
TeamMemberRole.OWNER,
|
||||
|
||||
Reference in New Issue
Block a user