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/06/24 12:47:01 UTC

[GitHub] [shardingsphere] lwclover opened a new pull request #10998: custom authority,schema can be assigned to proxy users

lwclover opened a new pull request #10998:
URL: https://github.com/apache/shardingsphere/pull/10998


   authority enhance,sample:
   ```
   - !AUTHORITY
     users:
       - root@:root
       - user1@:user1
       - user1@127.0.0.1:user1
     provider:
       type: SCHEMA_PRIVILEGES_PERMITTED
       props:
         user-schema-mappings: root@=test, user1@127.0.0.1=db_dal_admin, user1@=test, user1@=db_dal_admin
   ```
   
   when using root login from any host,you can use database test.
   when using user1 login from 127.0.0.1,you can use database db_dal_admin.
   when using user1 login from any other host,you can use database test and db_dal_admin.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero merged pull request #10998: custom authority,schema can be assigned to proxy users

Posted by GitBox <gi...@apache.org>.
tristaZero merged pull request #10998:
URL: https://github.com/apache/shardingsphere/pull/10998


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] CrackerSuperior commented on pull request #10998: custom authority,schema can be assigned to proxy users

Posted by GitBox <gi...@apache.org>.
CrackerSuperior commented on pull request #10998:
URL: https://github.com/apache/shardingsphere/pull/10998#issuecomment-939606660


   > > authority enhance,sample:
   > > ```
   > > - !AUTHORITY
   > >   users:
   > >     - root@:root
   > >     - user1@:user1
   > >     - user1@127.0.0.1:user1
   > >   provider:
   > >     type: SCHEMA_PRIVILEGES_PERMITTED
   > >     props:
   > >       user-schema-mappings: root@=test, user1@127.0.0.1=db_dal_admin, user1@=test, user1@=db_dal_admin
   > > ```
   > > 
   > > 
   > >     
   > >       
   > >     
   > > 
   > >       
   > >     
   > > 
   > >     
   > >   
   > > when using root login from any host,you can use database test. when using user1 login from 127.0.0.1,you can use database db_dal_admin. when using user1 login from any other host,you can use database test and db_dal_admin.
   > 
   > So, what if I want user1 to be able to use all the libraries?
   
   I know that "Native" or "ALL_PRIVILEGES_PERMITTED" can be configured separately to allow "user1" to view all libraries, but "SCHEMA_PRIVILEGES_PERMITTED" cannot be used. Using "SCHEMA_PRIVILEGES_PERMITTED" alone will overwrite the permissions of other users, causing users who do not use the "SCHEMA_PRIVILEGES_PERMITTED" configuration to see any libraries. Can "SCHEMA_PRIVILEGES_PERMITTED" be used together with "ALL_PRIVILEGES_PERMITTED"?


-- 
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] terrymanu commented on a change in pull request #10998: custom authority,schema can be assigned to proxy users

Posted by GitBox <gi...@apache.org>.
terrymanu commented on a change in pull request #10998:
URL: https://github.com/apache/shardingsphere/pull/10998#discussion_r657998686



