You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/10/20 11:43:27 UTC
[GitHub] [shardingsphere] totalo opened a new pull request #13180: Support table level `queryWithCipherColumn` configuration
totalo opened a new pull request #13180:
URL: https://github.com/apache/shardingsphere/pull/13180
Fixes #13125.
Changes proposed in this pull request:
- Support table level `queryWithCipherColumn` configuration
- update doc for table level `queryWithCipherColumn` configuration
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] totalo commented on pull request #13180: Support table level `queryWithCipherColumn` configuration
Posted by GitBox <gi...@apache.org>.
totalo commented on pull request #13180:
URL: https://github.com/apache/shardingsphere/pull/13180#issuecomment-947747330
> Hi @totalo, Could the `queryWithCipherColumn` be inherited and overrided if it is set at the global?
I think the configuration of the table itself should not be overridden globally. If there is no configuration, follow the global configuration.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] totalo commented on a change in pull request #13180: Support table level `queryWithCipherColumn` configuration
Posted by GitBox <gi...@apache.org>.
totalo commented on a change in pull request #13180:
URL: https://github.com/apache/shardingsphere/pull/13180#discussion_r735259481
##########
File path: shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rule/EncryptRule.java
##########
@@ -242,6 +247,24 @@ public String getCipherColumn(final String logicTable, final String logicColumn)
Optional<String> originColumnName = findOriginColumnName(logicTable, logicColumn);
return originColumnName.isPresent() && tables.containsKey(logicTable) ? tables.get(logicTable).findPlainColumn(originColumnName.get()) : Optional.empty();
}
+
+ /**
+ * Check the table is support QueryWithCipherColumn.
Review comment:
done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] codecov-commenter edited a comment on pull request #13180: Support table level `queryWithCipherColumn` configuration
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #13180:
URL: https://github.com/apache/shardingsphere/pull/13180#issuecomment-948204534
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#13180](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a20664b) into [master](https://codecov.io/gh/apache/shardingsphere/commit/3f6729997d64628ca65fa84ee7aa9cf22fedaee4?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3f67299) will **decrease** coverage by `0.00%`.
> The diff coverage is `31.57%`.
[](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #13180 +/- ##
============================================
- Coverage 62.98% 62.97% -0.01%
Complexity 1399 1399
============================================
Files 2558 2558
Lines 38268 38281 +13
Branches 6577 6580 +3
============================================
+ Hits 24102 24108 +6
- Misses 12273 12280 +7
Partials 1893 1893
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...ite/context/EncryptSQLRewriteContextDecorator.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvcmV3cml0ZS9jb250ZXh0L0VuY3J5cHRTUUxSZXdyaXRlQ29udGV4dERlY29yYXRvci5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...tor/impl/EncryptPredicateColumnTokenGenerator.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvcmV3cml0ZS90b2tlbi9nZW5lcmF0b3IvaW1wbC9FbmNyeXB0UHJlZGljYXRlQ29sdW1uVG9rZW5HZW5lcmF0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | |
| [...pache/shardingsphere/encrypt/rule/EncryptRule.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvcnVsZS9FbmNyeXB0UnVsZS5qYXZh) | `70.66% <0.00%> (-8.44%)` | :arrow_down: |
| [...config/rule/YamlEncryptTableRuleConfiguration.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQveWFtbC9jb25maWcvcnVsZS9ZYW1sRW5jcnlwdFRhYmxlUnVsZUNvbmZpZ3VyYXRpb24uamF2YQ==) | `100.00% <ø> (ø)` | |
| [...ql/parser/core/EncryptDistSQLStatementVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWRpc3RzcWwvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC1kaXN0c3FsLXBhcnNlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvZW5jcnlwdC9kaXN0c3FsL3BhcnNlci9jb3JlL0VuY3J5cHREaXN0U1FMU3RhdGVtZW50VmlzaXRvci5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...re/encrypt/merge/EncryptResultDecoratorEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvbWVyZ2UvRW5jcnlwdFJlc3VsdERlY29yYXRvckVuZ2luZS5qYXZh) | `100.00% <100.00%> (ø)` | |
| [...ache/shardingsphere/encrypt/rule/EncryptTable.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvcnVsZS9FbmNyeXB0VGFibGUuamF2YQ==) | `96.77% <100.00%> (+0.10%)` | :arrow_up: |
| [...rule/EncryptTableRuleConfigurationYamlSwapper.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQveWFtbC9zd2FwcGVyL3J1bGUvRW5jcnlwdFRhYmxlUnVsZUNvbmZpZ3VyYXRpb25ZYW1sU3dhcHBlci5qYXZh) | `100.00% <100.00%> (ø)` | |
| [...ndler/converter/EncryptRuleStatementConverter.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWRpc3RzcWwvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC1kaXN0c3FsLWhhbmRsZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvZGlzdHNxbC9oYW5kbGVyL2NvbnZlcnRlci9FbmNyeXB0UnVsZVN0YXRlbWVudENvbnZlcnRlci5qYXZh) | `94.73% <100.00%> (ø)` | |
| [...espace/parser/EncryptRuleBeanDefinitionParser.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LXNwcmluZy9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LXNwcmluZy1uYW1lc3BhY2Uvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvc3ByaW5nL25hbWVzcGFjZS9wYXJzZXIvRW5jcnlwdFJ1bGVCZWFuRGVmaW5pdGlvblBhcnNlci5qYXZh) | `100.00% <100.00%> (ø)` | |
| ... and [1 more](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [3f67299...a20664b](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] totalo commented on a change in pull request #13180: Support table level `queryWithCipherColumn` configuration
Posted by GitBox <gi...@apache.org>.
totalo commented on a change in pull request #13180:
URL: https://github.com/apache/shardingsphere/pull/13180#discussion_r735459207
##########
File path: shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-api/src/main/java/org/apache/shardingsphere/encrypt/api/config/rule/EncryptTableRuleConfiguration.java
##########
@@ -32,4 +32,6 @@
private final String name;
private final Collection<EncryptColumnRuleConfiguration> columns;
+
+ private final Boolean queryWithCipherColumn;
Review comment:
Yes, this should be more of a coding consideration. Maybe we shouldn't destroy the scene in order to avoid this problem. If there is a default value, I think it will be more troublesome to configure it, right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] codecov-commenter commented on pull request #13180: Support table level `queryWithCipherColumn` configuration
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #13180:
URL: https://github.com/apache/shardingsphere/pull/13180#issuecomment-948204534
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#13180](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (449f8a4) into [master](https://codecov.io/gh/apache/shardingsphere/commit/80c540c596d101d82e72e3b3a43b84659510f408?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (80c540c) will **decrease** coverage by `0.01%`.
> The diff coverage is `36.00%`.
[](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #13180 +/- ##
============================================
- Coverage 63.27% 63.25% -0.02%
Complexity 1390 1390
============================================
Files 2542 2542
Lines 38000 38019 +19
Branches 6536 6540 +4
============================================
+ Hits 24043 24049 +6
- Misses 12059 12071 +12
- Partials 1898 1899 +1
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...ite/context/EncryptSQLRewriteContextDecorator.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvcmV3cml0ZS9jb250ZXh0L0VuY3J5cHRTUUxSZXdyaXRlQ29udGV4dERlY29yYXRvci5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...tor/impl/EncryptPredicateColumnTokenGenerator.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvcmV3cml0ZS90b2tlbi9nZW5lcmF0b3IvaW1wbC9FbmNyeXB0UHJlZGljYXRlQ29sdW1uVG9rZW5HZW5lcmF0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | |
| [...pache/shardingsphere/encrypt/rule/EncryptRule.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvcnVsZS9FbmNyeXB0UnVsZS5qYXZh) | `74.64% <0.00%> (-4.46%)` | :arrow_down: |
| [...config/rule/YamlEncryptTableRuleConfiguration.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQveWFtbC9jb25maWcvcnVsZS9ZYW1sRW5jcnlwdFRhYmxlUnVsZUNvbmZpZ3VyYXRpb24uamF2YQ==) | `100.00% <ø> (ø)` | |
| [...ql/parser/core/EncryptDistSQLStatementVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWRpc3RzcWwvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC1kaXN0c3FsLXBhcnNlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvZW5jcnlwdC9kaXN0c3FsL3BhcnNlci9jb3JlL0VuY3J5cHREaXN0U1FMU3RhdGVtZW50VmlzaXRvci5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...re/encrypt/merge/EncryptResultDecoratorEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvbWVyZ2UvRW5jcnlwdFJlc3VsdERlY29yYXRvckVuZ2luZS5qYXZh) | `85.71% <66.66%> (-14.29%)` | :arrow_down: |
| [...ache/shardingsphere/encrypt/rule/EncryptTable.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvcnVsZS9FbmNyeXB0VGFibGUuamF2YQ==) | `96.77% <100.00%> (+0.10%)` | :arrow_up: |
| [...rule/EncryptTableRuleConfigurationYamlSwapper.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQveWFtbC9zd2FwcGVyL3J1bGUvRW5jcnlwdFRhYmxlUnVsZUNvbmZpZ3VyYXRpb25ZYW1sU3dhcHBlci5qYXZh) | `100.00% <100.00%> (ø)` | |
| [...ndler/converter/EncryptRuleStatementConverter.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWRpc3RzcWwvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC1kaXN0c3FsLWhhbmRsZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvZGlzdHNxbC9oYW5kbGVyL2NvbnZlcnRlci9FbmNyeXB0UnVsZVN0YXRlbWVudENvbnZlcnRlci5qYXZh) | `94.73% <100.00%> (ø)` | |
| [...espace/parser/EncryptRuleBeanDefinitionParser.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LXNwcmluZy9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LXNwcmluZy1uYW1lc3BhY2Uvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvc3ByaW5nL25hbWVzcGFjZS9wYXJzZXIvRW5jcnlwdFJ1bGVCZWFuRGVmaW5pdGlvblBhcnNlci5qYXZh) | `100.00% <100.00%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [80c540c...449f8a4](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] codecov-commenter edited a comment on pull request #13180: Support table level `queryWithCipherColumn` configuration
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #13180:
URL: https://github.com/apache/shardingsphere/pull/13180#issuecomment-948204534
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#13180](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (2d8c04a) into [master](https://codecov.io/gh/apache/shardingsphere/commit/f2e6de015b282b983f22b4f9fc4cb860d4d247e8?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f2e6de0) will **decrease** coverage by `0.05%`.
> The diff coverage is `30.00%`.
> :exclamation: Current head 2d8c04a differs from pull request most recent head ee8e2c2. Consider uploading reports for the commit ee8e2c2 to get more accurate results
[](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #13180 +/- ##
============================================
- Coverage 62.96% 62.91% -0.06%
Complexity 1406 1406
============================================
Files 2567 2567
Lines 38429 38443 +14
Branches 6598 6601 +3
============================================
- Hits 24198 24185 -13
- Misses 12328 12356 +28
+ Partials 1903 1902 -1
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...ite/context/EncryptSQLRewriteContextDecorator.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvcmV3cml0ZS9jb250ZXh0L0VuY3J5cHRTUUxSZXdyaXRlQ29udGV4dERlY29yYXRvci5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...tor/impl/EncryptPredicateColumnTokenGenerator.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvcmV3cml0ZS90b2tlbi9nZW5lcmF0b3IvaW1wbC9FbmNyeXB0UHJlZGljYXRlQ29sdW1uVG9rZW5HZW5lcmF0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | |
| [...pache/shardingsphere/encrypt/rule/EncryptRule.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvcnVsZS9FbmNyeXB0UnVsZS5qYXZh) | `69.73% <0.00%> (-9.37%)` | :arrow_down: |
| [...config/rule/YamlEncryptTableRuleConfiguration.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQveWFtbC9jb25maWcvcnVsZS9ZYW1sRW5jcnlwdFRhYmxlUnVsZUNvbmZpZ3VyYXRpb24uamF2YQ==) | `100.00% <ø> (ø)` | |
| [...ql/parser/core/EncryptDistSQLStatementVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWRpc3RzcWwvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC1kaXN0c3FsLXBhcnNlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvZW5jcnlwdC9kaXN0c3FsL3BhcnNlci9jb3JlL0VuY3J5cHREaXN0U1FMU3RhdGVtZW50VmlzaXRvci5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...re/encrypt/merge/EncryptResultDecoratorEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvbWVyZ2UvRW5jcnlwdFJlc3VsdERlY29yYXRvckVuZ2luZS5qYXZh) | `100.00% <100.00%> (ø)` | |
| [...ache/shardingsphere/encrypt/rule/EncryptTable.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvcnVsZS9FbmNyeXB0VGFibGUuamF2YQ==) | `96.77% <100.00%> (+0.10%)` | :arrow_up: |
| [...rule/EncryptTableRuleConfigurationYamlSwapper.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQveWFtbC9zd2FwcGVyL3J1bGUvRW5jcnlwdFRhYmxlUnVsZUNvbmZpZ3VyYXRpb25ZYW1sU3dhcHBlci5qYXZh) | `100.00% <100.00%> (ø)` | |
| [...ndler/converter/EncryptRuleStatementConverter.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWRpc3RzcWwvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC1kaXN0c3FsLWhhbmRsZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvZGlzdHNxbC9oYW5kbGVyL2NvbnZlcnRlci9FbmNyeXB0UnVsZVN0YXRlbWVudENvbnZlcnRlci5qYXZh) | `94.73% <100.00%> (ø)` | |
| [...espace/parser/EncryptRuleBeanDefinitionParser.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LXNwcmluZy9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LXNwcmluZy1uYW1lc3BhY2Uvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvc3ByaW5nL25hbWVzcGFjZS9wYXJzZXIvRW5jcnlwdFJ1bGVCZWFuRGVmaW5pdGlvblBhcnNlci5qYXZh) | `100.00% <100.00%> (ø)` | |
| ... and [5 more](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [f2e6de0...ee8e2c2](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] strongduanmu commented on a change in pull request #13180: Support table level `queryWithCipherColumn` configuration
Posted by GitBox <gi...@apache.org>.
strongduanmu commented on a change in pull request #13180:
URL: https://github.com/apache/shardingsphere/pull/13180#discussion_r735467361
##########
File path: shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-api/src/main/java/org/apache/shardingsphere/encrypt/api/config/rule/EncryptTableRuleConfiguration.java
##########
@@ -32,4 +32,6 @@
private final String name;
private final Collection<EncryptColumnRuleConfiguration> columns;
+
+ private final Boolean queryWithCipherColumn;
Review comment:
Yes, the default value of the table level will make it more troublesome for users to use. 😀
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] strongduanmu commented on a change in pull request #13180: Support table level `queryWithCipherColumn` configuration
Posted by GitBox <gi...@apache.org>.
strongduanmu commented on a change in pull request #13180:
URL: https://github.com/apache/shardingsphere/pull/13180#discussion_r735207968
##########
File path: docs/document/content/user-manual/shardingsphere-jdbc/configuration/spring-namespace/encrypt.cn.md
##########
@@ -17,10 +17,11 @@ weight = 3
\<encrypt:table />
-| *名称* | *类型* | *说明* |
-| ---------- | ----- | -------- |
-| name | 属性 | 加密表名称 |
-| column (+) | 标签 | 加密列配置 |
+| *名称* | *类型* | *说明* |
+| ------------------------ | ------ | ---------------------------------------------------------- |
+| name | 属性 | 加密表名称 |
+| column (+) | 标签 | 加密列配置 |
+| queryWithCipherColumn(?) | 属性 | 该表是否使用加密列进行查询。在有原文列的情况下,可以使用原文列进行查询 |
Review comment:
@totalo Should this attribute be `query-with-cipher-column`?
##########
File path: shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rule/EncryptRule.java
##########
@@ -242,6 +247,24 @@ public String getCipherColumn(final String logicTable, final String logicColumn)
Optional<String> originColumnName = findOriginColumnName(logicTable, logicColumn);
return originColumnName.isPresent() && tables.containsKey(logicTable) ? tables.get(logicTable).findPlainColumn(originColumnName.get()) : Optional.empty();
}
+
+ /**
+ * Check the table is support QueryWithCipherColumn.
Review comment:
@totalo Please add a line after the description, you can refer to other java doc writing.
##########
File path: shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rule/EncryptRule.java
##########
@@ -242,6 +247,24 @@ public String getCipherColumn(final String logicTable, final String logicColumn)
Optional<String> originColumnName = findOriginColumnName(logicTable, logicColumn);
return originColumnName.isPresent() && tables.containsKey(logicTable) ? tables.get(logicTable).findPlainColumn(originColumnName.get()) : Optional.empty();
}
+
+ /**
+ * Check the table is support QueryWithCipherColumn.
+ * @param sqlStatementContext sqlStatementContext
+ * @return isQueryWithCipherColumn
+ */
+ public boolean isQueryWithCipherColumn(final SQLStatementContext<?> sqlStatementContext) {
+ Collection<SimpleTableSegment> simpleTables = sqlStatementContext instanceof SelectStatementContext
+ ? ((TableAvailable) sqlStatementContext).getAllTables()
+ : Collections.emptyList();
+ if (CollectionUtils.isNotEmpty(simpleTables)) {
+ String tableName = simpleTables.iterator().next().getTableName().getIdentifier().getValue();
+ if (tables.containsKey(tableName) && tables.get(tableName).getQueryWithCipherColumn() != null) {
+ return tables.get(tableName).getQueryWithCipherColumn();
+ }
+ }
+ return queryWithCipherColumn;
Review comment:
Please rename `queryWithCipherColumn` to `result`.
##########
File path: shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rule/EncryptRule.java
##########
@@ -242,6 +247,24 @@ public String getCipherColumn(final String logicTable, final String logicColumn)
Optional<String> originColumnName = findOriginColumnName(logicTable, logicColumn);
return originColumnName.isPresent() && tables.containsKey(logicTable) ? tables.get(logicTable).findPlainColumn(originColumnName.get()) : Optional.empty();
}
+
+ /**
+ * Check the table is support QueryWithCipherColumn.
+ * @param sqlStatementContext sqlStatementContext
+ * @return isQueryWithCipherColumn
+ */
+ public boolean isQueryWithCipherColumn(final SQLStatementContext<?> sqlStatementContext) {
+ Collection<SimpleTableSegment> simpleTables = sqlStatementContext instanceof SelectStatementContext
+ ? ((TableAvailable) sqlStatementContext).getAllTables()
+ : Collections.emptyList();
+ if (CollectionUtils.isNotEmpty(simpleTables)) {
Review comment:
@totalo `if (!simpleTables.isEmpty())` may be better?
##########
File path: shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/impl/EncryptPredicateColumnTokenGenerator.java
##########
@@ -83,7 +83,8 @@ protected boolean isGenerateSQLTokenForEncrypt(final SQLStatementContext sqlStat
}
int startIndex = column.getOwner().isPresent() ? column.getOwner().get().getStopIndex() + 2 : column.getStartIndex();
int stopIndex = column.getStopIndex();
- if (!queryWithCipherColumn) {
+ EncryptTable table = encryptTable.get();
+ if ((table.getQueryWithCipherColumn() != null && !table.getQueryWithCipherColumn()) || !queryWithCipherColumn) {
Review comment:
@totalo Please put null on the left side of the expression.
##########
File path: shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-api/src/main/java/org/apache/shardingsphere/encrypt/api/config/rule/EncryptTableRuleConfiguration.java
##########
@@ -32,4 +32,6 @@
private final String name;
private final Collection<EncryptColumnRuleConfiguration> columns;
+
+ private final Boolean queryWithCipherColumn;
Review comment:
@totalo Can we use boolean type instead of Boolean? If the user does not configure this attribute, we expect a default value instead of null.
##########
File path: shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-distsql/shardingsphere-encrypt-distsql-statement/src/main/java/org/apache/shardingsphere/encrypt/distsql/parser/segment/EncryptRuleSegment.java
##########
@@ -33,4 +33,6 @@
private final String tableName;
private final Collection<EncryptColumnSegment> columns;
+
+ private final Boolean queryWithCipherColumn;
Review comment:
@totalo Can we replace this Boolean type with boolean?
##########
File path: shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rule/EncryptRule.java
##########
@@ -242,6 +247,24 @@ public String getCipherColumn(final String logicTable, final String logicColumn)
Optional<String> originColumnName = findOriginColumnName(logicTable, logicColumn);
return originColumnName.isPresent() && tables.containsKey(logicTable) ? tables.get(logicTable).findPlainColumn(originColumnName.get()) : Optional.empty();
}
+
+ /**
+ * Check the table is support QueryWithCipherColumn.
+ * @param sqlStatementContext sqlStatementContext
+ * @return isQueryWithCipherColumn
+ */
+ public boolean isQueryWithCipherColumn(final SQLStatementContext<?> sqlStatementContext) {
+ Collection<SimpleTableSegment> simpleTables = sqlStatementContext instanceof SelectStatementContext
+ ? ((TableAvailable) sqlStatementContext).getAllTables()
+ : Collections.emptyList();
+ if (CollectionUtils.isNotEmpty(simpleTables)) {
+ String tableName = simpleTables.iterator().next().getTableName().getIdentifier().getValue();
+ if (tables.containsKey(tableName) && tables.get(tableName).getQueryWithCipherColumn() != null) {
Review comment:
Please put null on the left side of the conditional expression.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] strongduanmu commented on pull request #13180: Support table level `queryWithCipherColumn` configuration
Posted by GitBox <gi...@apache.org>.
strongduanmu commented on pull request #13180:
URL: https://github.com/apache/shardingsphere/pull/13180#issuecomment-949629160
> hi @strongduanmu, Can you help review it?
@totalo Thank you for your contribution, I will review this pr later.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] totalo commented on a change in pull request #13180: Support table level `queryWithCipherColumn` configuration
Posted by GitBox <gi...@apache.org>.
totalo commented on a change in pull request #13180:
URL: https://github.com/apache/shardingsphere/pull/13180#discussion_r735258871
##########
File path: shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rule/EncryptRule.java
##########
@@ -242,6 +247,24 @@ public String getCipherColumn(final String logicTable, final String logicColumn)
Optional<String> originColumnName = findOriginColumnName(logicTable, logicColumn);
return originColumnName.isPresent() && tables.containsKey(logicTable) ? tables.get(logicTable).findPlainColumn(originColumnName.get()) : Optional.empty();
}
+
+ /**
+ * Check the table is support QueryWithCipherColumn.
+ * @param sqlStatementContext sqlStatementContext
+ * @return isQueryWithCipherColumn
+ */
+ public boolean isQueryWithCipherColumn(final SQLStatementContext<?> sqlStatementContext) {
+ Collection<SimpleTableSegment> simpleTables = sqlStatementContext instanceof SelectStatementContext
+ ? ((TableAvailable) sqlStatementContext).getAllTables()
+ : Collections.emptyList();
+ if (CollectionUtils.isNotEmpty(simpleTables)) {
+ String tableName = simpleTables.iterator().next().getTableName().getIdentifier().getValue();
+ if (tables.containsKey(tableName) && tables.get(tableName).getQueryWithCipherColumn() != null) {
Review comment:
done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] codecov-commenter edited a comment on pull request #13180: Support table level `queryWithCipherColumn` configuration
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #13180:
URL: https://github.com/apache/shardingsphere/pull/13180#issuecomment-948204534
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#13180](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (ee8e2c2) into [master](https://codecov.io/gh/apache/shardingsphere/commit/f2e6de015b282b983f22b4f9fc4cb860d4d247e8?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f2e6de0) will **decrease** coverage by `0.01%`.
> The diff coverage is `30.00%`.
[](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #13180 +/- ##
============================================
- Coverage 62.96% 62.95% -0.02%
Complexity 1406 1406
============================================
Files 2567 2567
Lines 38429 38443 +14
Branches 6598 6601 +3
============================================
+ Hits 24198 24201 +3
- Misses 12328 12339 +11
Partials 1903 1903
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...ite/context/EncryptSQLRewriteContextDecorator.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvcmV3cml0ZS9jb250ZXh0L0VuY3J5cHRTUUxSZXdyaXRlQ29udGV4dERlY29yYXRvci5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...tor/impl/EncryptPredicateColumnTokenGenerator.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvcmV3cml0ZS90b2tlbi9nZW5lcmF0b3IvaW1wbC9FbmNyeXB0UHJlZGljYXRlQ29sdW1uVG9rZW5HZW5lcmF0b3IuamF2YQ==) | `0.00% <0.00%> (ø)` | |
| [...pache/shardingsphere/encrypt/rule/EncryptRule.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvcnVsZS9FbmNyeXB0UnVsZS5qYXZh) | `69.73% <0.00%> (-9.37%)` | :arrow_down: |
| [...config/rule/YamlEncryptTableRuleConfiguration.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQveWFtbC9jb25maWcvcnVsZS9ZYW1sRW5jcnlwdFRhYmxlUnVsZUNvbmZpZ3VyYXRpb24uamF2YQ==) | `100.00% <ø> (ø)` | |
| [...ql/parser/core/EncryptDistSQLStatementVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWRpc3RzcWwvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC1kaXN0c3FsLXBhcnNlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvZW5jcnlwdC9kaXN0c3FsL3BhcnNlci9jb3JlL0VuY3J5cHREaXN0U1FMU3RhdGVtZW50VmlzaXRvci5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...re/encrypt/merge/EncryptResultDecoratorEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvbWVyZ2UvRW5jcnlwdFJlc3VsdERlY29yYXRvckVuZ2luZS5qYXZh) | `100.00% <100.00%> (ø)` | |
| [...ache/shardingsphere/encrypt/rule/EncryptTable.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvcnVsZS9FbmNyeXB0VGFibGUuamF2YQ==) | `96.77% <100.00%> (+0.10%)` | :arrow_up: |
| [...rule/EncryptTableRuleConfigurationYamlSwapper.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQveWFtbC9zd2FwcGVyL3J1bGUvRW5jcnlwdFRhYmxlUnVsZUNvbmZpZ3VyYXRpb25ZYW1sU3dhcHBlci5qYXZh) | `100.00% <100.00%> (ø)` | |
| [...ndler/converter/EncryptRuleStatementConverter.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LWRpc3RzcWwvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC1kaXN0c3FsLWhhbmRsZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvZGlzdHNxbC9oYW5kbGVyL2NvbnZlcnRlci9FbmNyeXB0UnVsZVN0YXRlbWVudENvbnZlcnRlci5qYXZh) | `94.73% <100.00%> (ø)` | |
| [...espace/parser/EncryptRuleBeanDefinitionParser.java](https://codecov.io/gh/apache/shardingsphere/pull/13180/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZW5jcnlwdC9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LXNwcmluZy9zaGFyZGluZ3NwaGVyZS1lbmNyeXB0LXNwcmluZy1uYW1lc3BhY2Uvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2VuY3J5cHQvc3ByaW5nL25hbWVzcGFjZS9wYXJzZXIvRW5jcnlwdFJ1bGVCZWFuRGVmaW5pdGlvblBhcnNlci5qYXZh) | `100.00% <100.00%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [f2e6de0...ee8e2c2](https://codecov.io/gh/apache/shardingsphere/pull/13180?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] totalo commented on a change in pull request #13180: Support table level `queryWithCipherColumn` configuration
Posted by GitBox <gi...@apache.org>.
totalo commented on a change in pull request #13180:
URL: https://github.com/apache/shardingsphere/pull/13180#discussion_r735258714
##########
File path: docs/document/content/user-manual/shardingsphere-jdbc/configuration/spring-namespace/encrypt.cn.md
##########
@@ -17,10 +17,11 @@ weight = 3
\<encrypt:table />
-| *名称* | *类型* | *说明* |
-| ---------- | ----- | -------- |
-| name | 属性 | 加密表名称 |
-| column (+) | 标签 | 加密列配置 |
+| *名称* | *类型* | *说明* |
+| ------------------------ | ------ | ---------------------------------------------------------- |
+| name | 属性 | 加密表名称 |
+| column (+) | 标签 | 加密列配置 |
+| queryWithCipherColumn(?) | 属性 | 该表是否使用加密列进行查询。在有原文列的情况下,可以使用原文列进行查询 |
Review comment:
yes, done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] totalo commented on pull request #13180: Support table level `queryWithCipherColumn` configuration
Posted by GitBox <gi...@apache.org>.
totalo commented on pull request #13180:
URL: https://github.com/apache/shardingsphere/pull/13180#issuecomment-949611911
hi @strongduanmu, Can you help review it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] totalo commented on a change in pull request #13180: Support table level `queryWithCipherColumn` configuration
Posted by GitBox <gi...@apache.org>.
totalo commented on a change in pull request #13180:
URL: https://github.com/apache/shardingsphere/pull/13180#discussion_r735254594
##########
File path: shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-api/src/main/java/org/apache/shardingsphere/encrypt/api/config/rule/EncryptTableRuleConfiguration.java
##########
@@ -32,4 +32,6 @@
private final String name;
private final Collection<EncryptColumnRuleConfiguration> columns;
+
+ private final Boolean queryWithCipherColumn;
Review comment:
In this scenario, I think null may be more appropriate. If it has a default value, the configuration may be troublesome in some special scenarios. For example, the default value is `true`, but we want to configure all tables not to be queried through encrypted columns. . I think the global configuration can have a default value, but this field of the single table can be empty, what do you think?
##########
File path: shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-api/src/main/java/org/apache/shardingsphere/encrypt/api/config/rule/EncryptTableRuleConfiguration.java
##########
@@ -32,4 +32,6 @@
private final String name;
private final Collection<EncryptColumnRuleConfiguration> columns;
+
+ private final Boolean queryWithCipherColumn;
Review comment:
In this scenario, I think `null` may be more appropriate. If it has a default value, the configuration may be troublesome in some special scenarios. For example, the default value is `true`, but we want to configure all tables not to be queried through encrypted columns. . I think the global configuration can have a default value, but this field of the single table can be empty, what do you think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] cheese8 commented on pull request #13180: Support table level `queryWithCipherColumn` configuration
Posted by GitBox <gi...@apache.org>.
cheese8 commented on pull request #13180:
URL: https://github.com/apache/shardingsphere/pull/13180#issuecomment-947708352
Hi @totalo, Could the `queryWithCipherColumn` be inherited and overrided if it is set at the global?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] totalo commented on a change in pull request #13180: Support table level `queryWithCipherColumn` configuration
Posted by GitBox <gi...@apache.org>.
totalo commented on a change in pull request #13180:
URL: https://github.com/apache/shardingsphere/pull/13180#discussion_r735258754
##########
File path: shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rewrite/token/generator/impl/EncryptPredicateColumnTokenGenerator.java
##########
@@ -83,7 +83,8 @@ protected boolean isGenerateSQLTokenForEncrypt(final SQLStatementContext sqlStat
}
int startIndex = column.getOwner().isPresent() ? column.getOwner().get().getStopIndex() + 2 : column.getStartIndex();
int stopIndex = column.getStopIndex();
- if (!queryWithCipherColumn) {
+ EncryptTable table = encryptTable.get();
+ if ((table.getQueryWithCipherColumn() != null && !table.getQueryWithCipherColumn()) || !queryWithCipherColumn) {
Review comment:
done.
##########
File path: shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rule/EncryptRule.java
##########
@@ -242,6 +247,24 @@ public String getCipherColumn(final String logicTable, final String logicColumn)
Optional<String> originColumnName = findOriginColumnName(logicTable, logicColumn);
return originColumnName.isPresent() && tables.containsKey(logicTable) ? tables.get(logicTable).findPlainColumn(originColumnName.get()) : Optional.empty();
}
+
+ /**
+ * Check the table is support QueryWithCipherColumn.
+ * @param sqlStatementContext sqlStatementContext
+ * @return isQueryWithCipherColumn
+ */
+ public boolean isQueryWithCipherColumn(final SQLStatementContext<?> sqlStatementContext) {
+ Collection<SimpleTableSegment> simpleTables = sqlStatementContext instanceof SelectStatementContext
+ ? ((TableAvailable) sqlStatementContext).getAllTables()
+ : Collections.emptyList();
+ if (CollectionUtils.isNotEmpty(simpleTables)) {
Review comment:
yes, thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] totalo commented on a change in pull request #13180: Support table level `queryWithCipherColumn` configuration
Posted by GitBox <gi...@apache.org>.
totalo commented on a change in pull request #13180:
URL: https://github.com/apache/shardingsphere/pull/13180#discussion_r735264085
##########
File path: shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-core/src/main/java/org/apache/shardingsphere/encrypt/rule/EncryptRule.java
##########
@@ -242,6 +247,24 @@ public String getCipherColumn(final String logicTable, final String logicColumn)
Optional<String> originColumnName = findOriginColumnName(logicTable, logicColumn);
return originColumnName.isPresent() && tables.containsKey(logicTable) ? tables.get(logicTable).findPlainColumn(originColumnName.get()) : Optional.empty();
}
+
+ /**
+ * Check the table is support QueryWithCipherColumn.
+ * @param sqlStatementContext sqlStatementContext
+ * @return isQueryWithCipherColumn
+ */
+ public boolean isQueryWithCipherColumn(final SQLStatementContext<?> sqlStatementContext) {
+ Collection<SimpleTableSegment> simpleTables = sqlStatementContext instanceof SelectStatementContext
+ ? ((TableAvailable) sqlStatementContext).getAllTables()
+ : Collections.emptyList();
+ if (CollectionUtils.isNotEmpty(simpleTables)) {
+ String tableName = simpleTables.iterator().next().getTableName().getIdentifier().getValue();
+ if (tables.containsKey(tableName) && tables.get(tableName).getQueryWithCipherColumn() != null) {
+ return tables.get(tableName).getQueryWithCipherColumn();
+ }
+ }
+ return queryWithCipherColumn;
Review comment:
done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] tristaZero merged pull request #13180: Support table level `queryWithCipherColumn` configuration
Posted by GitBox <gi...@apache.org>.
tristaZero merged pull request #13180:
URL: https://github.com/apache/shardingsphere/pull/13180
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] strongduanmu commented on a change in pull request #13180: Support table level `queryWithCipherColumn` configuration
Posted by GitBox <gi...@apache.org>.
strongduanmu commented on a change in pull request #13180:
URL: https://github.com/apache/shardingsphere/pull/13180#discussion_r735454504
##########
File path: shardingsphere-features/shardingsphere-encrypt/shardingsphere-encrypt-api/src/main/java/org/apache/shardingsphere/encrypt/api/config/rule/EncryptTableRuleConfiguration.java
##########
@@ -32,4 +32,6 @@
private final String name;
private final Collection<EncryptColumnRuleConfiguration> columns;
+
+ private final Boolean queryWithCipherColumn;
Review comment:
I agree with you that using `Boolean` is a better solution here, but we need to pay more attention to preventing NPE.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org