Implement HMAC-based authentication fields in RegisterTMRequest with backward compatibility#10
Draft
Copilot wants to merge 4 commits into2.x_25_10_17_04from
Draft
Implement HMAC-based authentication fields in RegisterTMRequest with backward compatibility#10Copilot wants to merge 4 commits into2.x_25_10_17_04from
Copilot wants to merge 4 commits into2.x_25_10_17_04from
Conversation
Co-authored-by: slievrly <8758457+slievrly@users.noreply.github.com>
…patibility Co-authored-by: slievrly <8758457+slievrly@users.noreply.github.com>
…nd documentation Co-authored-by: slievrly <8758457+slievrly@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add HMAC-based authentication for RegisterTMRequest
Implement HMAC-based authentication fields in RegisterTMRequest with backward compatibility
Oct 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements HMAC-based authentication for the
RegisterTMRequestmessage by extending it with dedicated authentication fields, while ensuring full backward compatibility with older client and server versions.Problem
Previously, HMAC authentication data (access key, digest, timestamp, auth version) was only stored in the
extraDatafield as a string. This approach has limitations:Solution
Added four dedicated fields to
RegisterTMRequest:accessKey(String): Access key for authenticationdigest(String): HMAC digest generated from request datatimestamp(Long): Timestamp when the request was createdauthVersion(String): Authentication algorithm version (e.g., "V4")Implementation Details
1. Core Protocol Extensions
RegisterTMRequestwith standard getters/setters2. Codec Changes (Seata Serializer)
RegisterTMRequestCodecto encode/decode new fields3. Protobuf Serializer Updates
.protodefinition with new fields (IDs 2-5)RegisterTMRequestConvertorto handle field conversion4. Client Integration
TmNettyRemotingClient.getPoolKeyFunction()to populate HMAC fieldsextraDatafunctionality for legacy supportBackward Compatibility
The implementation ensures seamless interoperability across versions:
Key compatibility mechanisms:
extraDatafield continues to work for legacy clientsTesting
Added comprehensive tests covering:
Test files:
RegisterTMRequestSerializerTest: Tests for Seata codecRegisterTMRequestConvertorTest: Tests for Protobuf convertorChanges Summary
RegisterRMRequestDocumentation
Added
HMAC_AUTHENTICATION_IMPLEMENTATION.mddocumenting:Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
httpbin.orgregistry.npmmirror.comnpm install(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)/usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.11/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.11/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.11 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.11/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/fescar/fescar org.codehaus.plexus.classworlds.launcher.Launcher clean install -DskipTests -T 4 -q(dns block)repository.apache.org/usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.11/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.11/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.11 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.11/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/fescar/fescar org.codehaus.plexus.classworlds.launcher.Launcher test -pl core -Dtest=RegisterTMRequestTest -q(dns block)seata.iowww.apache.orgIf you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.