##########
File path: shardingsphere-infra/shardingsphere-infra-authority/shardingsphere-infra-authority-common/src/main/java/org/apache/shardingsphere/authority/provider/schema/builder/SchemaPrivilegeBuilder.java
##########
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.authority.provider.schema.builder;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Properties;
+import java.util.Set;
+
+import org.apache.shardingsphere.authority.model.ShardingSpherePrivileges;
+import org.apache.shardingsphere.authority.provider.schema.SchemaPrivilegesPermittedAuthorityProviderAlgorithm;
+import org.apache.shardingsphere.authority.provider.schema.model.privilege.SchemaPrivilegesPermittedShardingSpherePrivileges;
+import org.apache.shardingsphere.infra.metadata.user.ShardingSphereUser;
+
+import com.google.common.base.Preconditions;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class SchemaPrivilegeBuilder {
+    /**

Review comment:
       Please keep empty line between class and method definition

##########
File path: shardingsphere-infra/shardingsphere-infra-authority/shardingsphere-infra-authority-common/src/main/java/org/apache/shardingsphere/authority/provider/schema/builder/SchemaPrivilegeBuilder.java
##########
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.authority.provider.schema.builder;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Properties;
+import java.util.Set;
+
+import org.apache.shardingsphere.authority.model.ShardingSpherePrivileges;
+import org.apache.shardingsphere.authority.provider.schema.SchemaPrivilegesPermittedAuthorityProviderAlgorithm;
+import org.apache.shardingsphere.authority.provider.schema.model.privilege.SchemaPrivilegesPermittedShardingSpherePrivileges;
+import org.apache.shardingsphere.infra.metadata.user.ShardingSphereUser;
+
+import com.google.common.base.Preconditions;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class SchemaPrivilegeBuilder {
+    /**
+     * Build privileges.
+     *
+     * @param users users
+     * @param props props
+     * @return privileges
+     */
+    public static Map<ShardingSphereUser, ShardingSpherePrivileges> build(final Collection<ShardingSphereUser> users, final Properties props) {
+        String mappingProp = props.getProperty(SchemaPrivilegesPermittedAuthorityProviderAlgorithm.PROP_USER_SCHEMA_MAPPINGS, "");
+        Preconditions.checkArgument(!"".equals(mappingProp), "user-schema-mappings configuration `%s` can not be null", mappingProp);
+        String[] mappings = mappingProp.split(",");
+        Arrays.asList(mappings).stream().forEach(each -> Preconditions.checkArgument(0 < each.indexOf("@") && 0 < each.indexOf("="), 
+                "user-schema-mappings configuration `%s` is invalid, the configuration format should be like `username@hostname=schema`", each));
+        Map<ShardingSphereUser, ShardingSpherePrivileges> result = new HashMap<>();
+        Map<ShardingSphereUser, Set<String>> userSchemaMappings = new HashMap<>();
+        Arrays.asList(mappings).stream().map(SchemaPrivilegeBuilder::convertSchemas).forEach(each -> merge(each, userSchemaMappings));
+        users.forEach(each -> result.put(each, new SchemaPrivilegesPermittedShardingSpherePrivileges(userSchemaMappings.getOrDefault(each, Collections.emptySet()))));
+        return result;
+    }
+    
+    /**
+     * convert schemas.
+     * @param userSchemaMapping user shcema mapping
+     * @return schemas
+     */
+    private static Map<ShardingSphereUser, String> convertSchemas(final String userSchemaMapping) {
+        String[] userSchemaPair = userSchemaMapping.trim().split("=");
+        Map<ShardingSphereUser, String> result = new HashMap<>();
+
+        String yamlUser = userSchemaPair[0];
+        String username = yamlUser.substring(0, yamlUser.indexOf("@"));
+        String hostname = yamlUser.substring(yamlUser.indexOf("@") + 1);
+
+        result.put(new ShardingSphereUser(username, "", hostname), userSchemaPair[1]);
+        return result;
+    }
+    
+    /**
+     * merge user schema to result.

Review comment:
       Please upper case the first letter of java doc

##########
File path: shardingsphere-infra/shardingsphere-infra-authority/shardingsphere-infra-authority-common/src/main/java/org/apache/shardingsphere/authority/provider/schema/builder/SchemaPrivilegeBuilder.java
##########
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.authority.provider.schema.builder;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Properties;
+import java.util.Set;
+
+import org.apache.shardingsphere.authority.model.ShardingSpherePrivileges;
+import org.apache.shardingsphere.authority.provider.schema.SchemaPrivilegesPermittedAuthorityProviderAlgorithm;
+import org.apache.shardingsphere.authority.provider.schema.model.privilege.SchemaPrivilegesPermittedShardingSpherePrivileges;
+import org.apache.shardingsphere.infra.metadata.user.ShardingSphereUser;
+
+import com.google.common.base.Preconditions;
+
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
+
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
+public final class SchemaPrivilegeBuilder {
+    /**
+     * Build privileges.
+     *
+     * @param users users
+     * @param props props
+     * @return privileges
+     */
+    public static Map<ShardingSphereUser, ShardingSpherePrivileges> build(final Collection<ShardingSphereUser> users, final Properties props) {
+        String mappingProp = props.getProperty(SchemaPrivilegesPermittedAuthorityProviderAlgorithm.PROP_USER_SCHEMA_MAPPINGS, "");
+        Preconditions.checkArgument(!"".equals(mappingProp), "user-schema-mappings configuration `%s` can not be null", mappingProp);
+        String[] mappings = mappingProp.split(",");
+        Arrays.asList(mappings).stream().forEach(each -> Preconditions.checkArgument(0 < each.indexOf("@") && 0 < each.indexOf("="), 
+                "user-schema-mappings configuration `%s` is invalid, the configuration format should be like `username@hostname=schema`", each));
+        Map<ShardingSphereUser, ShardingSpherePrivileges> result = new HashMap<>();
+        Map<ShardingSphereUser, Set<String>> userSchemaMappings = new HashMap<>();
+        Arrays.asList(mappings).stream().map(SchemaPrivilegeBuilder::convertSchemas).forEach(each -> merge(each, userSchemaMappings));
+        users.forEach(each -> result.put(each, new SchemaPrivilegesPermittedShardingSpherePrivileges(userSchemaMappings.getOrDefault(each, Collections.emptySet()))));
+        return result;
+    }
+    
+    /**
+     * convert schemas.

Review comment:
       Please upper case the first letter of java doc

##########
File path: shardingsphere-infra/shardingsphere-infra-authority/shardingsphere-infra-authority-common/src/main/java/org/apache/shardingsphere/authority/provider/schema/model/privilege/SchemaPrivilegesPermittedShardingSpherePrivileges.java
##########
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.authority.provider.schema.model.privilege;
+
+import java.util.Collection;
+import java.util.Set;
+
+import org.apache.shardingsphere.authority.model.AccessSubject;
+import org.apache.shardingsphere.authority.model.PrivilegeType;
+import org.apache.shardingsphere.authority.model.ShardingSpherePrivileges;
+import org.apache.shardingsphere.authority.provider.natived.model.subject.SchemaAccessSubject;
+
+import lombok.AllArgsConstructor;
+
+@AllArgsConstructor
+public class SchemaPrivilegesPermittedShardingSpherePrivileges implements ShardingSpherePrivileges {
+
+    private Set<String> schemas;

Review comment:
       Can the attribute `schemas` to be final? 




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] lwclover commented on pull request #10998: custom authority,schema can be assigned to proxy users

Posted by GitBox <gi...@apache.org>.
lwclover commented on pull request #10998:
URL: https://github.com/apache/shardingsphere/pull/10998#issuecomment-868252664


   Give myself a thumbs up
   
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] lwclover edited a comment on pull request #10998: custom authority,schema can be assigned to proxy users

Posted by GitBox <gi...@apache.org>.
lwclover edited a comment on pull request #10998:
URL: https://github.com/apache/shardingsphere/pull/10998#issuecomment-868252664


   Thank you @tristaZero. Give myself a thumbs up
   
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] CrackerSuperior commented on pull request #10998: custom authority,schema can be assigned to proxy users

Posted by GitBox <gi...@apache.org>.
CrackerSuperior commented on pull request #10998:
URL: https://github.com/apache/shardingsphere/pull/10998#issuecomment-939607724


   > > authority enhance,sample:
   > > ```
   > > - !AUTHORITY
   > >   users:
   > >     - root@:root
   > >     - user1@:user1
   > >     - user1@127.0.0.1:user1
   > >   provider:
   > >     type: SCHEMA_PRIVILEGES_PERMITTED
   > >     props:
   > >       user-schema-mappings: root@=test, user1@127.0.0.1=db_dal_admin, user1@=test, user1@=db_dal_admin
   > > ```
   > > 
   > > 
   > >     
   > >       
   > >     
   > > 
   > >       
   > >     
   > > 
   > >     
   > >   
   > > when using root login from any host,you can use database test. when using user1 login from 127.0.0.1,you can use database db_dal_admin. when using user1 login from any other host,you can use database test and db_dal_admin.
   > 
   > So, what if I want user1 to be able to use all the libraries?
   
   I know that it is possible to configure a "Native" or "all_useres_permitted" separately to allow user1 to view all repositories, but not to use "SCHEMA_PRIVILEGES_PERMITTED".  Using a schema_useres_permitted configuration alone overwrites the privileges of another user, causing a user without a schema_useres_permitted configuration to see no repository.  Can "SCHEMA_PRIVILEGES_PERMITTED" be used with "ALL_PRIVILEGES_PERMITTED"?  


-- 
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] CrackerSuperior commented on pull request #10998: custom authority,schema can be assigned to proxy users

Posted by GitBox <gi...@apache.org>.
CrackerSuperior commented on pull request #10998:
URL: https://github.com/apache/shardingsphere/pull/10998#issuecomment-938293720


   > authority enhance,sample:
   > 
   > ```
   > - !AUTHORITY
   >   users:
   >     - root@:root
   >     - user1@:user1
   >     - user1@127.0.0.1:user1
   >   provider:
   >     type: SCHEMA_PRIVILEGES_PERMITTED
   >     props:
   >       user-schema-mappings: root@=test, user1@127.0.0.1=db_dal_admin, user1@=test, user1@=db_dal_admin
   > ```
   > 
   > when using root login from any host,you can use database test. when using user1 login from 127.0.0.1,you can use database db_dal_admin. when using user1 login from any other host,you can use database test and db_dal_admin.
   
   So, what if I want user1 to be able to use all the libraries?


-- 
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 #10998: custom authority,schema can be assigned to proxy users

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


   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/10998?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 [#10998](https://codecov.io/gh/apache/shardingsphere/pull/10998?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f046d4e) into [master](https://codecov.io/gh/apache/shardingsphere/commit/a1ca3a7c5ba0b2924c710055149aa12916f730b4?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a1ca3a7) will **decrease** coverage by `0.05%`.
   > The diff coverage is `9.09%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/10998/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/10998?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   #10998      +/-   ##
   ============================================
   - Coverage     65.73%   65.67%   -0.06%     
     Complexity      713      713              
   ============================================
     Files          1810     1813       +3     
     Lines         30803    30837      +34     
     Branches       5549     5553       +4     
   ============================================
   + Hits          20248    20252       +4     
   - Misses         8958     8987      +29     
   - Partials       1597     1598       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/10998?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...PrivilegesPermittedAuthorityProviderAlgorithm.java](https://codecov.io/gh/apache/shardingsphere/pull/10998/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtYXV0aG9yaXR5L3NoYXJkaW5nc3BoZXJlLWluZnJhLWF1dGhvcml0eS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2F1dGhvcml0eS9wcm92aWRlci9zY2hlbWEvU2NoZW1hUHJpdmlsZWdlc1Blcm1pdHRlZEF1dGhvcml0eVByb3ZpZGVyQWxnb3JpdGhtLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...rovider/schema/builder/SchemaPrivilegeBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/10998/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtYXV0aG9yaXR5L3NoYXJkaW5nc3BoZXJlLWluZnJhLWF1dGhvcml0eS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2F1dGhvcml0eS9wcm92aWRlci9zY2hlbWEvYnVpbGRlci9TY2hlbWFQcml2aWxlZ2VCdWlsZGVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...maPrivilegesPermittedShardingSpherePrivileges.java](https://codecov.io/gh/apache/shardingsphere/pull/10998/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtYXV0aG9yaXR5L3NoYXJkaW5nc3BoZXJlLWluZnJhLWF1dGhvcml0eS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2F1dGhvcml0eS9wcm92aWRlci9zY2hlbWEvbW9kZWwvcHJpdmlsZWdlL1NjaGVtYVByaXZpbGVnZXNQZXJtaXR0ZWRTaGFyZGluZ1NwaGVyZVByaXZpbGVnZXMuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...xt/admin/mysql/executor/ShowDatabasesExecutor.java](https://codecov.io/gh/apache/shardingsphere/pull/10998/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L2FkbWluL215c3FsL2V4ZWN1dG9yL1Nob3dEYXRhYmFzZXNFeGVjdXRvci5qYXZh) | `92.30% <80.00%> (+47.86%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/10998?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/10998?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 [a1ca3a7...f046d4e](https://codecov.io/gh/apache/shardingsphere/pull/10998?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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] CrackerSuperior removed a comment on pull request #10998: custom authority,schema can be assigned to proxy users

Posted by GitBox <gi...@apache.org>.
CrackerSuperior removed a comment on pull request #10998:
URL: https://github.com/apache/shardingsphere/pull/10998#issuecomment-939606660


   > > authority enhance,sample:
   > > ```
   > > - !AUTHORITY
   > >   users:
   > >     - root@:root
   > >     - user1@:user1
   > >     - user1@127.0.0.1:user1
   > >   provider:
   > >     type: SCHEMA_PRIVILEGES_PERMITTED
   > >     props:
   > >       user-schema-mappings: root@=test, user1@127.0.0.1=db_dal_admin, user1@=test, user1@=db_dal_admin
   > > ```
   > > 
   > > 
   > >     
   > >       
   > >     
   > > 
   > >       
   > >     
   > > 
   > >     
   > >   
   > > when using root login from any host,you can use database test. when using user1 login from 127.0.0.1,you can use database db_dal_admin. when using user1 login from any other host,you can use database test and db_dal_admin.
   > 
   > So, what if I want user1 to be able to use all the libraries?
   
   I know that "Native" or "ALL_PRIVILEGES_PERMITTED" can be configured separately to allow "user1" to view all libraries, but "SCHEMA_PRIVILEGES_PERMITTED" cannot be used. Using "SCHEMA_PRIVILEGES_PERMITTED" alone will overwrite the permissions of other users, causing users who do not use the "SCHEMA_PRIVILEGES_PERMITTED" configuration to see any libraries. Can "SCHEMA_PRIVILEGES_PERMITTED" be used together with "ALL_PRIVILEGES_PERMITTED"?


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