Class CommandSecurityInterceptor

java.lang.Object
io.github.yvasyliev.forwarder.telegram.bot.aspect.CommandSecurityInterceptor

@Component public class CommandSecurityInterceptor extends Object
Aspect that intercepts command execution and handles security checks. If access is denied, it sends an unauthorized action message to the user.
  • Constructor Details

  • Method Details

    • intercept

      public Object intercept(org.aspectj.lang.ProceedingJoinPoint pjp, org.telegram.telegrambots.meta.api.objects.message.Message message) throws Throwable
      Intercepts method calls that handle message events and callback queries. If an AccessDeniedException is thrown, it sends an unauthorized action message.
      Parameters:
      pjp - the proceeding join point
      message - the message object for message events
      Returns:
      the result of the intercepted method or an unauthorized action message
      Throws:
      Throwable - if any error occurs during method execution
    • intercept

      public Object intercept(org.aspectj.lang.ProceedingJoinPoint pjp, org.telegram.telegrambots.meta.api.objects.CallbackQuery query) throws Throwable
      Intercepts method calls that handle callback query events. If an AccessDeniedException is thrown, it sends an unauthorized action response.
      Parameters:
      pjp - the proceeding join point
      query - the callback query object for callback query events
      Returns:
      the result of the intercepted method or an unauthorized action response
      Throws:
      Throwable - if any error occurs during method execution