Skip to content

Conversation

@ehsavoie
Copy link
Collaborator

in the a2a.proto

  • io.a2a.spec.TaskPushNotificationConfig pushNotificationConfig to config
  • io.a2a.spec.DeleteTaskPushNotificationConfigParams id to taskId and pushNotificationConfigId to id
  • io.a2a.spec.GetTaskPushNotificationConfigParams id to taskId and pushNotificationConfigId to id
  • io.a2a.spec.ListTaskPushNotificationConfigParam s taskId to id

Fixing issue #634

Fixes #634 🦕

@ehsavoie ehsavoie requested a review from kabir February 12, 2026 17:33
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ehsavoie, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request implements a significant refactoring to standardize attribute naming conventions within the a2a.proto specification and its corresponding Java implementations. The changes primarily focus on clarifying the roles of identifiers and configuration objects related to task push notifications, ensuring consistency across the codebase. This improves readability and maintainability by aligning the API with a more intuitive naming scheme.

Highlights

  • Attribute Renaming: Standardized attribute names across TaskPushNotificationConfig related classes and their parameters to align with a new naming convention.
  • API Consistency: Renamed io.a2a.spec.TaskPushNotificationConfig pushNotificationConfig to config and adjusted parameter names like id to taskId and pushNotificationConfigId to id in relevant parameter classes.
  • Codebase Updates: Updated gRPC, JSON-RPC, and REST transport layers, mappers, and associated tests to reflect these naming changes, ensuring functional correctness.
  • Issue Resolution: Addressed and fixed issue Rename attributes in spec #634 as part of this refactoring effort.
Changelog
  • client/transport/grpc/src/main/java/io/a2a/client/transport/grpc/GrpcTransport.java
    • Updated attribute names for push notification configuration access and parameter handling in gRPC transport methods.
  • client/transport/jsonrpc/src/test/java/io/a2a/client/transport/jsonrpc/JSONRPCTransportTest.java
    • Updated attribute names in JSON-RPC transport tests to reflect the config field.
  • client/transport/rest/src/main/java/io/a2a/client/transport/rest/RestTransport.java
    • Adjusted attribute names for push notification configuration access and parameter handling in REST transport methods.
  • client/transport/rest/src/test/java/io/a2a/client/transport/rest/RestTransportTest.java
    • Modified attribute names in REST transport tests to align with the new config field.
  • extras/opentelemetry/client/src/main/java/io/a2a/extras/opentelemetry/client/OpenTelemetryClientTransport.java
    • Updated attribute names for OpenTelemetry client transport to match the refactored spec.
  • extras/opentelemetry/server/src/main/java/io/a2a/extras/opentelemetry/OpenTelemetryRequestHandlerDecorator.java
    • Adjusted attribute names in OpenTelemetry server request handler decorator for consistency.
  • extras/push-notification-config-store-database-jpa/src/test/java/io/a2a/extras/pushnotificationconfigstore/database/jpa/JpaDatabasePushNotificationConfigStoreIntegrationTest.java
    • Refactored attribute names in JPA database push notification config store integration tests.
  • extras/push-notification-config-store-database-jpa/src/test/java/io/a2a/extras/pushnotificationconfigstore/database/jpa/JpaPushNotificationConfigStoreTest.java
    • Updated attribute names in JPA push notification config store unit tests.
  • server-common/src/main/java/io/a2a/server/requesthandlers/DefaultRequestHandler.java
    • Refactored attribute names in the default request handler.
    • Removed unused imports.
    • Adjusted getPushNotificationConfig method signature.
  • server-common/src/main/java/io/a2a/server/tasks/BasePushNotificationSender.java
    • Updated attribute name in the base push notification sender.
  • server-common/src/test/java/io/a2a/server/tasks/InMemoryPushNotificationConfigStoreTest.java
    • Modified attribute names in in-memory push notification config store tests.
  • spec-grpc/src/main/java/io/a2a/grpc/mapper/CreateTaskPushNotificationConfigMapper.java
    • Updated mapping logic to reflect the config attribute and removed redundant mappings.
  • spec-grpc/src/main/java/io/a2a/grpc/mapper/DeleteTaskPushNotificationConfigParamsMapper.java
    • Adjusted mapping for DeleteTaskPushNotificationConfigParams to align with new attribute names.
  • spec-grpc/src/main/java/io/a2a/grpc/mapper/GetTaskPushNotificationConfigParamsMapper.java
    • Modified mapping for GetTaskPushNotificationConfigParams to match the updated attribute names.
  • spec-grpc/src/main/java/io/a2a/grpc/mapper/TaskPushNotificationConfigMapper.java
    • Refactored mapping for TaskPushNotificationConfig to use the new config attribute.
  • spec-grpc/src/test/java/io/a2a/grpc/utils/JSONRPCUtilsTest.java
    • Updated attribute names in JSON-RPC utility tests.
  • spec-grpc/src/test/java/io/a2a/grpc/utils/ToProtoTest.java
    • Adjusted attribute names in ToProto utility tests for DeleteTaskPushNotificationConfigParams.
  • spec/src/main/java/io/a2a/spec/DeleteTaskPushNotificationConfigParams.java
    • Renamed parameters in DeleteTaskPushNotificationConfigParams for clarity and consistency.
  • spec/src/main/java/io/a2a/spec/GetTaskPushNotificationConfigParams.java
    • Renamed parameters in GetTaskPushNotificationConfigParams for clarity and consistency.
  • spec/src/main/java/io/a2a/spec/TaskPushNotificationConfig.java
    • Renamed the pushNotificationConfig field to config in TaskPushNotificationConfig.
  • spec/src/main/java/io/a2a/spec/TaskStatus.java
    • Added Javadoc to the timestamp() method.
  • spec/src/main/java/io/a2a/util/Utils.java
    • Added a private constructor to enforce utility class pattern.
  • tests/server-common/src/test/java/io/a2a/server/apps/common/AbstractA2AServerTest.java
    • Updated attribute names in abstract A2A server tests.
