Class UserUtil

java.lang.Object
org.openmetadata.service.util.UserUtil

public final class UserUtil extends Object
  • Method Details

    • addUsers

      public static void addUsers(AuthProvider authProvider, Set<String> adminUsers, String domain, Boolean isAdmin)
    • updateUserWithHashedPwd

      public static void updateUserWithHashedPwd(User user, String pwd)
    • addOrUpdateUser

      public static User addOrUpdateUser(User user)
    • user

      public static User user(String name, String domain, String updatedBy)
    • addOrUpdateBotUser

      public static User addOrUpdateBotUser(User user)
      This method add auth mechanism in the following way:
      • If original user has already an authMechanism, add it to the user
      • Otherwise:
        • If airflow configuration is 'openmetadata' and server auth provider is not basic, add JWT auth mechanism from Airflow configuration
        • Otherwise:
          • If airflow configuration is 'basic', add JWT auth mechanism with a generated token which does not expire
          • Otherwise, add SSO auth mechanism from Airflow configuration
    • getUserOrBot

      public static EntityReference getUserOrBot(String name)
    • getRoleListFromUser

      public static Set<String> getRoleListFromUser(User user)
    • validateAndGetRolesRef

      public static List<EntityReference> validateAndGetRolesRef(Set<String> rolesList)
    • getRolesFromAuthorizationToken

      public static Set<String> getRolesFromAuthorizationToken(CatalogSecurityContext catalogSecurityContext)
    • isRolesSyncNeeded

      public static boolean isRolesSyncNeeded(Set<String> fromToken, Set<String> fromDB)
    • reSyncUserRolesFromToken

      public static boolean reSyncUserRolesFromToken(javax.ws.rs.core.UriInfo uriInfo, User user, Set<String> rolesFromToken)
    • getUser

      public static User getUser(String updatedBy, CreateUser create)