Class AuthorizationRequestHandlerDecorator

java.lang.Object
org.a2aproject.sdk.server.requesthandlers.AuthorizationRequestHandlerDecorator
All Implemented Interfaces:
RequestHandler

@Decorator @Priority(50) public class AuthorizationRequestHandlerDecorator extends Object implements RequestHandler
  • Constructor Details

    • AuthorizationRequestHandlerDecorator

      public AuthorizationRequestHandlerDecorator()
    • AuthorizationRequestHandlerDecorator

      public AuthorizationRequestHandlerDecorator(RequestHandler delegate, @Nullable TaskAuthorizationProvider authorizationProvider)
      Creates an authorization decorator programmatically.

      This constructor is intended for integrations with non-CDI runtimes such as Spring Framework.

      Parameters:
      delegate - request handler being protected
      authorizationProvider - task authorization provider; null disables authorization
  • Method Details

    • onGetTask

      public org.a2aproject.sdk.spec.Task onGetTask(org.a2aproject.sdk.spec.TaskQueryParams params, ServerCallContext context) throws org.a2aproject.sdk.spec.A2AError
      Specified by:
      onGetTask in interface RequestHandler
      Throws:
      org.a2aproject.sdk.spec.A2AError
    • onListTasks

      public org.a2aproject.sdk.jsonrpc.common.wrappers.ListTasksResult onListTasks(org.a2aproject.sdk.spec.ListTasksParams params, ServerCallContext context) throws org.a2aproject.sdk.spec.A2AError
      Specified by:
      onListTasks in interface RequestHandler
      Throws:
      org.a2aproject.sdk.spec.A2AError
    • onCancelTask

      public org.a2aproject.sdk.spec.Task onCancelTask(org.a2aproject.sdk.spec.CancelTaskParams params, ServerCallContext context) throws org.a2aproject.sdk.spec.A2AError
      Specified by:
      onCancelTask in interface RequestHandler
      Throws:
      org.a2aproject.sdk.spec.A2AError
    • onMessageSend

      public org.a2aproject.sdk.spec.EventKind onMessageSend(org.a2aproject.sdk.spec.MessageSendParams params, ServerCallContext context) throws org.a2aproject.sdk.spec.A2AError
      Specified by:
      onMessageSend in interface RequestHandler
      Throws:
      org.a2aproject.sdk.spec.A2AError
    • onMessageSendStream

      public Flow.Publisher<org.a2aproject.sdk.spec.StreamingEventKind> onMessageSendStream(org.a2aproject.sdk.spec.MessageSendParams params, ServerCallContext context) throws org.a2aproject.sdk.spec.A2AError
      Specified by:
      onMessageSendStream in interface RequestHandler
      Throws:
      org.a2aproject.sdk.spec.A2AError
    • onCreateTaskPushNotificationConfig

      public org.a2aproject.sdk.spec.TaskPushNotificationConfig onCreateTaskPushNotificationConfig(org.a2aproject.sdk.spec.TaskPushNotificationConfig params, ServerCallContext context) throws org.a2aproject.sdk.spec.A2AError
      Specified by:
      onCreateTaskPushNotificationConfig in interface RequestHandler
      Throws:
      org.a2aproject.sdk.spec.A2AError
    • onGetTaskPushNotificationConfig

      public org.a2aproject.sdk.spec.TaskPushNotificationConfig onGetTaskPushNotificationConfig(org.a2aproject.sdk.spec.GetTaskPushNotificationConfigParams params, ServerCallContext context) throws org.a2aproject.sdk.spec.A2AError
      Specified by:
      onGetTaskPushNotificationConfig in interface RequestHandler
      Throws:
      org.a2aproject.sdk.spec.A2AError
    • onSubscribeToTask

      public Flow.Publisher<org.a2aproject.sdk.spec.StreamingEventKind> onSubscribeToTask(org.a2aproject.sdk.spec.TaskIdParams params, ServerCallContext context) throws org.a2aproject.sdk.spec.A2AError
      Specified by:
      onSubscribeToTask in interface RequestHandler
      Throws:
      org.a2aproject.sdk.spec.A2AError
    • onListTaskPushNotificationConfigs

      public org.a2aproject.sdk.spec.ListTaskPushNotificationConfigsResult onListTaskPushNotificationConfigs(org.a2aproject.sdk.spec.ListTaskPushNotificationConfigsParams params, ServerCallContext context) throws org.a2aproject.sdk.spec.A2AError
      Specified by:
      onListTaskPushNotificationConfigs in interface RequestHandler
      Throws:
      org.a2aproject.sdk.spec.A2AError
    • onDeleteTaskPushNotificationConfig

      public void onDeleteTaskPushNotificationConfig(org.a2aproject.sdk.spec.DeleteTaskPushNotificationConfigParams params, ServerCallContext context) throws org.a2aproject.sdk.spec.A2AError
      Specified by:
      onDeleteTaskPushNotificationConfig in interface RequestHandler
      Throws:
      org.a2aproject.sdk.spec.A2AError
    • authorizeTaskAccess

      public void authorizeTaskAccess(@Nullable String requestedTaskId, ServerCallContext context, TaskOperation operation) throws org.a2aproject.sdk.spec.A2AError
      Specified by:
      authorizeTaskAccess in interface RequestHandler
      Throws:
      org.a2aproject.sdk.spec.A2AError