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 2022/07/20 15:31:00 UTC

[GitHub] [shardingsphere] runqi-zhao opened a new pull request, #19399: Optimize configuration for privilege provider DATABASE_PERMITTED

runqi-zhao opened a new pull request, #19399:
URL: https://github.com/apache/shardingsphere/pull/19399

   Fixes #15711.
   
   Changes proposed in this pull request:
   - All schemas can be granted to a user in the form of *
   - Update SchemaPrivilegesPermittedAuthorityProviderAlgorithmTest
   


-- 
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] RaigorJiang commented on a diff in pull request #19399: Optimize configuration for privilege provider DATABASE_PERMITTED

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on code in PR #19399:
URL: https://github.com/apache/shardingsphere/pull/19399#discussion_r931202055


##########
shardingsphere-kernel/shardingsphere-authority/shardingsphere-authority-core/src/test/java/org/apache/shardingsphere/authority/provider/schema/DatabasePermittedPrivilegesProviderAlgorithmTest.java:
##########
@@ -41,6 +42,7 @@ public void assertBuildAuthorityRegistry() {
         Optional<ShardingSpherePrivileges> privileges = actual.findPrivileges(new Grantee("user1", "127.0.0.2"));
         assertTrue(privileges.isPresent());
         assertTrue(privileges.get().hasPrivileges("test"));
+        assertTrue(privileges.get().hasPrivileges(new DatabaseAccessSubject("*"), Collections.emptyList()));

Review Comment:
   It's not a good test case, try:
   ```
   assertTrue(privileges.get().hasPrivileges("db_dal_admin");
   ```
   Because `db_dal_admin` is one of the two databases in your `user_database_mappings`.



-- 
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] RaigorJiang commented on a diff in pull request #19399: Optimize configuration for privilege provider DATABASE_PERMITTED

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on code in PR #19399:
URL: https://github.com/apache/shardingsphere/pull/19399#discussion_r931206242


##########
shardingsphere-kernel/shardingsphere-authority/shardingsphere-authority-core/src/test/java/org/apache/shardingsphere/authority/provider/schema/DatabasePermittedPrivilegesProviderAlgorithmTest.java:
##########
@@ -41,6 +42,7 @@ public void assertBuildAuthorityRegistry() {
         Optional<ShardingSpherePrivileges> privileges = actual.findPrivileges(new Grantee("user1", "127.0.0.2"));
         assertTrue(privileges.isPresent());
         assertTrue(privileges.get().hasPrivileges("test"));
+        assertTrue(privileges.get().hasPrivileges(new DatabaseAccessSubject("*"), Collections.emptyList()));

Review Comment:
   The param of DatabaseAccessSubject should be a name of logic database, like `db_dal_admin` in the `PROP_USER_DATABASE_MAPPINGS`, can not be `*`, is 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] RaigorJiang commented on pull request #19399: Optimize configuration for privilege provider DATABASE_PERMITTED

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on PR #19399:
URL: https://github.com/apache/shardingsphere/pull/19399#issuecomment-1198440974

   @runqi-zhao Merged, thank you!


-- 
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] RaigorJiang merged pull request #19399: Optimize configuration for privilege provider DATABASE_PERMITTED

Posted by GitBox <gi...@apache.org>.
RaigorJiang merged PR #19399:
URL: https://github.com/apache/shardingsphere/pull/19399


