fix issue 3453: bridge ParamFlow and Authority rules to Nacos correctly (#3453) #3519
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.
This pull request fixes issue #3453 by ensuring that ParamFlow and Authority rules published by Sentinel‑Dashboard to Nacos can be correctly parsed by Sentinel clients. In version 1.8.8 the dashboard’s entity classes and the core rule classes became out of sync, causing clients to fail to deserialize JSON and never load the rules.
What was changed:
ParamFlowRuleCorrectEntity
AuthorityRuleCorrectEntity
These mirror the fields of the core
ParamFlowRule
andAuthorityRule
types exactly.NacosConfig
forString ↔ List<ParamFlowRuleCorrectEntity>
String ↔ List<AuthorityRuleCorrectEntity>
ParamFlowRuleNacosProvider
/ParamFlowRuleNacosPublisher
AuthorityRuleNacosProvider
/AuthorityRuleNacosPublisher
These bridge between the CorrectEntity JSON and the original Dashboard
RuleEntity
types viaBeanUtils.copyProperties
.Describe what this PR does / why we need it
Sentinel‑Dashboard and Sentinel clients must share a consistent JSON schema when persisting rules in Nacos. After upgrading to 1.8.8, the Dashboard’s entity definitions drifted from the core rule classes, breaking client‑side deserialization. This PR restores compatibility so that rules published via Dashboard are correctly loaded by any Sentinel client.
Does this pull request fix one issue?
Fixes #3453
Describe how you did it
NacosConfig
for the new entity lists.Describe how to verify it
Special notes for reviews
sentinel-dashboard
Nacos extension.Thank you for your time and feedback!