Activity
  • No specific activity has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request renames attributes across the codebase to align with changes in the a2a.proto specification, impacting transport layers, OpenTelemetry instrumentation, server-side handlers, and tests. A critical security vulnerability was identified in the REST transport layer, where methods in RestTransport.java construct URLs using user-supplied identifiers without proper URL encoding, potentially leading to path traversal or URL injection. It is recommended to apply URL encoding to these path parameters. Additionally, a minor formatting issue was noted in DefaultRequestHandler.java. The renames are otherwise consistently applied and align with the PR's goal.

builder.setId(configId).setTaskId(request.id());
url.append(String.format("/tasks/%1s/pushNotificationConfigs/%2s", request.id(), configId));
builder.setId(configId).setTaskId(request.taskId());
url.append(String.format("/tasks/%1s/pushNotificationConfigs/%2s", request.taskId(), configId));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-medium medium

The taskId and id (configId) parameters are used to construct a URL path without proper URL encoding. If these identifiers contain special characters such as /, ?, or #, it could lead to path traversal or malformed requests to the agent. It is recommended to URL-encode these parameters before including them in the URL string.

Suggested change
url.append(String.format("/tasks/%1s/pushNotificationConfigs/%2s", request.taskId(), configId));
url.append(String.format("/tasks/%1s/pushNotificationConfigs/%2s", URLEncoder.encode(request.taskId(), StandardCharsets.UTF_8), URLEncoder.encode(configId, StandardCharsets.UTF_8)));

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong as those aren't query parameters

builder.setTaskId(request.id());
url.append(String.format("/tasks/%1s/pushNotificationConfigs/", request.id()));
builder.setTaskId(request.taskId());
url.append(String.format("/tasks/%1s/pushNotificationConfigs/", request.taskId()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-medium medium

The taskId parameter is used to construct a URL path without proper URL encoding. This could lead to path traversal if the identifier contains characters like /. It is recommended to URL-encode the taskId before including it in the URL string.

Suggested change
url.append(String.format("/tasks/%1s/pushNotificationConfigs/", request.taskId()));
url.append(String.format("/tasks/%1s/pushNotificationConfigs/", URLEncoder.encode(request.taskId(), StandardCharsets.UTF_8)));

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong as those aren't query parameters

agentCard, context);
try {
String url = Utils.buildBaseUrl(agentInterface, request.tenant()) + String.format("/tasks/%1s/pushNotificationConfigs/%2s", request.id(), request.pushNotificationConfigId());
String url = Utils.buildBaseUrl(agentInterface, request.tenant()) + String.format("/tasks/%1s/pushNotificationConfigs/%2s", request.taskId(), request.id());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-medium medium

The taskId and id parameters are used to construct a URL path without proper URL encoding. This can lead to path traversal or malformed requests if these identifiers contain special characters. It is recommended to URL-encode these parameters before including them in the URL string.

Suggested change
String url = Utils.buildBaseUrl(agentInterface, request.tenant()) + String.format("/tasks/%1s/pushNotificationConfigs/%2s", request.taskId(), request.id());
String url = Utils.buildBaseUrl(agentInterface, request.tenant()) + String.format("/tasks/%1s/pushNotificationConfigs/%2s", URLEncoder.encode(request.taskId(), StandardCharsets.UTF_8), URLEncoder.encode(request.id(), StandardCharsets.UTF_8));

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong as those aren't query parameters

…s in the a2a.proto

- io.a2a.spec.TaskPushNotificationConfig
	 pushNotificationConfig to config
- io.a2a.spec.DeleteTaskPushNotificationConfigParams
	 id to taskId
	 and pushNotificationConfigId to id
- io.a2a.spec.GetTaskPushNotificationConfigParams
	 id to taskId
	 and pushNotificationConfigId to id
- io.a2a.spec.ListTaskPushNotificationConfigParam
	s taskId to id

Fixing issue a2aproject#634
Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename attributes in spec

2 participants