-- 
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 #19399: Optimize configuration for privilege provider DATABASE_PERMITTED

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #19399:
URL: https://github.com/apache/shardingsphere/pull/19399#issuecomment-1190960757

   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/19399?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 [#19399](https://codecov.io/gh/apache/shardingsphere/pull/19399?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7d2cc41) into [master](https://codecov.io/gh/apache/shardingsphere/commit/7c76b52c2268e663dc83d9e56e939d98aafc97c1?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7c76b52) will **decrease** coverage by `0.04%`.
   > The diff coverage is `58.18%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #19399      +/-   ##
   ============================================
   - Coverage     59.68%   59.63%   -0.05%     
   - Complexity     2373     2378       +5     
   ============================================
     Files          3819     3823       +4     
     Lines         54382    54438      +56     
     Branches       7629     7638       +9     
   ============================================
   + Hits          32456    32463       +7     
   - Misses        19122    19180      +58     
   + Partials       2804     2795       -9     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/19399?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...e/ShardingRuleAlteredJobConfigurationPreparer.java](https://codecov.io/gh/apache/shardingsphere/pull/19399/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvZGF0YS9waXBlbGluZS9TaGFyZGluZ1J1bGVBbHRlcmVkSm9iQ29uZmlndXJhdGlvblByZXBhcmVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...e/infra/config/props/ConfigurationPropertyKey.java](https://codecov.io/gh/apache/shardingsphere/pull/19399/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9jb25maWcvcHJvcHMvQ29uZmlndXJhdGlvblByb3BlcnR5S2V5LmphdmE=) | `100.00% <ø> (ø)` | |
   | [...e/schema/decorator/model/ShardingSphereSchema.java](https://codecov.io/gh/apache/shardingsphere/pull/19399/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9kYXRhYmFzZS9zY2hlbWEvZGVjb3JhdG9yL21vZGVsL1NoYXJkaW5nU3BoZXJlU2NoZW1hLmphdmE=) | `71.42% <0.00%> (-3.58%)` | :arrow_down: |
   | [.../executor/advanced/AdvancedFederationExecutor.java](https://codecov.io/gh/apache/shardingsphere/pull/19399/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtZmVkZXJhdGlvbi9zaGFyZGluZ3NwaGVyZS1pbmZyYS1mZWRlcmF0aW9uLWV4ZWN1dG9yL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9mZWRlcmF0aW9uL2V4ZWN1dG9yL2FkdmFuY2VkL0FkdmFuY2VkRmVkZXJhdGlvbkV4ZWN1dG9yLmphdmE=) | `25.00% <0.00%> (ø)` | |
   | [.../executor/original/OriginalFederationExecutor.java](https://codecov.io/gh/apache/shardingsphere/pull/19399/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtZmVkZXJhdGlvbi9zaGFyZGluZ3NwaGVyZS1pbmZyYS1mZWRlcmF0aW9uLWV4ZWN1dG9yL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9mZWRlcmF0aW9uL2V4ZWN1dG9yL29yaWdpbmFsL09yaWdpbmFsRmVkZXJhdGlvbkV4ZWN1dG9yLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...or/original/table/FilterableTableScanExecutor.java](https://codecov.io/gh/apache/shardingsphere/pull/19399/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtZmVkZXJhdGlvbi9zaGFyZGluZ3NwaGVyZS1pbmZyYS1mZWRlcmF0aW9uLWV4ZWN1dG9yL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9mZWRlcmF0aW9uL2V4ZWN1dG9yL29yaWdpbmFsL3RhYmxlL0ZpbHRlcmFibGVUYWJsZVNjYW5FeGVjdXRvci5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [.../driver/jdbc/adapter/AbstractStatementAdapter.java](https://codecov.io/gh/apache/shardingsphere/pull/19399/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-c2hhcmRpbmdzcGhlcmUtamRiYy9zaGFyZGluZ3NwaGVyZS1qZGJjLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2RyaXZlci9qZGJjL2FkYXB0ZXIvQWJzdHJhY3RTdGF0ZW1lbnRBZGFwdGVyLmphdmE=) | `72.85% <0.00%> (ø)` | |
   | [...core/check/consistency/DataConsistencyChecker.java](https://codecov.io/gh/apache/shardingsphere/pull/19399/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-c2hhcmRpbmdzcGhlcmUta2VybmVsL3NoYXJkaW5nc3BoZXJlLWRhdGEtcGlwZWxpbmUvc2hhcmRpbmdzcGhlcmUtZGF0YS1waXBlbGluZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9kYXRhL3BpcGVsaW5lL2NvcmUvY2hlY2svY29uc2lzdGVuY3kvRGF0YUNvbnNpc3RlbmN5Q2hlY2tlci5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [.../core/metadata/generator/PipelineDDLGenerator.java](https://codecov.io/gh/apache/shardingsphere/pull/19399/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-c2hhcmRpbmdzcGhlcmUta2VybmVsL3NoYXJkaW5nc3BoZXJlLWRhdGEtcGlwZWxpbmUvc2hhcmRpbmdzcGhlcmUtZGF0YS1waXBlbGluZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9kYXRhL3BpcGVsaW5lL2NvcmUvbWV0YWRhdGEvZ2VuZXJhdG9yL1BpcGVsaW5lRERMR2VuZXJhdG9yLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [.../proxy/backend/communication/ProxySQLExecutor.java](https://codecov.io/gh/apache/shardingsphere/pull/19399/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9jb21tdW5pY2F0aW9uL1Byb3h5U1FMRXhlY3V0b3IuamF2YQ==) | `29.09% <0.00%> (ø)` | |
   | ... and [81 more](https://codecov.io/gh/apache/shardingsphere/pull/19399/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) | |
   
   


-- 
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] RaigorJiang commented on a diff in pull request #19399: Optimize configuration for privilege provider DATABASE_PERMITTED

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on code in PR #19399:
URL: https://github.com/apache/shardingsphere/pull/19399#discussion_r931026840


##########
shardingsphere-kernel/shardingsphere-authority/shardingsphere-authority-core/src/test/java/org/apache/shardingsphere/authority/provider/schema/DatabasePermittedPrivilegesProviderAlgorithmTest.java:
##########
@@ -41,6 +41,7 @@ public void assertBuildAuthorityRegistry() {
         Optional<ShardingSpherePrivileges> privileges = actual.findPrivileges(new Grantee("user1", "127.0.0.2"));
         assertTrue(privileges.isPresent());
         assertTrue(privileges.get().hasPrivileges("test"));
+        assertTrue(privileges.get().hasPrivileges("*"));

Review Comment:
   Please check the user has privilege of any database, not privilege of `*`.



-- 
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