-
Notifications
You must be signed in to change notification settings - Fork 123
chore: Renaming attributes in spec modules to align with the new names #647
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -274,8 +274,8 @@ public TaskPushNotificationConfig createTaskPushNotificationConfiguration(TaskPu | |||||
| = io.a2a.grpc.CreateTaskPushNotificationConfigRequest.newBuilder(); | ||||||
| builder.setConfig(ProtoUtils.ToProto.taskPushNotificationConfig(request).getPushNotificationConfig()) | ||||||
| .setTaskId(request.taskId()); | ||||||
| if (request.pushNotificationConfig().id() != null) { | ||||||
| builder.setConfigId(request.pushNotificationConfig().id()); | ||||||
| if (request.config().id() != null) { | ||||||
| builder.setConfigId(request.config().id()); | ||||||
| } | ||||||
| PayloadAndHeaders payloadAndHeaders = applyInterceptors(SET_TASK_PUSH_NOTIFICATION_CONFIG_METHOD, builder, agentCard, context); | ||||||
| try { | ||||||
|
|
@@ -296,14 +296,14 @@ public TaskPushNotificationConfig getTaskPushNotificationConfiguration(GetTaskPu | |||||
| io.a2a.grpc.GetTaskPushNotificationConfigRequest.Builder builder | ||||||
| = io.a2a.grpc.GetTaskPushNotificationConfigRequest.newBuilder(); | ||||||
| StringBuilder url = new StringBuilder(Utils.buildBaseUrl(agentInterface, request.tenant())); | ||||||
| String configId = request.pushNotificationConfigId(); | ||||||
| String configId = request.id(); | ||||||
| if (configId != null && !configId.isEmpty()) { | ||||||
| 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)); | ||||||
| } else { | ||||||
| // Use trailing slash to distinguish GET from LIST | ||||||
| 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())); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is wrong as those aren't query parameters |
||||||
| } | ||||||
| PayloadAndHeaders payloadAndHeaders = applyInterceptors(GET_TASK_PUSH_NOTIFICATION_CONFIG_METHOD, builder, | ||||||
| agentCard, context); | ||||||
|
|
@@ -367,7 +367,7 @@ public void deleteTaskPushNotificationConfigurations(DeleteTaskPushNotificationC | |||||
| PayloadAndHeaders payloadAndHeaders = applyInterceptors(DELETE_TASK_PUSH_NOTIFICATION_CONFIG_METHOD, builder, | ||||||
| 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()); | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is wrong as those aren't query parameters |
||||||
| A2AHttpClient.DeleteBuilder deleteBuilder = httpClient.createDelete().url(url); | ||||||
| if (payloadAndHeaders.getHeaders() != null) { | ||||||
| for (Map.Entry<String, String> entry : payloadAndHeaders.getHeaders().entrySet()) { | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
taskIdandid(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.There was a problem hiding this comment.
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