lasdf1234 commented on code in PR #11226:
URL: https://github.com/apache/gravitino/pull/11226#discussion_r3315751627
##########
plugins/idp-basic/src/main/java/org/apache/gravitino/idp/storage/mapper/IdpGroupMetaSQLProviderFactory.java:
##########
@@ -49,6 +49,10 @@ public static String selectIdpGroup(@Param("groupName")
String groupName) {
return currentProvider().selectIdpGroup(groupName);
}
+ public static String selectIdpGroupWithUsers(@Param("groupName") String
groupName) {
Review Comment:
This factory class returns SQL, it should be String.
##########
plugins/idp-basic/src/main/java/org/apache/gravitino/idp/storage/mapper/provider/h2/IdpGroupMetaH2Provider.java:
##########
@@ -19,11 +19,38 @@
package org.apache.gravitino.idp.storage.mapper.provider.h2;
+import org.apache.gravitino.idp.storage.mapper.IdpGroupMetaMapper;
+import org.apache.gravitino.idp.storage.mapper.IdpUserGroupRelMapper;
+import org.apache.gravitino.idp.storage.mapper.IdpUserMetaMapper;
import
org.apache.gravitino.idp.storage.mapper.provider.base.IdpGroupMetaBaseSQLProvider;
+import org.apache.ibatis.annotations.Param;
/** SQL provider for IdP group metadata statements on H2 backends. */
public class IdpGroupMetaH2Provider extends IdpGroupMetaBaseSQLProvider {
+ @Override
+ public String selectIdpGroupWithUsers(@Param("groupName") String groupName) {
+ return "SELECT g.group_name as name,"
+ + " '['"
+ + " || COALESCE(GROUP_CONCAT("
+ + " CASE"
+ + " WHEN u.user_name IS NOT NULL AND u.user_name <> ''"
+ + " THEN '\"' || u.user_name || '\"'"
+ + " ELSE NULL"
+ + " END), '')"
+ + " || ']' as usernames"
Review Comment:
User and group mapper such logical patterns have been deleted.
##########
plugins/idp-basic/src/main/java/org/apache/gravitino/idp/model/IdpUser.java:
##########
@@ -26,16 +26,19 @@
public class IdpUser {
private final String name;
+ private final String passwordHash;
private final List<String> groupNames;
/**
* Creates a built-in IdP user.
*
* @param name The username.
+ * @param passwordHash The password hash, or null when not loaded or not
applicable.
* @param groupNames The group names the user belongs to.
*/
- public IdpUser(String name, List<String> groupNames) {
+ public IdpUser(String name, String passwordHash, List<String> groupNames) {
Review Comment:
I split the constructor of IdpUser into two parts, one including
passwordHash and the other not. The constructor that includes the
"passwordHash" parameter will check that "passwordHash" cannot be empty.
##########
clients/client-python/gravitino/filesystem/gvfs_config.py:
##########
@@ -25,6 +25,9 @@ class GVFSConfig:
AUTH_TYPE = "auth_type"
SIMPLE_AUTH_TYPE = "simple"
+ BASIC_AUTH_TYPE = "basic"
+ BASIC_USERNAME = "basic_username"
+ BASIC_PASSWORD = "basic_password"
Review Comment:
Got added.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]