mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2026-01-05 20:17:07 +00:00
Migrate NameHash (#17317)
This commit is contained in:
parent
21120a0130
commit
9bbc6a1801
@ -19,3 +19,5 @@ SET json = JSON_SET(
|
||||
'$.fullyQualifiedName',
|
||||
LOWER(JSON_UNQUOTE(JSON_EXTRACT(json, '$.fullyQualifiedName')))
|
||||
);
|
||||
|
||||
UPDATE user_entity SET nameHash = MD5(JSON_UNQUOTE(JSON_EXTRACT(json, '$.fullyQualifiedName')));
|
||||
|
||||
@ -18,4 +18,6 @@ SET json = jsonb_set(
|
||||
json,
|
||||
'{fullyQualifiedName}',
|
||||
to_jsonb(LOWER(json->>'fullyQualifiedName'))
|
||||
);
|
||||
);
|
||||
|
||||
UPDATE user_entity SET nameHash = MD5(json ->> 'fullyQualifiedName');
|
||||
@ -568,14 +568,14 @@ public class UserResource extends EntityResource<User, UserRepository> {
|
||||
@Context ContainerRequestContext containerRequestContext,
|
||||
@Valid CreateUser create) {
|
||||
User user = getUser(securityContext.getUserPrincipal().getName(), create);
|
||||
if (Boolean.TRUE.equals(create.getIsBot())) {
|
||||
if (Boolean.TRUE.equals(user.getIsBot())) {
|
||||
addAuthMechanismToBot(user, create, uriInfo);
|
||||
}
|
||||
|
||||
//
|
||||
try {
|
||||
// Email Validation
|
||||
validateEmailAlreadyExists(create.getEmail());
|
||||
validateEmailAlreadyExists(user.getEmail());
|
||||
addUserAuthForBasic(user, create);
|
||||
} catch (RuntimeException ex) {
|
||||
return Response.status(CONFLICT)
|
||||
@ -594,8 +594,7 @@ public class UserResource extends EntityResource<User, UserRepository> {
|
||||
createdUserRes = create(uriInfo, securityContext, user);
|
||||
} catch (EntityNotFoundException ex) {
|
||||
if (isSelfSignUpEnabled) {
|
||||
if (securityContext.getUserPrincipal().getName().equals(create.getName())) {
|
||||
// User is creating himself on signup ?! :(
|
||||
if (securityContext.getUserPrincipal().getName().equals(user.getName())) {
|
||||
User created = addHref(uriInfo, repository.create(uriInfo, user));
|
||||
createdUserRes = Response.created(created.getHref()).entity(created).build();
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user